Bug 2072977

Summary: RFE: Convert individual VMs from a vApp (a type of OVA containing a collection of multiple VMs)
Product: Red Hat Enterprise Linux 9 Reporter: mxie <mxie>
Component: virt-v2vAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED MIGRATED QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 9.1CC: chhu, hongzliu, juzhou, lersek, mtessun, rjones, tyan, tzheng, vwu, xiaodwan
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-30 18:41:07 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vmware-vapp.png none

Description mxie@redhat.com 2022-04-07 11:48:51 UTC
Created attachment 1871268 [details]
vmware-vapp.png

Description of problem:
[RFE]Virt-v2v can convert guests from VMware aVpp

Version-Release number of selected component (if applicable):
virt-v2v-2.0.2-1.el9.x86_64
libguestfs-1.48.0-2.el9.x86_64
guestfs-tools-1.48.0-1.el9.x86_64
libvirt-libs-8.2.0-1.el9.x86_64
qemu-img-6.2.0-12.el9.x86_64
nbdkit-server-1.30.2-1.el9.x86_64
libnbd-1.12.2-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a vApp for  ESXi6.7 host on vsphere client

2. Create a VM under vApp, pls refer to screenshot 'vmware-vapp'

3. Convert the guest from VMware vApp by v2v via vddk
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/vapp-m/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  rhel8.5-app -ip /home/passwd
[   0.0] Setting up the source: -i libvirt -ic vpx://root.73.141/data/10.73.75.219/vapp-m/?no_verify=1 -it vddk rhel8.5-app
virt-v2v: error: exception: libvirt: VIR_ERR_INVALID_ARG: VIR_FROM_ESX:
invalid argument: Path '/data/10.73.75.219/vapp-m/' ends with an excess
item

If reporting bugs, run virt-v2v with debugging enabled and include the
complete output:

  virt-v2v -v -x [...]

4.Convert the guest from VMware vApp by v2v without vddk
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/vapp-m/?no_verify=1  rhel8.5-app -ip /home/passwd
[   0.0] Setting up the source: -i libvirt -ic vpx://root.73.141/data/10.73.75.219/vapp-m/?no_verify=1 rhel8.5-app
virt-v2v: error: exception: libvirt: VIR_ERR_INVALID_ARG: VIR_FROM_ESX: 
invalid argument: Path '/data/10.73.75.219/vapp-m/' ends with an excess 
item

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

5.Convert the guest from VMware vApp by v2v via vmx+ssh
5.1 # virt-v2v -i vmx -it ssh ssh://root.75.219/vmfs/volumes/datastore6.7/rhel8.5-vapp/rhel8.5-vapp.vmx -ip /home/passwd
[   1.2] Setting up the source: -i vmx ssh://root.75.219/vmfs/volumes/datastore6.7/rhel8.5-vapp/rhel8.5-vapp.vmx
(root.75.219) Password: 
(root.75.219) Password: 
[  12.5] Opening the source
nbdkit: ssh[1]: error: all possible authentication methods failed
virt-v2v: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: process exited while 
connecting to monitor: 2022-04-07T11:39:00.407075Z qemu-kvm: -blockdev 
{"driver":"nbd","server":{"type":"unix","path":"/tmp/v2v.x0KkbA/in0"},"node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: 
Requested export not available [code=1 int1=-1]

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

5.2 # export LIBGUESTFS_BACKEND=direct

5.3 # virt-v2v -i vmx -it ssh ssh://root.75.219/vmfs/volumes/datastore6.7/rhel8.5-vapp/rhel8.5-vapp.vmx -ip /home/passwd
[   0.0] Setting up the source: -i vmx ssh://root.75.219/vmfs/volumes/datastore6.7/rhel8.5-vapp/rhel8.5-vapp.vmx
(root.75.219) Password: 
(root.75.219) Password: 
[  10.3] Opening the source
nbdkit: ssh[1]: error: all possible authentication methods failed
virt-v2v: error: libguestfs error: guestfs_launch failed.
This usually means the libguestfs appliance failed to start or crashed.
Do:
  export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
and run the command again.  For further information, read:
  http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
You can also run 'libguestfs-test-tool' and post the *complete* output
into a bug report or message to the libguestfs mailing list.

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


Expected results:
As above description

Additional info:

Comment 1 Richard W.M. Jones 2022-04-08 08:48:07 UTC
Some background to this feature request: VMware vApp is a feature
that lets you groups virtual machines together.  Exporting a vApp
creates an OVA containing multiple VMs.  The associated OVF has
<VirtualSystemCollection/>.

Virt-v2v doesn't support converting more than one VM, so this is
likely something we'd have to handle at a higher-level management
layer (if it made sense to support it at all).

We ought to create a better error message and perhaps document
workarounds in the manual.