The virt-v2v tool converts virtual machines (VMs), including their disk images and metadata, from foreign hypervisors for use with Red Hat Enterprise Linux with KVM managed by libvirt, Red Hat Virtualization, and Red Hat OpenStack Platform.
This article provides instructions for converting a Linux VM from a VMware vCenter hypervisor to run on Red Hat Enterprise Linux 7 KVM and Red Hat Enterprise Linux 8 KVM.
For an overview of the virt-v2v tool, supported conversions, and links to other types of VM conversions, see Converting Virtual Machines from Other Hypervisors to KVM with virt-v2v in RHEL 7 and RHEL 8.
On successful completion of the conversion process, virt-v2v creates a new libvirt domain XML file for the converted VM with the same name as the original VM. The VM can be started using libvirt tools, such as virt-manager or virsh.
Note: If virt-v2v is run as a non-root user, the virt-manager application will not detect the converted VM. This is because virt-v2v saves converted VMs to the current user's namespace, but libvirt maintains separate namespaces for the VMs for each user.
virt-v2v must be run on a Red Hat Enterprise Linux 64-bit host system.
Ensure that the VM is stopped prior to running the conversion process.
The following minimum system resources must be available:
- Minimum network speed 1Gbps
- Disk space: sufficient space to store the VM's disk image, plus 1 GB
- Sufficient free space in the VM file system according to the following table:
|File system||Minimum free space|
|Root file system||20 MB|
|Every other mountable file system||10 MB|
Install the virt-v2v package and its dependencies on the host system:
# yum install virt-v2v
To convert the VMware Linux virtual machine, use the following command and replace vcenter.example.com/Datacenter/esxi with the path to the VMWare vCenter and guestvm1 with the name of the VM to convert:
# virt-v2v -ic vpx://vcenter.example.com/Datacenter/esxi guestvm1
Note: If the vpx user name contains a backslash character (such as DOMAIN\USER), it is necessary to enter a URI escape for the character: DOMAIN%5cUSER. Similarly, spaces in the Datacenter name must be entered using the %20 code.
For a full list of virt-v2v parameters, see the virt-v2v man page.
Authenticate to the VMware vCenter server.
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: When the 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:
... -ic esx://esx.example.com?no_verify=1 ...
Observe the conversion progress. A successful conversion output looks similar to the following:
# virt-v2v -ic vpx://email@example.com/Datacenter/esxi "guestvm1" [ 0.0] Opening the source -ic vpx://firstname.lastname@example.org/Datacenter/esxi [ 1.1] Creating an overlay to protect the source from being modified [ 1.7] Initializing the target [ 1.7] Opening the overlay [ 25.8] Inspecting the overlay [ 30.9] Checking for sufficient free disk space in the guest [ 30.9] Estimating space required on target for each disk [ 30.9] Converting Red Hat Enterprise Linux Server release 5.11 (Tikanga) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 45.4] Mapping filesystem data to avoid copying unused and blank areas [ 45.5] Closing the overlay [ 45.7] Checking if the guest needs BIOS or UEFI to boot [ 45.7] Assigning disks to buses [ 45.7] Copying disk 1/1 to /var/tmp/RHEL 5.11 Server-sda (qcow2) [ 93.0] Creating output metadata [ 93.0] Finished off
Confirm that the VM has been imported correctly:
# virsh list --all
If this command lists the new Linux VM, you have successfully converted and imported the VM. Boot the VM's guest OS and confirm its full functionality before deleting the original VM or migrating active services.
Step 6 [Optional]
Update the imported VM's network configuration.
The virt-v2v tool cannot currently reconfigure a VM's network configuration. If the converted VM is not connected to the same subnet as the source, its network configuration may have to be updated. For more information, see the virt-customize(1) man page.
For more information on managing VMs with libvirt in RHEL 7, see the Red Hat Enterprise Linux 7 Virtualization Deployment and Administration Guide.
For more information on managing VMs with libvirt in RHEL 8, see Configuring and Managing Virtualization.
For more information on using virt-v2v to convert VMs, you can see the following articles:
- Converting a VMware vCenter Linux virtual machine to KVM
- Converting a VMware vCenter Windows virtual machine to KVM
- Converting VMware virtual machine to import to Red Hat OpenStack Platform
- Exporting a virtual machine from VMware as an OVA file and importing it into KVM
- Converting a Xen Linux virtual machine to KVM
In addition, you can refer to the virt-v2v man page and the virt-v2v upstream documentation.