3.2. Preparing to convert a virtual machine
virt-v2v converts virtual machines from a foreign hypervisor to run on Red Hat Enterprise Linux, using KVM managed by libvirt. It automatically creates a libvirt domain for the converted virtual machines.
Figure 3.1. Converting a virtual machine
Before a virtual machine can be converted, ensure that the following steps are completed.
Procedure 3.1. Preparing a virtual machine for conversion
- Create a local storage domain for transferred storage.
virt-v2vcopies the guest virtual machine storage to a locally defined libvirt storage pool during import. This pool can be defined using any libvirt tool, and can be of any type. The simplest way to create a new pool is with
virt-manager. Refer to the Red Hat Enterprise Linux Virtualization Administration Guide for complete instructions on creating storage pools with either
- Create local network interfaces.The local machine must have an appropriate network to which the converted virtual machine can connect. This is likely to be a bridge interface. A bridge interface can be created using standard tools on the host. From libvirt version 0.8.3 and onward,
virt-managercan also create and manage bridges. For more information on bridged networking with libvirt, see the Red Hat Enterprise Linux Virtualization Host Configuration and Guest Installation Guide or the Red Hat Enterprise Linux Virtualization Administration Guide.
- Specify network mappings in
virt-v2v.conf. This step is optional, and is not required for most use cases.If your virtual machine has multiple network interfaces,
/etc/virt-v2v.confmust be edited to specify the network mapping for all interfaces. You can specify an alternative
virt-v2v.conffile with the
-fparameter.If your virtual machine only has a single network interface, it is simpler to use the
--bridgeparameters, rather than modifying
- Create a profile for the conversion in
virt-v2v.conf.This step is optional. Profiles specify a conversion method, storage location, output format and allocation policy. When a profile is defined, it can be called using
--profilerather than individually providing the
-oaparameters. See virt-v2v.conf(5) for details.
3.2.1. Preparing to convert a virtual machine running Linux
Before a virtual machine running Linux can be converted, ensure that the following steps are completed.
Procedure 3.2. Preparing to convert a virtual machine running Linux
- Obtain the software.As part of the conversion process,
virt-v2vmay install a new kernel and drivers on the virtual machine. If the virtual machine being converted is registered to Red Hat Subscription Management (RHSM), the required packages will be automatically downloaded. For environments where Red Hat Subscription Management (RHSM) is not available, the
virt-v2v.conffile references a list of RPMs used for this purpose. The RPMs relevant to your virtual machine must be downloaded manually from the Red Hat Customer Portal and made available in the directory specified by the
path-rootconfiguration element, which by default is
virt-v2vwill display an error similar to Example 3.1, “Missing Package error” if the software it depends upon for a particular conversion is not available.
Example 3.1. Missing Package error
virt-v2v: Installation failed because the following files referenced in the configuration file are required, but missing: rhel/6/kernel-2.6.32-128.el6.x86_64.rpm rhel/6/ecryptfs-utils-82-6.el6.x86_64.rpm rhel/6/ecryptfs-utils-82-6.el6.i686.rpm
- To obtain the relevant RPMs for your environment, repeat these steps for each missing package:
- Log in to the Red Hat Customer Portal: https://access.redhat.com/.
- In the Red Hat Customer Portal, select Downloads > Product Downloads > Red Hat Enterprise Linux.
- Select the desired Product Variant, Version, and select the Packages tab. In the Filter field, type the package name exactly matching the one shown in the error message. For the example shown in Example 3.1, “Missing Package error”, the first package is kernel-2.6.32-128.el6.x86_64
- A list of packages displays. Select the package name identical to the one in the error message. This opens the details page, which contains a detailed description of the package. Alternatively, to download the most recent version of a package, select Download Latest next to the desired package.
- Save the downloaded package to the appropriate directory in
/var/lib/virt-v2v/software. For Red Hat Enterprise Linux 6, the directory is