Netcup – Part 2: Up/Downloading Disk Images

In the previous post I described my first experiences with Netcup and that the server management interface held a pleasant surprise I would describe in a follow up post. So here it is: Uploading and downloading disk images!

Unlike VMs I have used at different data center providers in the past, Netcup seems to use the open source KVM and Qemu for virtualization and exposes disk images used by their VMs for upload and download. That means that it is possible to download the disk image of a VM and and instantiate a new VM with it elsewhere. It is also possible to prepare a disk image at home with KVM/Qemu and then upload it to Netcup and run it in a VM there. Wow, what a cool feature!

To see if it really works, I created a snapshot of the Netcup VM and downloaded it to my own KVM/Qemu bare metal server at home. To make things easy, the web interface provides a download link that can be used with wget to download it straight to the server. By default, the image is compressed, but the steps on the shell to turn it into a qcow2 disk file is straight forward:

zstd -d netcup-test-image.raw.zst netcup-test-image.raw

qemu-img convert -f raw -O qcow2 netcup-test-image.raw netcup-test-im.qcow2

Once in qcow2 format, the disk can be used for a new VM which boots just fine on my sever. The only thing that needs to be changed are the network interface settings, as the VM needs a different IP address, gateway and DNS server. The files to modify in the VM are:

# eth0 configured in:
/etc/network/interfaces.d/50-cloud-init.cfg

# dns configured in:
/etc/resolv.conf

And that’s it, a fully working clone of the Netcup VM on a different bare metal server! In a follow up post I’ll have a look at how uploading and running a disk image works as part of a datacenter VM migration.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.