-
How to convert vmdk to raw image with QEMU-img?
-
How to easily migrate virtual machine with Vinchin Backup & Recovery?
-
Sum Up
Companies now are more willing to accept virtual environment for business systems because it saves money and brings flexibility. There are many virtualization solutions in the world and every one of them has its unique features.
VMware is the most popular virtualization vendors. It provides a series of solutions including vSphere, Workstation, Fusion, etc. for both enterprises and individuals. Virtual machines are used as real machines but actually, every machine is just a folder on datastore. In the folder, vmdk files are the virtual hard disks, storing applications and other data. If you would like to move VM to another host, the vmdk files are indispensable.
KVM is another popular virtualization solution which often works together with QEMU Emulator. Compared with VMware, it is open-source and free and saves virtual hard disks with different formats. The common virtual machine formats of KVM virtual machine are raw, qcow2. Raw image has excellent performance which is nearly the same as the performance of physical hard disk. One of the advantages of raw image is that it will be easy to convert raw image to another kind of image because it is “raw”.
Some virtualization vendors will allow users to directly import other kinds of image to their hosts like importing vmdk to XenServer, but the process is using XenConvert to import the vmdk file. In other words, V2V converter is still needed.
In KVM environment, most operations are finished by commands. It is hard to directly attach a vmdk file to KVM virtual machine. Vmdk image still needs to be converted to raw or qcow2 image before importing it to KVM virtual machine.
How to convert vmdk to raw image with QEMU-img?
Virtualization suppliers often provide their own virtual disk converter to let users quickly move virtual machines from the former virtual environment, like VMware vCenter Converter Standalone and Microsoft Virtual Machine Converter, etc. Apart from these official converter tool, there is a powerful tool for many kinds virtual hard disk, QEMU-img, which supports converting images like raw, qcow2, qed, vdi, vmdk, vhd. You can also try it to convert vmdk to qcow2 later.
To convert the vmdk image, you need to download and install this application and then finish the rest of jobs with command lines.
The installation process is simple on Windows computer, just double-click the installation package and follow the instruction to complete the installation.
However, on Linux computer, you need to install it with different commands according to the Linux operating system you are using.
For Ubuntu/Debian:
apt install qemu-img
For CentOS/Red Hat/Oracle:
yum install qemu-img
For SUSE/OpenSUSE:
zypper install qemu-img
No matter on Windows or Linux computer, don't forget to verify the installation of QEMU-img.
For Windows operating system:
qemu-img --help
For Linux operating system:
qemu-img -v
There is only one step to getting raw image. You just need a command.
qemu-img convert -p -f vmdk -O raw vmware-image.vmdk vmware-iamge.qcow2
-p: presenting the conversion progress
-f: format of the source image
-O: format of the target image
To use the raw image on KVM virtual machine, you need to import the the image to KVM virtual machine and test whether it works later. After that you can use commands to backup KVM virtual machine.
How to easily migrate virtual machine with Vinchin Backup & Recovery?
To migrate from VMware to KVM, you can also skip the steps of converting VMware virtual hard disk to KVM raw image.
Vinchin Backup & Recovery can help you move the entire folder of VMware virtual machine to KVM-based hypervisor like RHV, oVirt, Oracle Linux KVM, OpenStack, etc. (native KVM is not supported for now) so you don't have to export vmdk image, convert it into raw image, or configure the new virtual machine.
You can easily add the VMware and KVM hosts to Vinchin backup system via a user-friendly web console. The second step is backing up VMware virtual machines agentlessly to get the image of VMware virtual machine. The third step is select the KVM host to restore the KVM image. Vinchin Virtual Machine Convert Engine will automatically convert the image so you don't have to do extra jobs.
Vinchin Backup & Recovery has helped thousands of companies build highly efficient disaster recovery systems. You can also deploy this system in your virtual environment with a 60-day full-featured free trial. Just click the button to get the installation package.
Sum Up
Virtual disks in different virtual environments are stored with different formats. In VMware environment, it is vmdk format, while in KVM environment, it is raw format. To move VM from VMware to KVM, IT administrators need to convert vmdk image to raw image with V2V tool, QEMU-img.
Vinchin Backup & Recovery can be also used to perform V2V migration. It will save a lot of jobs during the process. Don't miss the free trial.
Share on: