Hide Forgot
Description of problem: I posted this patch upstream which adds support for VMX imports over SSH: https://www.redhat.com/archives/libguestfs/2017-December/msg00027.html This is a convenient and fast conversion method which we should Tech Preview (at least, maybe support) in RHEL 7.5. Version-Release number of selected component (if applicable): libguestfs 1.36.10-3.el7
Upstream commit: https://github.com/libguestfs/libguestfs/commit/1d38216d20141cef9ce83ca4ddbe9c79f5da4f39 I think we should consider this patch too: https://www.redhat.com/archives/libguestfs/2017-December/msg00035.html
Verify the bug with below builds: virt-v2v-1.36.10-4.el7 libguestfs-1.36.10-4.el7 libvirt-3.9.0-6.el7.x86_64 qemu-kvm-rhev-2.10.0-12.el7.x86_64 Steps: 1.Open virt-v2v manual page, we can see some relevant information of the bug, the content looks good to me. 2.Use virt-v2v(root user)to convert guest over SSH from the ESXi server ESXI6.5. 1.Convert win10 guest to rhv4.1,the conversion could be finished finished successfully. #virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx -o rhv -os 10.73.131.93:/home/nfs_export 2.Convert win7 guest to rhv4.1,the conversion could be finished finished successfully. #virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/win7-database1/win7-database1.vmx -o rhv -os 10.73.131.93:/home/nfs_export 3.Convert rhel7.4 guest to rhv4.1,the conversion could be finished finished successfully #virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/esx6.0-rhel7.4-x64-vmware-tools/esx6.0-rhel7.4-x64-vmware-tools.vmx -o rhv -os 10.73.131.93:/home/nfs_export 4.Convert rhel6.9 guest to rhv4.1,the conversion could be finished finished successfully #virt-v2v -i vmx -it ssh ssh://root.196.89//vmfs/volumes/nfs/esx6.5-linux/esx6.5-rhel6.9-x86_64/esx6.5-rhel6.9-x86_64.vmx -o rhv -os 10.73.131.93:/home/nfs_export 5.Convert win7 guest to kvm, the conversion could be finished finished successfully. #virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/win7-database1/win7-database1.vmx 6.Convert rhel7.4 guest to kvm, the conversion could be finished finished successfully. #virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/esx6.0-rhel7.4-x64-vmware-tools/esx6.0-rhel7.4-x64-vmware-tools.vmx -o local -os /var/tmp ESXI6.0: 1.Convert win10 guest to rhv, the test result looks good 1.Convert rhel6.9 guest to kvm, the test result looks good ESXI5.5: 1.Convert rhel6.9 guest to rhv, the test result looks good 2.Convert rhel6.9 guest to kvm, the test result looks good 3.Convert rhel7.4 guest to rhv, the test result looks good 4.Convert rhel7.4 guest to kvm, the test result looks good ESXI5.1: 1.Convert win7 guest to rhv, the test result looks good 2.Convert win7 guest to kvm, the test result looks good From all above results ,the method of virt-v2v VMX imports over SSH works good. 3.Use virt-v2v(not root)to convert guest over SSH from the ESXi server $ virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx -o local -os /var/tmp [ 0.0] Opening the source -i vmx ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx [ 0.5] Creating an overlay to protect the source from being modified [ 0.9] Initializing the target -o local -os /var/tmp [ 0.9] Opening the overlay virt-v2v: error: libguestfs error: /run/user/0/libguestfsu3g1hv: cannot create temporary directory: Permission denied If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] HI,rjones, what's your ideas about above result. The "root user" results look good to me,but "not root user" i get the error, could you help me find out what causes it.
(In reply to kuwei from comment #5) > 3.Use virt-v2v(not root)to convert guest over SSH from the ESXi server > $ virt-v2v -i vmx -it ssh > ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10- > database1.vmx -o local -os /var/tmp > [ 0.0] Opening the source -i vmx > ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10- > database1.vmx > [ 0.5] Creating an overlay to protect the source from being modified > [ 0.9] Initializing the target -o local -os /var/tmp > [ 0.9] Opening the overlay > virt-v2v: error: libguestfs error: /run/user/0/libguestfsu3g1hv: cannot > create temporary directory: Permission denied This is a bug in ‘su’: https://bugzilla.redhat.com/show_bug.cgi?id=967509 It's not to do with virt-v2v.
sudo doesn't pass through all environment variables. If you use ‘sudo -E virt-v2v ...’ it will work, or alternately: sudo LIBGUESTFS_BACKEND=direct virt-v2v [etc] I don't believe any of this is a bug, it's just how normal sudo works.
(In reply to Richard W.M. Jones from comment #8) > sudo doesn't pass through all environment variables. If you use > ‘sudo -E virt-v2v ...’ it will work, or alternately: > > sudo LIBGUESTFS_BACKEND=direct virt-v2v [etc] > > I don't believe any of this is a bug, it's just how normal sudo > works. Good, very thanks, i get a deeper understanding about sudo. $ sudo -E virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx -o local -os /var/tmp [ 0.0] Opening the source -i vmx ssh://root.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx ********************** [ 13.1] Copying disk 1/1 to /var/tmp/win10-database1-sda (raw) (100.00/100%) [ 161.8] Creating output metadata [ 161.9] Finishing off I think we can add the help info "sudo -E virt-v2v ..." to v2v manual page. The new v2v feature looks good, and conversion time can be greatly reduced. From above comments, move the bug to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0677