virt-v2v-in-place(1) | Virtualization Support | virt-v2v-in-place(1) |
virt-v2v-in-place - Convert a guest to use KVM in-place
virt-v2v-in-place -i disk [other -i* options] filename virt-v2v-in-place -i libvirt|libvirtxml [other -i* options] guest
Virt-v2v-in-place converts a single guest from a foreign hypervisor to run on KVM. It does this conversion in place, modifying the original disk.
This manual page only documents the differences between this tool and virt-v2v. You should read virt-v2v(1) first.
You normally run virt-v2v with one or more -i* options controlling the input mode. Virt-v2v-in-place can only convert guests stored in local files.
This command will do an in-place conversion of filename.img:
virt-v2v-in-place -i disk filename.img
If the guest has been copied to local libvirt then:
virt-v2v-in-place -i libvirt guest
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.
Only local libvirt connections to locally stored disks can be used.
virt-v2v-in-place -it disk -io "?"
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" in virt-v2v(1).
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" in virt-v2v(1).
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.
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>
Files used are the same as for virt-v2v. See "FILES" in virt-v2v(1).
Environment variables used are the same as for virt-v2v. See "ENVIRONMENT VARIABLES" in virt-v2v(1).
virt-v2v(1), virt-p2v(1), guestfs(3), guestfish(1), qemu-img(1), nbdkit(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.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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-13 | virt-v2v-2.2.0 |