1virt-v2v-input-vmware(1)    Virtualization Support    virt-v2v-input-vmware(1)
2
3
4

NAME

6       virt-v2v-input-vmware - Using virt-v2v to convert guests from VMware
7

SYNOPSIS

9        virt-v2v -i vmx GUEST.vmx [-o* options]
10
11        virt-v2v -i vmx
12           -it ssh
13           -ip passwordfile
14           'ssh://root@esxi.example.com/vmfs/volumes/datastore1/guest/guest.vmx'
15           [-o* options]
16
17        virt-v2v
18           -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1'
19           -it vddk
20           -io vddk-libdir=/path/to/vmware-vix-disklib-distrib
21           -io vddk-thumbprint=xx:xx:xx:...
22           "GUEST NAME"
23           [-o* options]
24
25        virt-v2v -i ova DISK.ova [-o* options]
26
27        virt-v2v
28           -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1'
29           "GUEST NAME" [-o* options]
30

DESCRIPTION

32       This page documents how to use virt-v2v(1) to convert guests from
33       VMware.  There are currently five different methods to access VMware:
34
35       -i vmx GUEST.vmx
36           Full documentation: "INPUT FROM VMWARE VMX"
37
38           If you either have a GUEST.vmx file and one or more GUEST.vmdk disk
39           image files, or if you are able to NFS-mount the VMware storage,
40           then you can use the -i vmx method to read the source guest.
41
42       -i vmx -it ssh ssh://...
43           Full documentation: "INPUT FROM VMWARE VMX"
44
45           This is similar to the method above, except it uses an SSH
46           connection to ESXi to read the GUEST.vmx file and associated disks.
47           This requires that you have enabled SSH access to the VMware ESXi
48           hypervisor - in the default ESXi configuration this is turned off.
49
50       -ic vpx://... -it vddk
51       -ic esx://... -it vddk
52           Full documentation: "INPUT FROM VDDK"
53
54           This method uses the proprietary VDDK library (a.k.a. VixDiskLib)
55           to access the VMware vCenter server or VMware ESXi hypervisor.
56
57           If you have the proprietary library then this method is usually the
58           fastest and most flexible.  If you don't have or don't want to use
59           non-free software then the VMX or SSH methods above will be best.
60
61       -i ova DISK.ova
62           Full documentation: "INPUT FROM VMWARE OVA"
63
64           With this method you must first export the guest (eg. from vSphere)
65           as an .ova file, which virt-v2v can then read directly.  Note this
66           method only works with files exported from VMware, not OVA files
67           that come from other hypervisors or management systems, since OVA
68           is only a pretend standard and is not compatible or interoperable
69           between vendors.
70
71       -ic vpx://... "GUEST NAME"
72           Full documentation: "INPUT FROM VMWARE VCENTER SERVER"
73
74           If none of the above methods is available, then use this method to
75           import a guest from VMware vCenter.  This is the slowest method.
76

INPUT FROM VMWARE VMX

