Exporting a virtual machine from VMware as an OVA file and importing it into KVM
The virt-v2v tool converts virtual machines (VMs) from foreign hypervisors, including their disk images and metadata, for use with Red Hat Enterprise Linux KVM managed by libvirt, Red Hat Virtualization, and Red Hat OpenStack Platform.
This article provides instructions for converting a VM from a VMware vCenter hypervisor exported as OVA file to run on Red Hat Enterprise Linux 7 KVM, Red Hat Enterprise Linux 8 KVM, and Red Hat Enterprise Linux 9 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, RHEL 8, and RHEL 9.
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.
Prerequisites
-
virt-v2v must be run on a Red Hat Enterprise Linux 64-bit host system.
-
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 | 100 MB |
/boot | 50 MB |
Every other mountable file system | 10 MB |
- The source VM must have 100 or more free index nodes (inodes). If the VM does not have a sufficient number of free inodes, for example if it uses an XFS file system and contains very many files, the conversion will be very slow or it will fail.
Procedure
Step 1
Install the virt-v2v and virtio-win packages and their dependencies on the host system:
# yum install virt-v2v virtio-win
Step 2
Export the VMware virtual machine as an .ova file: either "Folder of files" (.ovf) or "Single file" (.ova) will work. .ova files are in fact uncompressed .tar files, so you can use commands, such as tar tf VM.ova, to view their content. The method by which a VMware virtual machine has to be exported varies based on your VMware product. For detailed instructions, see the VMware documentation or contact your vendor. Before exporting the .ova file, ensure that the Virtual Machine is shutdown gracefully. For Windows, ensure the OS is really shutdown and not into hibernation or fast startup modes, otherwise the conversion will fail with this problem.
Step 3
Use the scp command to transfer the created .ova file to the conversion host.
Step 4
To convert a virtual machine from an .ova file, use the following command, replacing guestvm1.ova with the name of the .ova file to convert:
# virt-v2v -i ova guestvm1.ova -of qcow2
OR
# virt-v2v -i ova “Folder of files(OVF)” -of qcow2
For a full list of virt-v2v parameters, see the virt-v2v man page.
Step 5
Observe the conversion progress. A successful conversion output looks similar to the following:
# virt-v2v -i ova guestvm1.ova -of qcow2
[ 0.0] Opening the source -i ova guestvm1.ova
[ 0.0] Creating an overlay to protect the source from being modified
[ 1.0] Opening the overlay
[ 4.0] Initializing the target -o libvirt
[ 4.0] Inspecting the overlay
[ 10.0] Checking for sufficient free disk space in the guest
[ 10.0] Estimating space required on target for each disk
[ 10.0] Converting Red Hat Enterprise Linux release 8 to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 14.0] Mapping filesystem data to avoid copying unused and blank areas
[ 14.0] Closing the overlay
[ 14.0] Copying disk 1/1 to /guests/guestvm1-sda (qcow2)
(100.00/100%)
[ 28.0] Creating output metadata
Pool default refreshed
Domain guestvm1 defined from /tmp/v2vlibvirt4fe796.xml
[ 28.0] Finishing off
Step 6
Confirm that the VM was imported correctly:
# virsh list --all
If this command lists the new Linux virtual machine, you have successfully converted and imported the VM. Afterwards, boot the VM and confirm the full functionality of the VM before deleting the original VM or migrating active services.
Further resources
For more information on managing virtual machines with libvirt in RHEL 7, see the Red Hat Enterprise Linux 7 Virtualization Deployment and Administration Guide.
For more information on managing virtual machines with libvirt in RHEL 8, see RHEL 8 Configuring and Managing Virtualization.
For more information on managing virtual machines with libvirt in RHEL 9, see RHEL 9 Configuring and Managing Virtualization.
For more information on using virt-v2v to convert virtual machines, 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 guests to import to Red Hat OpenStack Platform
- 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.
Comments