Exporting a guest virtual machine from VMware as an OVA file and importing it into KVM

Updated -

The virt-v2v tool converts virtual machines from foreign hypervisors, including their disk images and metadata, for use with Red Hat Enterprise Linux KVM and Red Hat Virtualization.
This article provides instructions for converting a virtual machine from a VMware vCenter hypervisor exported as OVA file 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 virtual machine conversions, see Converting Virtual Machines from Other Hypervisors to KVM with virt-v2v in RHEL 7 and RHEL 8.

Prerequisites

Resource requirements

To convert a guest virtual machine with virt-v2v, your system must have at minimum:

  • Sufficient disk space to store the guest as a file, plus the space needed for the OVA file itself, plus 1 GB
  • Sufficient free space in the guest file system according to the following table:
File system Minimum free space
Root file system 20 MB
/boot 50 MB
Every other mountable file system 10 MB

Preparation

virt-v2v must be run on a Red Hat Enterprise Linux 64-bit host system. In addition to the standard virt-v2v package, it is recommended that you install the virtio-win package for Windows virtual machines. This package provides the VirtIO drivers in the virtual machine, which enable faster guest performance.

To set up virt-v2v on a Red Hat Enterprise Linux 7 or Red Hat Enterprise Linux 8 host system, install the virt-v2v and virtio-win packages and their dependencies:

# yum install virt-v2v virtio-win

Exporting the VMware guest

  1. Export the VMware guest to an .ova file. The method by which a VMware guest has to be exported varies based on your VMware product. For detailed instructions, see the VMware documentation or contact your vendor.

  2. Transfer the created .ova file to the conversion host.

Converting and importing the guest

To convert a virtual machine from an .ova file, use the following command, and replace guestvm1.ova with the name of the OVA file to convert:

# virt-v2v -i ova guestvm1.ova -of qcow2

For a full list of virt-v2v parameters, see the virt-v2v man page.

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

⁠Completion

On successful completion, virt-v2v creates a new libvirt domain XML file for the converted virtual machine with the same name as the original virtual machine. The virtual machine can be started using libvirt tools, such as virt-manager or virsh.

Confirm that the guest was imported correctly using the following command:

# virsh list --all

If this command lists the new Linux virtual machine, you have successfully converted and imported the guest. Boot the guest and confirm its full functionality before deleting the original guest or migrating active services.

Notes:

  • virt-v2v saves converted virtual machines to the current user's namespace. However, libvirt maintains separate namespaces for the virtual machines for each user. As a result, if virt-v2v is run as a non-root user, virt-manager will not see the converted virtual machine.
  • virt-v2v cannot currently reconfigure a guest's network configuration. If the converted guest is not connected to the same subnet as the source, its network configuration may have to be updated. See also the virt-customize(1) man page.

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 Configuring and Managing Virtualization.

For more information on using virt-v2v to convert virtual machines, see the virt-v2v man page and http://libguestfs.org/virt-v2v.1.html.

3 Comments

I have put the libguestfs-winsupport files here:

http://people.redhat.com/~rjones/libguestfs-winsupport/

Created a VM using vApp and installed RHEL7.4 on vCloud + vCentre. Took snapshot of the file as OVA using VMWare ovftool tool. Then created a VM on KVM environment. Executed the 'virt-v2v' to convert OVA to QCOW2 to run on OpenStack which is configured to run on KVM environment. I am getting errors as

virt-v2v: warning: could not parse ovf:Name from OVF document virt-v2v: error: source has no hard disks!

If reporting bugs, run virt-v2v with debugging enabled and include the complete output:

virt-v2v -v -x [...]

Can you please help me.

Hello Subramaniyan Rajasekaran,

sorry for the very late reply.

virt-v2v: error: source has no hard disks!

This is the real error, and it means virt-v2v found no disks in the OVA, or that it was not able to parse all the disks. In case you are still using virt-v2v, do you still get the errors with newer versions of RHEL/virt-v2v?