78       Virt-v2v is able to import guests from VMware’s vmx files.
79
80       This is useful in two cases:
81
82       1.  VMware virtual machines are stored on a separate NFS server and you
83           are able to mount the NFS storage directly.
84
85       2.  You have enabled SSH access to the VMware ESXi hypervisor and there
86           is a "/vmfs/volumes" folder containing the virtual machines.
87
88       If you find a folder of files called guest.vmx, guest.vmxf, guest.nvram
89       and one or more .vmdk disk images, then you can use this method.
90
91   VMX: Guest must be shut down
92       The guest must be shut down before conversion starts.  If you don't
93       shut it down, you will end up with a corrupted VM disk on the target.
94       With other methods, virt-v2v tries to prevent concurrent access, but
95       because the -i vmx method works directly against the storage, checking
96       for concurrent access is not possible.
97
98   VMX: Access to the storage containing the VMX and VMDK files
99       If the vmx and vmdk files aren't available locally then you must either
100       mount the NFS storage on the conversion server or enable passwordless
101       SSH on the ESXi hypervisor.
102
103       VMX: SSH authentication
104
105       You can use SSH password authentication, by supplying the name of a
106       file containing the password to the -ip option (note this option does
107       not take the password directly).
108
109       If you are not using password authentication, an alternative is to use
110       ssh-agent, and add your ssh public key to
111       /etc/ssh/keys-root/authorized_keys (on the ESXi hypervisor).  After
112       doing this, you should check that passwordless access works from the
113       virt-v2v server to the ESXi hypervisor.  For example:
114
115        $ ssh root@esxi.example.com
116        [ logs straight into the shell, no password is requested ]
117
118       VMX: Construct the SSH URI
119
120       When using the SSH input transport you must specify a remote
121       "ssh://..." URI pointing to the VMX file.  A typical URI looks like:
122
123        ssh://root@esxi.example.com/vmfs/volumes/datastore1/my%20guest/my%20guest.vmx
124
125       Any space must be escaped with %20 and other non-ASCII characters may
126       also need to be URI-escaped.
127
128       The username is not required if it is the same as your local username.
129
130       You may optionally supply a port number after the hostname if the SSH
131       server is not listening on the default port (22).
132
133   VMX: Importing a guest
134       To import a vmx file from a local file or NFS, do:
135
136        $ virt-v2v -i vmx guest.vmx -o local -os /var/tmp
137
138       To import a vmx file over SSH, add -it ssh to select the SSH transport
139       and supply a remote SSH URI:
140
141        $ virt-v2v \
142            -i vmx -it ssh \
143            "ssh://root@esxi.example.com/vmfs/volumes/datastore1/guest/guest.vmx" \
144            -o local -os /var/tmp
145
146       Virt-v2v processes the vmx file and uses it to find the location of any
147       vmdk disks.
148

INPUT FROM VDDK

150       Virt-v2v is able to import guests using VMware’s proprietary VDDK
151       library (a.k.a. VixDiskLib).
152
153   VDDK: Prerequisites
154       1.  As the VDDK library is not open source, and the license of this
155           library does not permit redistribution or commercial use, you must
156           obtain VDDK yourself and satisfy yourself that your usage of the
157           library is permitted by the license.
158
159       2.  nbdkit ≥ 1.6 is recommended, as it ships with the VDDK plugin
160           enabled unconditionally.
161
162       3.  You must find the SSL "thumbprint" of your VMware server.  How to
163           do this is explained in nbdkit-vddk-plugin(1), also available at
164           the link above.
165
166       4.  VDDK imports require a feature added in libvirt ≥ 3.7.
167
168   VDDK: ESXi NFC service memory limits
169       In the verbose log you may see errors like:
170
171        nbdkit: vddk[3]: error: [NFC ERROR] NfcFssrvrProcessErrorMsg:
172        received NFC error 5 from server: Failed to allocate the
173        requested 2097176 bytes
174
175       This seems especially common when there are multiple parallel
176       connections open to the VMware server.
177
178       These can be caused by resource limits set on the VMware server.  You
179       can increase the limit for the NFC service by editing
180       /etc/vmware/hostd/config.xml and adjusting the "<maxMemory>" setting:
181
182        <nfcsvc>
183          <path>libnfcsvc.so</path>
184          <enabled>true</enabled>
185          <maxMemory>50331648</maxMemory>
186          <maxStreamMemory>10485760</maxStreamMemory>
187        </nfcsvc>
188
189       and restarting the "hostd" service:
190
191        # /etc/init.d/hostd restart
192
193       For more information see https://bugzilla.redhat.com/1614276.
194
195   VDDK: URI
196       Construct the correct "vpx://" (for vCenter) or "esx://" (for ESXi)
197       URL.  It will look something like these:
198
199        vpx://root@vcenter.example.com/Datacenter/esxi
200
201        esx://root@esxi.example.com
202
203       To verify that you have the correct URL, use the virsh(1) command to
204       list the guests on the server:
205
206        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi' list --all
207        Enter root's password for vcenter.example.com: ***
208
209         Id    Name                           State
210        ----------------------------------------------------
211         -     Fedora 20                      shut off
212         -     Windows 2003                   shut off
213
214       If you get an error "Peer certificate cannot be authenticated with
215       given CA certificates" or similar, then you can either import the
216       vCenter host’s certificate, or bypass signature verification by adding
217       the "?no_verify=1" flag:
218
219        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' list --all
220
221       You should also try dumping the metadata from any guest on your server,
222       like this:
223
224        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi' dumpxml "Windows 2003"
225        <domain type='vmware'>
226          <name>Windows 2003</name>
227          [...]
228          <vmware:moref>vm-123</vmware:moref>
229        </domain>
230
231       If "<vmware:moref>" does not appear in the metadata, then you need to
232       upgrade libvirt.
233
234       If the above commands do not work, then virt-v2v is not going to work
235       either.  Fix your URI and/or your VMware server before continuing.
236
237   VDDK: Importing a guest
238       The -it vddk parameter selects VDDK as the input transport for disks.
239
240       To import a particular guest from vCenter server or ESXi hypervisor,
241       use a command like the following, substituting the URI, guest name and
242       SSL thumbprint:
243
244        $ virt-v2v \
245            -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' \
246            -it vddk \
247            -io vddk-libdir=/path/to/vmware-vix-disklib-distrib \
248            -io vddk-thumbprint=xx:xx:xx:... \
249            "Windows 2003" \
250            -o local -os /var/tmp
251
252       Other options that you might need to add in rare circumstances include
253       -io vddk-config, -io vddk-cookie, -io vddk-nfchostport, -io vddk-port,
254       -io vddk-snapshot, and -io vddk-transports, which are all explained in
255       the nbdkit-vddk-plugin(1) documentation.  Do not use these options
256       unless you know what you are doing.
257
258   VDDK: Debugging VDDK failures
259       The VDDK library can be operated in a verbose mode where it gives
260       (very) verbose messages.  Use ‘virt-v2v -v -x’ as usual to enable
261       verbose messages.
262

