virt-v2v is the utility that allows converting virtual machines so the KVM hypervisor can start them. You can use it to convert the virtual machines created in VMware, Xen, Hyper-V, and other hypervisors.
Execute the command to install virt-v2v on CentOS 7:
yum install virt-v2v
To view the full documentation on virt-v2v:
man virt-v2v
Operation mode
The virt-v2v operation mode is defined by the following parameters:
- -i — input data type;
- -o — output data type.
Input data type:
- -i disk <virtual disk name> — the virtual disk from the local storage;
- -i libvirt <virtual machine name or id> — the VM disk is exported from libvirt. In libvirt the virtual machine is defined by the specified name or id. It is used by default. The parameter -ic allows to select a hypervisor that libvirt uses;
- -i libvirtxml <VM XML-description> — the virtual disk of the virtual machine with the libvirt XML-description;
- -i ova — the virtual disk of the VMware virtual machine in the ova format;
- -i vmx — the virtual disk of the VMware virtual machine in the wmx format.
Output data type:
- -o glance — the virtual disk is specified for OpenStack Glance;
- -o libvirt — the virtual disk is specified for libvirt. Libvirt connects a disk to the local or remote KVM hypervisor. The parameter -oc allows to select an exporting hypervisor;
- -o local -os /dir — the virtual disk with the libvirt configuration file are added into the /dir directory specified by the -os parameter;
- -o qemu — the virtual disk is added locally, and the script for VM upload is added directly to QEMU;
- -o rhv — the virtual disk is added to RHV / oVirt.
Converting virtual machines for import into VMmanager
You can use the virt-v2v utility when importing a virtual machine into VMmanager. Learn more in Import of virtual machines.
To import the VM disk in VMmanager you need to specify the output data type -o local -os /dir, where /dir — the directory to add the converted virtual machine.