Bug 1523767 - RFE: Add virt-v2v VMX imports over SSH
Summary: RFE: Add virt-v2v VMX imports over SSH
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs   
(Show other bugs)
Version: 7.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
Jiri Herrmann
URL:
Whiteboard: V2V
Keywords: FutureFeature, TechPreview
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-08 16:50 UTC by Richard W.M. Jones
Modified: 2018-04-10 09:21 UTC (History)
5 users (show)

Fixed In Version: libguestfs-1.36.10-4.el7
Doc Type: Technology Preview
Doc Text:
Package(s) providing the Technology Preview: virt-v2v Description of the Technology Preview: the virt-v2v utility now enhances the vmx input mode, by accessing the corresponding VMware storage via ssh.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 09:20:40 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0677 None None None 2018-04-10 09:21 UTC
Red Hat Bugzilla 1441197 None CLOSED RFE: ability to convert VMware virtual machines via vmx 2019-04-15 08:04 UTC

Internal Trackers: 1441197

Description Richard W.M. Jones 2017-12-08 16:50:27 UTC
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

Comment 5 kuwei@redhat.com 2017-12-15 10:54:19 UTC
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@10.73.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@10.73.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@10.73.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@10.73.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@10.73.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@10.73.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@10.73.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx -o local -os /var/tmp
[   0.0] Opening the source -i vmx ssh://root@10.73.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.

Comment 6 Richard W.M. Jones 2017-12-18 10:39:38 UTC
(In reply to kuwei@redhat.com 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@10.73.196.89/vmfs/volumes/datastore1/win10-database1/win10-
> database1.vmx -o local -os /var/tmp
> [   0.0] Opening the source -i vmx
> ssh://root@10.73.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.

Comment 8 Richard W.M. Jones 2017-12-19 09:03:39 UTC
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.

Comment 9 kuwei@redhat.com 2017-12-19 09:31:12 UTC
(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@10.73.196.89/vmfs/volumes/datastore1/win10-database1/win10-database1.vmx -o local -os /var/tmp
[   0.0] Opening the source -i vmx ssh://root@10.73.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.

Comment 12 errata-xmlrpc 2018-04-10 09:20:40 UTC
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


Note You need to log in before you can comment on or make changes to this bug.