INPUT FROM VMWARE OVA

264       Virt-v2v is able to import guests from VMware’s OVA (Open
265       Virtualization Appliance) files.  Only OVAs exported from VMware
266       vSphere will work.
267
268   OVA: Create OVA
269       To create an OVA in vSphere, use the "Export OVF Template" option (from
270       the VM context menu, or from the File menu).  Either "Folder of files"
271       (OVF) or "Single file" (OVA) will work, but OVA is probably easier to
272       deal with.  OVA files are really just uncompressed tar files, so you
273       can use commands like "tar tf VM.ova" to view their contents.
274
275       Create OVA with ovftool
276
277       You can also use VMware’s proprietary "ovftool":
278
279        ovftool --noSSLVerify \
280          vi://USER:PASSWORD@esxi.example.com/VM \
281          VM.ova
282
283       To connect to vCenter:
284
285        ovftool  --noSSLVerify \
286          vi://USER:PASSWORD@vcenter.example.com/DATACENTER-NAME/vm/VM \
287          VM.ova
288
289       For Active Directory-aware authentication, you have to express the "@"
290       character in the form of its ascii hex-code (%5c):
291
292        vi://DOMAIN%5cUSER:PASSWORD@...
293
294   OVA: Importing a guest
295       To import an OVA file called VM.ova, do:
296
297        $ virt-v2v -i ova VM.ova -o local -os /var/tmp
298
299       If you exported the guest as a "Folder of files", or if you unpacked
300       the OVA tarball yourself, then you can point virt-v2v at the directory
301       containing the files:
302
303        $ virt-v2v -i ova /path/to/files -o local -os /var/tmp
304

INPUT FROM VMWARE VCENTER SERVER

