1virt-v2v-in-place(1) Virtualization Support virt-v2v-in-place(1)
2
3
4
6 virt-v2v-in-place - Convert a guest to use KVM in-place
7
9 virt-v2v-in-place -i disk [other -i* options] filename
10
11 virt-v2v-in-place -i libvirt|libvirtxml [other -i* options] guest
12
14 Virt-v2v-in-place converts a single guest from a foreign hypervisor to
15 run on KVM. It does this conversion in place, modifying the original
16 disk.
17
18 This manual page only documents the differences between this tool and
19 virt-v2v. You should read virt-v2v(1) first.
20
21 Selecting the input disk
22 You normally run virt-v2v with one or more -i* options controlling the
23 input mode. Virt-v2v-in-place can only convert guests stored in local
24 files.
25
26 This command will do an in-place conversion of filename.img:
27
28 virt-v2v-in-place -i disk filename.img
29
30 If the guest has been copied to local libvirt then:
31
32 virt-v2v-in-place -i libvirt guest
33
36 --help
37 Display help.
38
39 -b ...
40 --bridge ...
41 See --network below.
42
43 --colors
44 --colours
45 Use ANSI colour sequences to colourize messages. This is the
46 default when the output is a tty. If the output of the program is
47 redirected to a file, ANSI colour sequences are disabled unless you
48 use this option.
49
50 --echo-keys
51 When prompting for keys and passphrases, virt-v2v normally turns
52 echoing off so you cannot see what you are typing. If you are not
53 worried about Tempest attacks and there is no one else in the room
54 you can specify this flag to see what you are typing.
55
56 Note this options only applies to keys and passphrases for
57 encrypted devices and partitions, not for passwords used to connect
58 to remote servers.
59
60 -i disk
61 Set the input method to disk.
62
63 In this mode you can read a virtual machine disk image with no
64 metadata. virt-v2v tries to guess the best default metadata. This
65 is usually adequate but you can get finer control (eg. of memory
66 and vCPUs) by using -i libvirtxml instead. Only guests that use a
67 single disk can be imported this way.
68
69 -i libvirt
70 Set the input method to libvirt. This is the default.
71
72 In this mode you have to specify a libvirt guest name or UUID on
73 the command line. You may also specify a libvirt connection URI
74 (see -ic).
75
76 -i libvirtxml
77 Set the input method to libvirtxml.
78
79 In this mode you have to pass a libvirt XML file on the command
80 line. This file is read in order to get metadata about the source
81 guest (such as its name, amount of memory), and also to locate the
82 input disks. See "Minimal XML for -i libvirtxml option" below.
83
84 -i local
85 This is the same as -i disk.
86
87 -ic libvirtURI
88 Specify a libvirt connection URI to use when reading the guest.
89 This is only used when -i libvirt.
90
91 Only local libvirt connections to locally stored disks can be used.
92
93 -if format
94 For -i disk only, this specifies the format of the input disk
95 image. For other input methods you should specify the input format
96 in the metadata.
97
98 -io OPTION=VALUE
99 Set input option(s) related to the current input mode or transport.
100 To display short help on what options are available you can use:
101
102 virt-v2v-in-place -it disk -io "?"
103
104 -ip filename
105 Supply a file containing a password to be used when connecting to
106 the source. If this is omitted then the input hypervisor may ask
107 for the password interactively. Note the file should contain the
108 whole password, without any trailing newline, and for security the
109 file should have mode 0600 so that others cannot read it.
110
111 --key SELECTOR
112 Specify a key for LUKS, to automatically open a LUKS device when
113 using the inspection. "ID" can be either the libguestfs device
114 name, or the UUID of the LUKS device.
115
116 --key "ID":key:KEY_STRING
117 Use the specified "KEY_STRING" as passphrase.
118
119 --key "ID":file:FILENAME
120 Read the passphrase from FILENAME.
121
122 --key "ID":clevis
123 Attempt passphrase-less unlocking for "ID" with Clevis, over
124 the network. Please refer to "ENCRYPTED DISKS" in guestfs(3)
125 for more information on network-bound disk encryption (NBDE).
126
127 Note that if any such option is present on the command line,
128 QEMU user networking will be automatically enabled for the
129 libguestfs appliance.
130
131 --keys-from-stdin
132 Read key or passphrase parameters from stdin. The default is to
133 try to read passphrases from the user by opening /dev/tty.
134
135 If there are multiple encrypted devices then you may need to supply
136 multiple keys on stdin, one per line.
137
138 Note --keys-from-stdin only applies to keys and passphrases for
139 encrypted devices and partitions, not for passwords used to connect
140 to remote servers.
141
142 --mac aa:bb:cc:dd:ee:ff:network:out
143 --mac aa:bb:cc:dd:ee:ff:bridge:out
144 Map source NIC MAC address to a network or bridge.
145
146 See "Networks and bridges" in virt-v2v(1).
147
148 --mac aa:bb:cc:dd:ee:ff:ip:ipaddr[,gw[,len[,ns,ns,...]]]
149 Force a particular interface (controlled by its MAC address) to
150 have a static IP address after boot.
151
152 The fields in the parameter are: "ipaddr" is the IP address. "gw"
153 is the optional gateway IP address. "len" is the subnet mask
154 length (an integer). The final parameters are zero or more
155 nameserver IP addresses.
156
157 This option can be supplied zero or more times.
158
159 You only need to use this option for certain broken guests such as
160 Windows which are unable to preserve MAC to static IP address
161 mappings automatically. You don't need to use it if Windows is
162 using DHCP. It is currently ignored for Linux guests since they do
163 not have this problem.
164
165 --machine-readable
166 --machine-readable=format
167 This option is used to make the output more machine friendly when
168 being parsed by other programs. See "Machine readable output" in
169 virt-v2v(1).
170
171 -n in:out
172 -n out
173 --network in:out
174 --network out
175 -b in:out
176 -b out
177 --bridge in:out
178 --bridge out
179 Map network (or bridge) called "in" to network (or bridge) called
180 "out". If no "in:" prefix is given, all other networks (or
181 bridges) are mapped to "out".
182
183 See "Networks and bridges" in virt-v2v(1).
184
185 --print-source
186 Print information about the source guest and stop. This option is
187 useful when you are setting up network and bridge maps. See
188 "Networks and bridges" in virt-v2v(1).
189
190 -q
191 --quiet
192 This disables progress bars and other unnecessary output.
193
194 --root ask
195 --root single
196 --root first
197 --root /dev/sdX
198 --root /dev/VG/LV
199 Choose the root filesystem to be converted.
200
201 In the case where the virtual machine is dual-boot or multi-boot,
202 or where the VM has other filesystems that look like operating
203 systems, this option can be used to select the root filesystem
204 (a.k.a. "C:" drive or /) of the operating system that is to be
205 converted. The Windows Recovery Console, certain attached DVD
206 drives, and bugs in libguestfs inspection heuristics, can make a
207 guest look like a multi-boot operating system.
208
209 The default in virt-v2v ≤ 0.7.1 was --root single, which causes
210 virt-v2v to die if a multi-boot operating system is found.
211
212 Since virt-v2v ≥ 0.7.2 the default is now --root ask: If the VM is
213 found to be multi-boot, then virt-v2v will stop and list the
214 possible root filesystems and ask the user which to use. This
215 requires that virt-v2v is run interactively.
216
217 --root first means to choose the first root device in the case of a
218 multi-boot operating system. Since this is a heuristic, it may
219 sometimes choose the wrong one.
220
221 You can also name a specific root device, eg. --root /dev/sda2
222 would mean to use the second partition on the first hard drive. If
223 the named root device does not exist or was not detected as a root
224 device, then virt-v2v will fail.
225
226 Note that there is a bug in grub which prevents it from
227 successfully booting a multiboot system if virtio is enabled. Grub
228 is only able to boot an operating system from the first virtio
229 disk. Specifically, /boot must be on the first virtio disk, and it
230 cannot chainload an OS which is not in the first virtio disk.
231
232 -v
233 --verbose
234 Enable verbose messages for debugging.
235
236 -V
237 --version
238 Display version number and exit.
239
240 --wrap
241 Wrap error, warning, and informative messages. This is the default
242 when the output is a tty. If the output of the program is
243 redirected to a file, wrapping is disabled unless you use this
244 option.
245
246 -x Enable tracing of libguestfs API calls.
247
248 Minimal XML for -i libvirtxml option
249 When using the -i libvirtxml option, you have to supply some libvirt
250 XML. Writing this from scratch is hard, so the template below is
251 helpful.
252
253 Note this should only be used for testing and/or where you know what
254 you're doing! If you have libvirt metadata for the guest, always use
255 that instead.
256
257 <domain type='kvm'>
258 <name> NAME </name>
259 <memory>1048576</memory>
260 <vcpu>2</vcpu>
261 <os>
262 <type>hvm</type>
263 <boot dev='hd'/>
264 </os>
265 <features>
266 <acpi/>
267 <apic/>
268 <pae/>
269 </features>
270 <devices>
271 <disk type='file' device='disk'>
272 <driver name='qemu' type='raw'/>
273 <source file='/path/to/disk/image'/>
274 <target dev='hda' bus='ide'/>
275 </disk>
276 <interface type='network'>
277 <mac address='52:54:00:01:02:03'/>
278 <source network='default'/>
279 <model type='rtl8139'/>
280 </interface>
281 </devices>
282 </domain>
283
285 Files used are the same as for virt-v2v. See "FILES" in virt-v2v(1).
286
288 Environment variables used are the same as for virt-v2v. See
289 "ENVIRONMENT VARIABLES" in virt-v2v(1).
290
292 virt-v2v(1), virt-p2v(1), guestfs(3), guestfish(1), qemu-img(1),
293 nbdkit(1), http://libguestfs.org/.
294
296 Matthew Booth
297
298 Cédric Bosdonnat
299
300 Laszlo Ersek
301
302 Tomáš Golembiovský
303
304 Shahar Havivi
305
306 Richard W.M. Jones
307
308 Roman Kagan
309
310 Mike Latimer
311
312 Nir Soffer
313
314 Pino Toscano
315
316 Xiaodai Wang
317
318 Ming Xie
319
320 Tingting Zheng
321
323 Copyright (C) 2009-2022 Red Hat Inc.
324
326 This program is free software; you can redistribute it and/or modify it
327 under the terms of the GNU General Public License as published by the
328 Free Software Foundation; either version 2 of the License, or (at your
329 option) any later version.
330
331 This program is distributed in the hope that it will be useful, but
332 WITHOUT ANY WARRANTY; without even the implied warranty of
333 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
334 General Public License for more details.
335
336 You should have received a copy of the GNU General Public License along
337 with this program; if not, write to the Free Software Foundation, Inc.,
338 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
339
341 To get a list of bugs against libguestfs, use this link:
342 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
343
344 To report a new bug against libguestfs, use this link:
345 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
346
347 When reporting a bug, please supply:
348
349 • The version of libguestfs.
350
351 • Where you got libguestfs (eg. which Linux distro, compiled from
352 source, etc)
353
354 • Describe the bug accurately and give a way to reproduce it.
355
356 • Run libguestfs-test-tool(1) and paste the complete, unedited output
357 into the bug report.
358
359
360
361virt-v2v-2.2.0 2023-01-10 virt-v2v-in-place(1)