Bug 1443955

Summary: There is error info about permission denied when convert a guest from vmx file by virt-v2v
Product: Red Hat Enterprise Linux 7 Reporter: kuwei <kuwei>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: juzhou, mxie, mzhan, ptoscano, rjones, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: V2V
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-13 09:39:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1045069    
Bug Blocks: 1558351    

Description kuwei@redhat.com 2017-04-20 10:39:56 UTC
Description of problem:
There is error info about permission denied when convert a guest from vmx file by virt-v2v

Version-Release number of selected component (if applicable):
virt-v2v-1.36.3-3.el7.x86_64
libguestfs-1.36.3-3.el7.x86_64
libvirt-3.2.0-3.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

How reproducible:
100% 

Steps to Reproduce:
1.Mount the NFS storage which contains VMware virtual machines to virt-v2v conversion server as below:
#mount IP:/path  /mnt

2.Locate in VMware virtual machine directory, then import the vmx file to KVM by virt-v2v
#virt-v2v -i vmx esx5.5-rhel7.2-x86_64.vmx -of qcow2
[   0.0] Opening the source -i vmx esx5.5-rhel7.2-x86_64.vmx
[   0.0] Creating an overlay to protect the source from being modified
[   0.2] Initializing the target -o libvirt -os default
[   0.2] Opening the overlay
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: 2017-04-20T06:30:44.247605Z qemu-kvm: -drive 
file=/var/tmp/v2vovl4f2b14.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0,cache=unsafe,discard=unmap: 
Could not open backing file: Could not open 
'/mnt/esx5.5-rhel7.2-x86_64/esx5.5-rhel7.2-x86_64.vmdk': Permission denied 
[code=1 int1=-1]

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

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




Actual results:
As above description

Expected results:
virt-v2v should not report any error when convert a guest from vmx file by virt-v2v.

Additional info:

Comment 2 Richard W.M. Jones 2017-04-20 10:46:25 UTC
Yes, I have seen this problem too.

The workaround is to set LIBGUESTFS_BACKEND=direct before conversion.

I believe it's the usual thing related to lack of qemu:///session
support as root in libvirt (bug 890291 / bug 1045069).

Anyway we will have to leave this one open until RHEL 7.5.

Comment 3 Richard W.M. Jones 2019-05-13 09:39:48 UTC
We don't plan to fix this (or the real bug 1045069) in RHEL 7, so I'm
closing this.  This probably does occur on RHEL 8, but the real bug here
is in libvirt, not virt-v2v.