306       Virt-v2v is able to import guests from VMware vCenter Server.
307
308       vCenter ≥ 5.0 is required.  If you don’t have vCenter, using OVA or VMX
309       is recommended instead (see "INPUT FROM VMWARE OVA" and/or "INPUT FROM
310       VMWARE VMX").
311
312       Virt-v2v uses libvirt for access to vCenter, and therefore the input
313       mode should be -i libvirt.  As this is the default, you don't need to
314       specify it on the command line.
315
316   vCenter: URI
317       The libvirt URI of a vCenter server looks something like this:
318
319        vpx://user@server/Datacenter/esxi
320
321       where:
322
323       "user@"
324           is the (optional, but recommended) user to connect as.
325
326           If the username contains a backslash (eg. "DOMAIN\USER") then you
327           will need to URI-escape that character using %5c: "DOMAIN%5cUSER"
328           (5c is the hexadecimal ASCII code for backslash.)  Other
329           punctuation may also have to be escaped.
330
331       "server"
332           is the vCenter Server (not hypervisor).
333
334       "Datacenter"
335           is the name of the datacenter.
336
337           If the name contains a space, replace it with the URI-escape code
338           %20.
339
340       "esxi"
341           is the name of the ESXi hypervisor running the guest.
342
343       If the VMware deployment is using folders, then these may need to be
344       added to the URI, eg:
345
346        vpx://user@server/Folder/Datacenter/esxi
347
348       For full details of libvirt URIs, see: http://libvirt.org/drvesx.html
349
350       Typical errors from libvirt / virsh when the URI is wrong include:
351
352       ·   Could not find datacenter specified in [...]
353
354       ·   Could not find compute resource specified in [...]
355
356       ·   Path [...] does not specify a compute resource
357
358       ·   Path [...] does not specify a host system
359
360       ·   Could not find host system specified in [...]
361
362   vCenter: Test libvirt connection to vCenter
363       Use the virsh(1) command to list the guests on the vCenter Server like
364       this:
365
366        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi' list --all
367        Enter root's password for vcenter.example.com: ***
368
369         Id    Name                           State
370        ----------------------------------------------------
371         -     Fedora 20                      shut off
372         -     Windows 2003                   shut off
373
374       If you get an error "Peer certificate cannot be authenticated with
375       given CA certificates" or similar, then you can either import the
376       vCenter host’s certificate, or bypass signature verification by adding
377       the "?no_verify=1" flag:
378
379        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' list --all
380
381       You should also try dumping the metadata from any guest on your server,
382       like this:
383
384        $ virsh -c 'vpx://root@vcenter.example.com/Datacenter/esxi' dumpxml "Windows 2003"
385        <domain type='vmware'>
386          <name>Windows 2003</name>
387          [...]
388        </domain>
389
390       If the above commands do not work, then virt-v2v is not going to work
391       either.  Fix your libvirt configuration and/or your VMware vCenter
392       Server before continuing.
393
394   vCenter: Importing a guest
395       To import a particular guest from vCenter Server, do:
396
397        $ virt-v2v -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' \
398          "Windows 2003" \
399          -o local -os /var/tmp
400
401       where "Windows 2003" is the name of the guest (which must be shut
402       down).
403
404       Note that you may be asked for the vCenter password twice.  This
405       happens once because libvirt needs it, and a second time because
406       virt-v2v itself connects directly to the server.  Use -ip filename to
407       supply a password via a file.
408
409       In this case the output flags are set to write the converted guest to a
410       temporary directory as this is just an example, but you can also write
411       to libvirt or any other supported target.
412
413   vCenter: Non-administrator role
414       Instead of using the vCenter Administrator role, you can create a
415       custom non-administrator role to perform the conversion.  You will
416       however need to give it a minimum set of permissions as follows (using
417       VMware vCenter 6.5):
418
419       1.  Create a custom role in vCenter.
420
421       2.  Enable (check) the following objects:
422
423            Datastore:
424             - Browse datastore
425             - Low level file operations
426
427            Sessions:
428             - Validate session
429
430            Virtual Machine:
431              Interaction:
432                - Guest operating system management by VIX API
433              Provisioning:
434                - Allow disk access
435                - Allow read-only disk access
436
437   vCenter: Firewall and proxy settings
438       vCenter: Ports
439
440       If there is a firewall between the virt-v2v conversion server and the
441       vCenter server, then you will need to open port 443 (https) and port
442       5480.
443
444       Port 443 is used to copy the guest disk image(s).  Port 5480 is used to
445       query vCenter for guest metadata.
446
447       These port numbers are only the defaults.  It is possible to
448       reconfigure vCenter to use other port numbers.  In that case you would
449       need to specify those ports in the "vpx://" URI.  See "vCenter: URI"
450       above.
451
452       These ports only apply to virt-v2v conversions.  You may have to open
453       other ports for other vCenter functionality, for example the web user
454       interface.  VMware documents the required ports for vCenter in their
455       online documentation.
456
457        ┌────────────┐   port 443 ┌────────────┐        ┌────────────┐
458        │ virt-v2v   │────────────▶ vCenter    │────────▶ ESXi       │
459        │ conversion │────────────▶ server     │        │ hypervisor │
460        │ server     │  port 5480 │            │        │   ┌─────┐  │
461        └────────────┘            └────────────┘        │   │guest│  │
462                                                        └───┴─────┴──┘
463
464       (In the diagram above the arrows show the direction in which the TCP
465       connection is initiated, not necessarily the direction of data
466       transfer.)
467
468       Virt-v2v itself does not connect directly to the ESXi hypervisor
469       containing the guest.  However vCenter connects to the hypervisor and
470       forwards the information, so if you have a firewall between vCenter and
471       its hypervisors you may need to open additional ports (consult VMware
472       documentation).
473
474       The proxy environment variables ("https_proxy", "all_proxy",
475       "no_proxy", "HTTPS_PROXY", "ALL_PROXY" and "NO_PROXY") are ignored when
476       doing vCenter conversions.
477
478   vCenter: SSL/TLS certificate problems
479       You may see this error:
480
481         CURL: Error opening file: SSL: no alternative certificate subject
482         name matches target host name
483
484       (You may need to enable debugging with ‘virt-v2v -v -x’ to see this
485       message).
486
487       This can be caused by using an IP address instead of the fully-
488       qualified DNS domain name of the vCenter server, ie.  use
489       "vpx://vcenter.example.com/..." instead of "vpx://11.22.33.44/..."
490
491       Another certificate problem can be caused by the vCenter server having
492       a mismatching FQDN and IP address, for example if the server acquired a
493       new IP address from DHCP.  To fix this you need to change your DHCP
494       server or network configuration so that the vCenter server always gets
495       a stable IP address.  After that log in to the vCenter server’s admin
496       console at "https://vcenter:5480/".  Under the "Admin" tab, select
497       "Certificate regeneration enabled" and then reboot it.
498

SEE ALSO

500       virt-v2v(1).
501

AUTHOR

503       Richard W.M. Jones
504
506       Copyright (C) 2009-2020 Red Hat Inc.
507

LICENSE

509       This program is free software; you can redistribute it and/or modify it
510       under the terms of the GNU General Public License as published by the
511       Free Software Foundation; either version 2 of the License, or (at your
512       option) any later version.
513
514       This program is distributed in the hope that it will be useful, but
515       WITHOUT ANY WARRANTY; without even the implied warranty of
516       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
517       General Public License for more details.
518
519       You should have received a copy of the GNU General Public License along
520       with this program; if not, write to the Free Software Foundation, Inc.,
521       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
522

BUGS

524       To get a list of bugs against libguestfs, use this link:
525       https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
526
527       To report a new bug against libguestfs, use this link:
528       https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
529
530       When reporting a bug, please supply:
531
532       ·   The version of libguestfs.
533
534       ·   Where you got libguestfs (eg. which Linux distro, compiled from
535           source, etc)
536
537       ·   Describe the bug accurately and give a way to reproduce it.
538
539       ·   Run libguestfs-test-tool(1) and paste the complete, unedited output
540           into the bug report.
541
542
543
544virt-v2v-1.42.0                   2020-04-16          virt-v2v-input-vmware(1)
Impressum