virt-v2v(1) | Virtualization Support | virt-v2v(1) |
virt-v2v - Convert a guest to use KVM
virt-v2v [-i mode] [other -i* options] [-o mode] [other -o* options] [guest|filename]
Virt-v2v converts a single guest from a foreign hypervisor to run on KVM. It can read Linux and Windows guests running on VMware, Xen, Hyper-V and some other hypervisors, and convert them to KVM managed by libvirt, OpenStack, oVirt, Red Hat Virtualisation (RHV) or several other targets. It can modify the guest to make it bootable on KVM and install virtio drivers so it will run quickly.
There is also a companion front-end called virt-p2v(1) which comes as an ISO, CD or PXE image that can be booted on physical machines to virtualize those machines (physical to virtual, or p2v).
To estimate the disk space needed before conversion, see virt-v2v-inspector(1).
For in-place conversion, there is a separate tool called virt-v2v-in-place(1).
You normally run virt-v2v with several -i* options controlling the input mode and also several -o* options controlling the output mode. In this sense, "input" refers to the source foreign hypervisor such as VMware, and "output" refers to the target KVM-based management system such as oVirt or OpenStack.
The input and output sides of virt-v2v are separate and unrelated. Virt-v2v can read from any input and write to any output. Therefore these sides of virt-v2v are documented separately in this manual.
Virt-v2v normally copies from the input to the output, called "copying mode". In this case the source guest is always left unchanged. In-place conversions may be done using virt-v2v-in-place(1).
virt-v2v-support(1) — Supported hypervisors, virtualization management systems, guests.
virt-v2v-input-vmware(1) — Input from VMware.
virt-v2v-input-xen(1) — Input from Xen.
virt-v2v-output-local(1) — Output to local files or local libvirt.
virt-v2v-output-rhv(1) — Output to oVirt or RHV.
virt-v2v-output-openstack(1) — Output to OpenStack.
virt-v2v-release-notes-1.42(1) — Release notes for 1.42 release.
virt-v2v-release-notes-2.0(1) — Release notes for 2.0 release.
virt-v2v-release-notes-2.2(1) — Release notes for 2.2 release.
You have a VMware vCenter server called "vcenter.example.com", a datacenter called "Datacenter", and an ESXi hypervisor called "esxi". You want to convert a guest called "vmware_guest" to run locally under libvirt.
virt-v2v -ic vpx://vcenter.example.com/Datacenter/esxi vmware_guest
In this case you will most likely have to run virt-v2v as "root", since it needs to talk to the system libvirt daemon and copy the guest disks to /var/lib/libvirt/images.
For more information see virt-v2v-input-vmware(1).
This is the same as the previous example, except you want to send the guest to a RHV Data Domain using the RHV REST API. Guest network interface(s) are connected to the target network called "ovirtmgmt".
virt-v2v -ic vpx://vcenter.example.com/Datacenter/esxi vmware_guest \ -o rhv-upload -oc https://ovirt-engine.example.com/ovirt-engine/api \ -os ovirt-data -op /tmp/ovirt-admin-password -of raw \ -oo rhv-cafile=/tmp/ca.pem --bridge ovirtmgmt
In this case the host running virt-v2v acts as a conversion server.
For more information see virt-v2v-output-rhv(1).
You have an ESXi hypervisor called "esxi.example.com" with SSH access enabled. You want to convert from VMFS storage on that server to a local file.
virt-v2v \ -i vmx -it ssh \ "ssh://root@esxi.example.com/vmfs/volumes/datastore1/guest/guest.vmx" \ -o local -os /var/tmp
The guest must not be running. Virt-v2v would not need to be run as root in this case.
For more information about converting from VMX files see virt-v2v-input-vmware(1).
Given a disk image from another hypervisor that you want to convert to run on OpenStack (only KVM-based OpenStack is supported), you can run virt-v2v inside an OpenStack VM (called "v2v-vm" below), and do:
virt-v2v -i disk disk.img -o openstack -oo server-id=v2v-vm
Given a disk image from another hypervisor that you want to convert to run on KVM, you have two options. The simplest way is to try:
virt-v2v -i disk disk.img -o local -os /var/tmp
where virt-v2v guesses everything about the input disk.img and (in this case) writes the converted result to /var/tmp.
A more complex method is to write some libvirt XML describing the input guest (if you can get the source hypervisor to provide you with libvirt XML, then so much the better). You can then do:
virt-v2v -i libvirtxml guest-domain.xml -o local -os /var/tmp
Since guest-domain.xml contains the path(s) to the guest disk image(s) you do not need to specify the name of the disk image on the command line.
To convert a local disk image and immediately boot it in local qemu, do:
virt-v2v -i disk disk.img -o qemu -os /var/tmp -oo qemu-boot
In the second variant the bandwidth is limited dynamically from the content of the file (also in bits per second, in the same formats supported by the first variant). You may use both parameters together, meaning: first limit to a static rate, then you can create the file while virt-v2v is running to adjust the rate dynamically.
This is only supported for:
The options are silently ignored for other input methods.
Note this options only applies to keys and passphrases for encrypted devices and partitions, not for passwords used to connect to remote servers.
In this mode you can read a virtual machine disk image with no metadata. virt-v2v tries to guess the best default metadata. This is usually adequate but you can get finer control (eg. of memory and vCPUs) by using -i libvirtxml instead. Only guests that use a single disk can be imported this way.
In this mode you have to specify a libvirt guest name or UUID on the command line. You may also specify a libvirt connection URI (see -ic).
In this mode you have to pass a libvirt XML file on the command line. This file is read in order to get metadata about the source guest (such as its name, amount of memory), and also to locate the input disks. See "Minimal XML for -i libvirtxml option" below.
In this mode you can read a VMware ova file. Virt-v2v will read the ova manifest file and check the vmdk volumes for validity (checksums) as well as analyzing the ovf file, and then convert the guest. See virt-v2v-input-vmware(1).
In this mode you can read a VMware vmx file directly or over SSH. This is useful when VMware VMs are stored on an NFS server which you can mount directly, or where you have access by SSH to an ESXi hypervisor. See virt-v2v-input-vmware(1).
Only local libvirt connections, VMware vCenter connections, or RHEL 5 Xen remote connections can be used. Other remote libvirt connections will not work in general.
See also virt-v2v-input-vmware(1), virt-v2v-input-xen(1).
virt-v2v -it vddk -io "?"
In most cases this parameter is required when using the -it vddk (VDDK) transport. See virt-v2v-input-vmware(1) for details.
This parameter is required when using the -it vddk (VDDK) transport. See virt-v2v-input-vmware(1) for details.
Note that if any such option is present on the command line, QEMU user networking will be automatically enabled for the libguestfs appliance.
If there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line.
Note --keys-from-stdin only applies to keys and passphrases for encrypted devices and partitions, not for passwords used to connect to remote servers.
See "Networks and bridges" below.
The fields in the parameter are: "ipaddr" is the IP address. "gw" is the optional gateway IP address. "len" is the subnet mask length (an integer). The final parameters are zero or more nameserver IP addresses.
This option can be supplied zero or more times.
You only need to use this option for certain broken guests such as Windows which are unable to preserve MAC to static IP address mappings automatically. You don't need to use it if Windows is using DHCP. It is currently ignored for Linux guests since they do not have this problem.
See "Networks and bridges" below.
Set the output method to OpenStack Glance. In this mode the converted guest is uploaded to Glance. See virt-v2v-output-openstack(1).
In this mode, the converted guest is written to a local directory specified by -os /dir (the directory must exist). The converted guest’s disks are written to:
/dir/name-sda /dir/name-sdb [etc]
and guest metadata is created in the associated YAML file:
/dir/name.yaml
where "name" is the guest name.
In this mode, the converted guest is created as a libvirt guest. You may also specify a libvirt connection URI (see -oc).
In this mode, the converted guest is written to a local directory specified by -os /dir (the directory must exist). The converted guest’s disks are written as:
/dir/name-sda /dir/name-sdb [etc]
and a libvirt XML file is created containing guest metadata:
/dir/name.xml
where "name" is the guest name.
The guest is converted and copied but the results are thrown away and no metadata is written.
This is similar to -o local, except that a shell script is written which you can use to boot the guest in qemu. The converted disks and shell script are written to the directory specified by -os.
When using this output mode, you can also specify the -oo qemu-boot option which boots the guest under qemu immediately.
The converted guest is written to a RHV Export Storage Domain. The -os parameter must also be used to specify the location of the Export Storage Domain. Note this does not actually import the guest into RHV. You have to do that manually later using the UI.
The converted guest is written directly to a RHV Data Domain. This is a faster method than -o rhv, but requires oVirt or RHV ≥ 4.2.
This mode is similar to -o rhv, but the full path to the data domain must be given: /rhv/data-center/<data-center-uuid>/<data-domain-uuid>. This mode is only used when virt-v2v runs under VDSM control.
For -o libvirt this is the libvirt URI. Only local libvirt connections can be used. Remote libvirt connections will not work. See virt-v2v-output-local(1) for further information.
If not specified, then the input format is used.
virt-v2v -o rhv-upload -oo "?"
If -oo vdsm-compat=1.1 is used then modern qcow2 (compat=1.1) files are generated instead.
Currently -oo vdsm-compat=0.10 is the default, but this will change to -oo vdsm-compat=1.1 in a future version of virt-v2v (when we can assume that everyone is using a modern version of qemu).
Note this option only affects -o vdsm output. All other output modes (including -o rhv) generate modern qcow2 compat=1.1 files, always.
If this option is available, then "vdsm-compat-option" will appear in the --machine-readable output.
The format of UUIDs is: "12345678-1234-1234-1234-123456789abc" (each hex digit can be "0-9" or "a-f"), conforming to OSF DCE 1.1.
These options can only be used with -o vdsm.
For backward compatibility the default is rhvexp, but this may change in the future.
For -o libvirt, this is a libvirt directory pool (see "virsh pool-list") or pool UUID.
For -o local and -o qemu, this is a directory name. The directory must exist.
For -o rhv-upload, this is the name of the destination Storage Domain.
For -o openstack, this is the optional Cinder volume type.
For -o rhv, this can be an NFS path of the Export Storage Domain of the form "<host>:<path>", eg:
rhv-storage.example.com:/rhv/export
The NFS export must be mountable and writable by the user and host running virt-v2v, since the virt-v2v program has to actually mount it when it runs. So you probably have to run virt-v2v as "root".
Or: You can mount the Export Storage Domain yourself, and point -os to the mountpoint. Note that virt-v2v will still need to write to this remote directory, so virt-v2v will still need to run as "root".
You will get an error if virt-v2v is unable to mount/write to the Export Storage Domain.
In the case where the virtual machine is dual-boot or multi-boot, or where the VM has other filesystems that look like operating systems, this option can be used to select the root filesystem (a.k.a. "C:" drive or /) of the operating system that is to be converted. The Windows Recovery Console, certain attached DVD drives, and bugs in libguestfs inspection heuristics, can make a guest look like a multi-boot operating system.
The default in virt-v2v ≤ 0.7.1 was --root single, which causes virt-v2v to die if a multi-boot operating system is found.
Since virt-v2v ≥ 0.7.2 the default is now --root ask: If the VM is found to be multi-boot, then virt-v2v will stop and list the possible root filesystems and ask the user which to use. This requires that virt-v2v is run interactively.
--root first means to choose the first root device in the case of a multi-boot operating system. Since this is a heuristic, it may sometimes choose the wrong one.
You can also name a specific root device, eg. --root /dev/sda2 would mean to use the second partition on the first hard drive. If the named root device does not exist or was not detected as a root device, then virt-v2v will fail.
Note that there is a bug in grub which prevents it from successfully booting a multiboot system if virtio is enabled. Grub is only able to boot an operating system from the first virtio disk. Specifically, /boot must be on the first virtio disk, and it cannot chainload an OS which is not in the first virtio disk.
Older versions of virt-v2v could turn a Xen paravirtualized (PV) guest into a KVM guest by installing a new kernel. This version of virt-v2v does not attempt to install any new kernels. Instead it will give you an error if there are only Xen PV kernels available.
Therefore before conversion you should check that a regular kernel is installed. For some older Linux distributions, this means installing a kernel from the table below:
RHEL 3 (Does not apply, as there was no Xen PV kernel) RHEL 4 i686 with > 10GB of RAM: install 'kernel-hugemem' i686 SMP: install 'kernel-smp' other i686: install 'kernel' x86-64 SMP with > 8 CPUs: install 'kernel-largesmp' x86-64 SMP: install 'kernel-smp' other x86-64: install 'kernel' RHEL 5 i686: install 'kernel-PAE' x86-64: install 'kernel' SLES 10 i586 with > 10GB of RAM: install 'kernel-bigsmp' i586 SMP: install 'kernel-smp' other i586: install 'kernel-default' x86-64 SMP: install 'kernel-smp' other x86-64: install 'kernel-default' SLES 11+ i586: install 'kernel-pae' x86-64: install 'kernel-default' Windows (Does not apply, as there is no Xen PV Windows kernel)
"Virtio" is the name for a set of drivers which make disk (block device), network and other guest operations work much faster on KVM.
Older versions of virt-v2v could install these drivers for certain Linux guests. This version of virt-v2v does not attempt to install new Linux kernels or drivers, but will warn you if they are not installed already.
In order to enable virtio, and hence improve performance of the guest after conversion, you should ensure that the minimum versions of packages are installed before conversion, by consulting the table below.
RHEL 3 No virtio drivers are available RHEL 4 kernel >= 2.5.9-89.EL lvm2 >= 2.02.42-5.el4 device-mapper >= 1.02.28-2.el4 selinux-policy-targeted >= 1.17.30-2.152.el4 policycoreutils >= 1.18.1-4.13 RHEL 5 kernel >= 2.6.18-128.el5 lvm2 >= 2.02.40-6.el5 selinux-policy-targeted >= 2.4.6-203.el5 RHEL 6+ All versions support virtio Fedora All versions support virtio SLES 11+ All versions support virtio SLES 10 kernel >= 2.6.16.60-0.85.1 OpenSUSE 11+ All versions support virtio OpenSUSE 10 kernel >= 2.6.25.5-1.1 Debian 6+ All versions support virtio Ubuntu 10.04+ All versions support virtio Windows Drivers are installed from the ISO or directory pointed to by the "VIRTIO_WIN" environment variable if present. If the "VIRTIO_WIN" environment variable is absent (which is the recommended setting), then libosinfo is consulted first, for driver files that are locally available on the conversion host.
In RHEL ≤ 4.7 there was a bug which causes SELinux relabelling to appear to hang forever at:
*** Warning -- SELinux relabel is required. *** *** Disabling security enforcement. *** *** Relabeling could take a very long time, *** *** depending on file system size. ***
In reality it is waiting for you to press a key (but there is no visual indication of this). You can either hit the "[Return]" key, at which point the guest will finish relabelling and reboot, or you can install policycoreutils ≥ 1.18.1-4.13 before starting the v2v conversion. See also https://bugzilla.redhat.com/show_bug.cgi?id=244636
"warning: could not determine a way to update the configuration of Grub2"
Currently, virt-v2v has no way to set the default kernel in Debian and Ubuntu guests using GRUB 2 as bootloader. This means that virt-v2v will not change the default kernel used for booting, even in case it is not the best kernel available on the guest. A recommended procedure is, before using virt-v2v, to check that the boot kernel is the best kernel available in the guest (for example by making sure the guest is up-to-date).
"vsyscall attempted with vsyscall=none"
When run on a recent Debian host virt-v2v may fail to convert guests which were created before 2013. In the debugging output you will see a crash message similar to:
vsyscall attempted with vsyscall=none ip:... segfault at ...
This is caused because Debian removed support for running old binaries which used the legacy vsyscall page to call into the kernel.
You can work around this problem by running this command before running virt-v2v:
export LIBGUESTFS_APPEND="vsyscall=emulate"
For more information, see https://bugzilla.redhat.com/1592061
System disk on a Dynamic Disk is not supported
If the Windows system disk (the drive containing "\windows") is located on a Dynamic Disk then it cannot be converted. Data disks — that is, disks which are part of the guest but do not contain parts of the Windows operating system — may be Dynamic Disks.
See https://bugzilla.redhat.com/2140548.
Windows ≥ 8 Fast Startup is incompatible with virt-v2v
Guests which use the Windows ≥ 8 "Fast Startup" feature (or guests which are hibernated) cannot be converted with virt-v2v. You will see an error:
virt-v2v: error: unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v.
As the message says, you need to boot the guest and disable the "Fast Startup" feature (Control Panel → Power Options → Choose what the power buttons do → Change settings that are currently unavailable → Turn on fast startup), and shut down the guest, and then you will be able to convert it.
For more information, see: "WINDOWS HIBERNATION AND WINDOWS 8 FAST STARTUP" in guestfs(3).
Boot failure: 0x0000007B
This boot failure is caused by Windows being unable to find or load the right disk driver (eg. viostor.sys). If you experience this error, here are some things to check:
On Red Hat Enterprise Linux 7, you will need to install the signed drivers available in the "virtio-win" package. If you do not have access to the signed drivers, then you will probably need to disable driver signing in the boot menus.
... -drive file=windows-sda,if=virtio ...
In libvirt XML, you should see:
<target dev='vda' bus='virtio'/>
OpenStack and Windows reactivation
OpenStack does not offer stable device / PCI addresses to guests. Every time it creates or starts a guest, it regenerates the libvirt XML for that guest from scratch. The libvirt XML will have no <address> fields. Libvirt will then assign addresses to devices, in a predictable manner. Addresses may change if any of the following are true:
Because Windows does not like "hardware" changes of this kind, it may trigger Windows reactivation.
This can also prevent booting with a 7B error [see previous section] if the guest has group policy containing "Device Installation Restrictions".
Support for SHA-2 certificates in Windows 7 and Windows Server 2008 R2
Later versions of the Windows virtio drivers are signed using SHA-2 certificates (instead of SHA-1). The original shipping Windows 7 and Windows Server 2008 R2 did not understand SHA-2 certificates and so the Windows virtio drivers will not install properly.
To fix this you must apply SHA-2 Code Signing Support from: https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2015/3033929 before converting the guest.
For further information see: https://bugzilla.redhat.com/show_bug.cgi?id=1624878
Guests are usually connected to one or more networks, and when converted to the target hypervisor you usually want to reconnect those networks at the destination. The options --network, --bridge and --mac allow you to do that.
If you are unsure of what networks and bridges are in use on the source hypervisor, then you can examine the source metadata (libvirt XML, vCenter information, etc.). Or you can run virt-v2v with the --print-source option which causes virt-v2v to print out the information it has about the guest on the source and then exit.
In the --print-source output you will see a section showing the guest’s Network Interface Cards (NICs):
$ virt-v2v [-i ...] --print-source name [...] NICs: Network "default" mac: 52:54:00:d0:cf:0e
Bridges are special classes of network devices which are attached to a named external network on the source hypervisor, for example:
$ virt-v2v [-i ...] --print-source name [...] NICs: Bridge "br0"
To map a specific source bridge to a target network, for example "br0" on the source to "ovirtmgmt" on the target, use:
virt-v2v [...] --bridge br0:ovirtmgmt
To map every bridge to a target network, use:
virt-v2v [...] --bridge ovirtmgmt
Fine-grained mapping of guest NICs
The --mac option gives you more control over the mapping, letting you map single NICs to either networks or bridges on the target. For example a source guest with two NICs could map them individually to two networks called "mgmt" and "clientdata" like this:
$ virt-v2v [...] \ --mac 52:54:00:d0:cf:0e:network:mgmt \ --mac 52:54:00:d0:cf:0f:network:clientdata
Note that virt-v2v does not have the ability to change a guest’s MAC address. The MAC address is part of the guest metadata and must remain the same on source and target hypervisors. Most guests will use the MAC address to set up persistent associations between NICs and internal names (like "eth0"), with firewall settings, or even for other purposes like software licensing.
Network
The most important resource for virt-v2v appears to be network bandwidth. Virt-v2v should be able to copy guest data at gigabit ethernet speeds or greater.
Ensure that the network connections between servers (conversion server, NFS server, vCenter, Xen) are as fast and as low latency as possible.
Disk space
Virt-v2v places potentially large temporary files in $VIRT_V2V_TMPDIR (usually /var/tmp, see also "ENVIRONMENT VARIBLES" below). Using tmpfs is a bad idea.
For each guest disk, an overlay is stored temporarily. This stores the changes made during conversion, and is used as a cache. The overlays are not particularly large - tens or low hundreds of megabytes per disk is typical. In addition to the overlay(s), input and output methods may use disk space, as outlined in the table below.
See also "Minimum free space check in the host" below.
VMware vCenter resources
Copying from VMware vCenter is currently quite slow, but we believe this to be an issue with VMware. Ensuring the VMware ESXi hypervisor and vCenter are running on fast hardware with plenty of memory should alleviate this.
Compute power and RAM
Virt-v2v is not especially compute or RAM intensive. If you are running many parallel conversions, then you may consider allocating one CPU core and 2 GB of RAM per running instance.
Virt-v2v can be run in a virtual machine.
Trimming
Virt-v2v attempts to optimize the speed of conversion by ignoring guest filesystem data which is not used. This would include unused filesystem blocks, blocks containing zeroes, and deleted files.
To do this, virt-v2v issues a non-destructive fstrim(8) operation. As this happens to an overlay placed over the guest data, it does not affect the source in any way.
If this fstrim operation fails, you will see a warning, but virt-v2v will continue anyway. It may run more slowly (in some cases much more slowly), because it is copying the unused parts of the disk.
Unfortunately support for fstrim is not universal, and it also depends on specific details of the filesystem, partition alignment, and backing storage. As an example, NTFS filesystems cannot be fstrimmed if they occupy a partition which is not aligned to the underlying storage. That was the default on Windows before Vista. As another example, VFAT filesystems (used by UEFI guests) cannot be trimmed at all.
fstrim support in the Linux kernel is improving gradually, so over time some of these restrictions will be lifted and virt-v2v will work faster.
Guest network configuration
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 virt-customize(1).
Converting a Windows guest
When converting a Windows guests, the conversion process is split into two stages:
The guest will be bootable after the offline conversion stage, but will not yet have all necessary drivers installed to work correctly. These will be installed automatically the first time the guest boots.
N.B. Take care not to interrupt the automatic driver installation process when logging in to the guest for the first time, as this may prevent the guest from subsequently booting correctly.
Free space in the guest
Virt-v2v checks there is sufficient free space in the guest filesystem to perform the conversion. Currently it checks:
This is because we need to build a new initramfs for some Enterprise Linux conversions.
We may have to copy in many virtio drivers and guest agents.
In addition to the actual free space, each filesystem is required to have at least 100 available inodes.
Minimum free space check in the host
You must have sufficient free space in the host directory used to store large temporary overlays. To find out which directory this is, use:
$ df -h "`guestfish get-cachedir`" Filesystem Size Used Avail Use% Mounted on /dev/mapper/root 50G 40G 6.8G 86% /
and look under the "Avail" column. Virt-v2v will refuse to do the conversion at all unless at least 1GB is available there. You can change the directory that virt-v2v uses by setting $VIRT_V2V_TMPDIR.
See also "Resource requirements" above and "ENVIRONMENT VARIABLES" below.
Nothing in virt-v2v inherently needs root access, and it will run just fine as a non-root user. However, certain external features may require either root or a special user:
You can avoid needing root here by mounting it yourself before running virt-v2v, and passing -os /mountpoint instead, but first of all read the next section ...
When you run virt-v2v -o rhv as root, virt-v2v attempts to create files and directories with the correct ownership. If you run virt-v2v as non-root, it will probably still work, but you will need to manually change ownership after virt-v2v has finished.
You can avoid this by setting up libvirt connection authentication, see http://libvirt.org/auth.html. Alternatively, use -oc qemu:///session, which will write to your per-user libvirt instance.
Some output modes write to local files. In general these modes also let you write to block devices, but before you run virt-v2v you may have to arrange for symbolic links to the desired block devices in the output directory.
For example if using -o local -os /dir then virt-v2v would normally create files called:
/dir/name-sda # first disk /dir/name-sdb # second disk ... /dir/name.xml # metadata
If you wish the disks to be written to block devices then you would need to create /dir/name-sda (etc) as symlinks to the block devices:
# lvcreate -L 10G -n VolumeForDiskA VG # lvcreate -L 6G -n VolumeForDiskB VG # ln -sf /dev/VG/VolumeForDiskA /dir/name-sda # ln -sf /dev/VG/VolumeForDiskB /dir/name-sdb
Note that you must precreate the correct number of block devices of the correct size. Typically -of raw has to be used too, but other formats such as qcow2 can be useful occasionally so virt-v2v does not force you to use raw on block devices.
When using the -i libvirtxml option, you have to supply some libvirt XML. Writing this from scratch is hard, so the template below is helpful.
Note this should only be used for testing and/or where you know what you're doing! If you have libvirt metadata for the guest, always use that instead.
<domain type='kvm'> <name> NAME </name> <memory>1048576</memory> <vcpu>2</vcpu> <os> <type>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <devices> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/to/disk/image'/> <target dev='hda' bus='ide'/> </disk> <interface type='network'> <mac address='52:54:00:01:02:03'/> <source network='default'/> <model type='rtl8139'/> </interface> </devices> </domain>
The --machine-readable option can be used to make the output more machine friendly, which is useful when calling virt-v2v from other programs, GUIs etc.
このオプションを使用するには 2 通りの方法があります。
Firstly use the option on its own to query the capabilities of the virt-v2v binary. Typical output looks like this:
$ virt-v2v --machine-readable virt-v2v libguestfs-rewrite colours-option vdsm-compat-option input:disk [...] output:local [...] convert:linux convert:windows
A list of features is printed, one per line, and the program exits with status 0.
The "input:" and "output:" features refer to -i and -o (input and output mode) options supported by this binary. The "convert:" features refer to guest types that this binary knows how to convert.
Secondly use the option in conjunction with other options to make the regular program output more machine friendly.
At the moment this means:
^[0-9]+/[0-9]+$
Virt-v2v ≤ 0.9.1 did not support the --machine-readable option at all. The option was added when virt-v2v was rewritten in 2014.
It is possible to specify a format string for controlling the output; see "ADVANCED MACHINE READABLE OUTPUT" in guestfs(3).
If this directory is present, then virtio drivers for Windows guests will be found from this directory and installed in the guest during conversion.
To reliably ensure large temporary files are cleaned up (for example in case virt-v2v crashes) you should create a randomly named directory under /var/tmp, set "VIRT_V2V_TMPDIR" to point to this directory, then when virt-v2v exits remove the directory.
See the "Disk space" section above.
Normally you do not need to set this. If not set, a compiled-in default will be used (something like /usr/share/virt-tools).
This directory may contain the following files:
This is the RHSrvAny Windows binary, used to install a "firstboot" script in the guest during conversion of Windows guests.
See also: "https://github.com/rwmjones/rhsrvany"
This tool waits for newly installed Windows devices to become available before trying to configure them, for example to set network configuration. It is part of the RHSrvAny project.
If unset, then we look for drivers via whichever of these methods succeeds first:
See "Enabling virtio".
他の環境変数は "環境変数" in guestfs(3) を参照してください。
https://rwmj.wordpress.com/2015/09/18/importing-kvm-guests-to-ovirt-or-rhev/#content
virt-p2v(1), virt-v2v-inspector(1), virt-v2v-in-place(1), virt-customize(1), virt-df(1), virt-filesystems(1), virt-sparsify(1), virt-sysprep(1), guestfs(3), guestfish(1), qemu-img(1), engine-image-uploader(8), import-to-ovirt.pl, nbdkit(1), nbdkit-vddk-plugin(1), http://libguestfs.org/.
Matthew Booth
Cédric Bosdonnat
Laszlo Ersek
Tomáš Golembiovský
Shahar Havivi
Richard W.M. Jones
Roman Kagan
Mike Latimer
Nir Soffer
Pino Toscano
Xiaodai Wang
Ming Xie
Tingting Zheng
Copyright (C) 2009-2022 Red Hat Inc.
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
When reporting a bug, please supply:
2023-01-10 | virt-v2v-2.2.0 |