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-v2v
copies 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 withvirt-manager
. Refer to the Red Hat Enterprise Linux Virtualization Administration Guide for complete instructions on creating storage pools with eithervirt-manager
orvirsh
. - 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-manager
can 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.conf
must be edited to specify the network mapping for all interfaces. You can specify an alternativevirt-v2v.conf
file with the-f
parameter.If your virtual machine only has a single network interface, it is simpler to use the--network
or--bridge
parameters, rather than modifyingvirt-v2v.conf
. - 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--profile
rather than individually providing the-o
,-os
,-of
and-oa
parameters. 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-v2v
may 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, thevirt-v2v.conf
file 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 thepath-root
configuration element, which by default is/var/lib/virt-v2v/software/
.virt-v2v
will 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/var/lib/virt-v2v/software/rhel/6
.