This article provides instructions on converting a Linux virtual machine from a VMware vCenter hypervisor to a Virtuozzo Hybrid Server 7 VM.
Virt-v2v converts guests from a foreign hypervisor to run on libvirt-managed KVM targets. For an overview of the virt-v2v tool, supported conversions, and links to other types of virtual machine conversions, see https://access.redhat.com/articles/1351473
To convert a VMware virtual machine from VMware vCenter please do the following:
1. Make sure the Virtuozzo host has enough disk space to store the virtual machine.
2. Uninstall VMware Guest Tools from the virtual machine.
3. Stop the VMware virtual machine.
4. On the Virtuozzo host, create a directory to store the virtual machine’s disk image and XML configuration file. For example, /v2v_images.
5. Run the migration tool on the Virtuozzo host:# virt-v2v -ic vpx://username@esx.example.com/Datacenter/esxi "vmname" -o local -os /v2v_images
You can also use the --network parameter to connect to a locally managed network if your virtual machine only has a single network interface. For a full list of virt-v2v parameters, see the virt-v2v man page. Virt-v2v creates two files in your directory: VM disk in qcow2 format and .xml file with VM description.
Note 1: If the vpx username contains a backslash character (such as DOMAIN\USER), it is necessary to use a URI escape for the character: DOMAIN%5cUSER. Similarly, space characters in the Datacenter name must be escaped using the %20 code.
Note 2: Connecting to the VMware vCenter server requires authentication. virt-v2v supports password authentication when connecting to VMware vCenter. The password can be entered during conversion, or by using the --password-file option.
Note 3: Connecting to a VMware vCenter server without a vCenter CA certificate, but if VMware vCenter server is not configured with a valid vCenter CA certificate, for example if it uses a self-signed certificate, connecting to the server will fail. In this case, certificate checking can be explicitly disabled by adding ?no_verify=1 to the connection URI as shown below:# virt-v2v -ic vpx://username@esx.example.com/Datacenter/esxi/?no_verify=1 "vmname" -o local -os /v2v_images
6. To be able to manage the migrated virtual machine via prlctl create an empty virtual machine and replace its disk with the converted image:# prlctl create --distribution --vmtype vm
7. Replace original harddisk.hdd created with VM with renamed QCOW2 image. To locate VM's image file you should list all virtual environments:# prlctl list --all
UUID STATUS IP_ADDR T NAME
{f0e77ce5-ff14-4cab-8907-74918e9f4798} stopped - VM Ubuntu
The result of command execution is a list of all virtual environments registered on Virtuozzo 7 host. What we are looking here for is the UUID of the virtual environment we created before: f0e77ce5-ff14-4cab-8907-74918e9f4798. Now we have path to VM's disk:/vz/vmprivate/f0e77ce5-ff14-4cab-8907-74918e9f4798/harddisk.hdd
Replace this file with your QCOW2 image.# rm /vz/vmprivate/f0e77ce5-ff14-4cab-8907-74918e9f4798/harddisk.hdd –y
# cp /v2v_images/vmname /vz/vmprivate/f0e77ce5-ff14-4cab-8907-74918e9f4798/harddisk.hdd
You can find more details in this article: How to run KVM VM from qcow2 image on Virtuozzo 7
8. Start the VM:# prlctl start
9. Install Virtuozzo guest tools in the migrated virtual machine and set up networking.
10. If required, perform other configuration adjustments.
Note 4: Windows machines can be converted in the same way, except that the initial start might need disk emulation type to be set to IDE, and a dummy disk connected as VIRTIO. After proper installation of drivers, disk connection for the system disk can be also switched to VIRTIO.
1. set disk to IDE, add another disk:# prlctl set --device-set hdd0 --iface ide
# prlctl set --device-add hdd
2. start VM, setup drivers, stop VM.
3. reconfigure disk to VIRTIO and remove second additional disk:# prlctl set --device-set hdd0 --iface virtio
# prlctl set --device-del hdd1
4. start VM again, reboot it if it fails to boot first time.