RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1141113 - virt-v2v fails to convert esx guests
Summary: virt-v2v fails to convert esx guests
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-12 08:58 UTC by tingting zheng
Modified: 2015-03-05 13:44 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.27.44-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Attached virt-v2v log file (2.11 KB, text/plain)
2014-09-12 08:58 UTC, tingting zheng
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description tingting zheng 2014-09-12 08:58:02 UTC
Created attachment 936875 [details]
Attached virt-v2v log file

Description
virt-v2v fails to convert esx guests.

Version:
libguestfs-1.27.43-1.1.el7.x86_64
virt-v2v-1.27.43-1.1.el7.x86_64
libvirt-1.2.8-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare vcenter server:10.66.7.125,create datacenter tzheng-test and add esxi hypervisor 10.66.71.84 to it.

2.Use virt-v2v to convert guest from esx.
# virt-v2v -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 esx5.1-clone-test 
[   0.0] Opening the source -i libvirt -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 esx5.1-clone-test
Enter username for 10.66.7.125 [administrator]: 
Enter administrator's password for 10.66.7.125: 
curl -s --insecure -I 'https://10.66.7.125/folder/esx5.0-clone-test/esx5.0-clone-test-flat.vmdk?dcPath=tzheng-test&dsName=esx5.1' ||:
HTTP/1.1 401 Unauthorized
Date: Mon, 12 May 2014 13:34:35 GMT
Set-Cookie: vmware_soap_session="5254d5fe-2e87-a10a-59c3-2a3d085a7f2f"; Path=/; HttpOnly; 
Connection: close
WWW-Authenticate: Basic realm="VMware HTTP server"
Content-Length: 0

virt-v2v: error: esx: incorrect username or password

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

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

The above command shows incorrect username or password,however I can use virsh to connect successfully:
# virsh -c vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1
Enter username for 10.66.7.125 [administrator]: 
Enter administrator's password for 10.66.7.125: 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # list --all
 Id    Name                           State
----------------------------------------------------
 -     dvs                            shut off
 -     esx5.1-clone-test              shut off
 -     esx5.1-rhel3.9-i386            shut off
 -     esx5.1-rhel3.9-x86_64          shut off
 -     esx5.1-rhel5.8-x86_64          shut off
 -     esx5.1-template-test           shut off
 -     esx5.1-win2008-x86_64          shut off
 -     esx5.1-win2008r2-x86_64        shut off
 -     esx5.1-win7-i386               shut off
 -     esx5.1-win7-x86_64             shut off
 -     sluo-rhel6.5-z-64bit           shut off
 -     sluo-rhel7.0-64bit             shut off
 -     sluo-win2012-64bit             shut off

virsh # quit

Actual results:
As described.

Expected results:
virt-v2v can convert esx guest successfully.

Additional info:
Attched detailed debug log.

Comment 2 Richard W.M. Jones 2014-09-12 21:13:47 UTC
This is a complicated story.

If you don't pass a username in the vpx:// URI, then:

(1) libvirt asks you for a username, defaulting to "administrator":

Enter username for 10.66.7.125 [administrator]: 
Enter administrator's password for 10.66.7.125: 

(2) virt-v2v calls curl which will use a default username, which I
believe is your Unix login name.

Unfortunately we cannot get at the result of (1) in order to pass
it to (2).

So the only way around this is to specify the username in the
URL, ie. use vpx://administrator@[...]

I have pushed a commit to 1.27.44 which will change the error message
so it tells you to put the username into the URL.  That, I think, is
the best I can do here.

Comment 4 tingting zheng 2014-09-15 06:02:53 UTC
Tested with:
virt-v2v-1.27.45-1.1.el7.x86_64
libguestfs-1.27.45-1.1.el7.x86_64

# virt-v2v -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 esx5.1-clone-test -v -x
[   0.0] Opening the source -i libvirt -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 esx5.1-clone-test
Enter username for 10.66.7.125 [administrator]: 
Enter administrator's password for 10.66.7.125: 
virt-v2v: error: access: No such file or directory: [esx5.1] 
esx5.0-clone-test/esx5.0-clone-test.vmdk

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

  virt-v2v -v -x [...]
libvirt xml is:
<domain type='vmware'>
  <name>esx5.1-clone-test</name>
  <uuid>4239f0bc-fcf3-223b-9512-c95e8e7ab744</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <shares>1000</shares>
  </cputune>
  <os>
    <type arch='i686'>hvm</type>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <disk type='file' device='disk'>
      <source file='[esx5.1] esx5.0-clone-test/esx5.0-clone-test.vmdk'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0' model='vmpvscsi'/>
    <interface type='bridge'>
      <mac address='00:50:56:b9:26:3d'/>
      <source bridge='VM Network'/>
      <model type='vmxnet3'/>
    </interface>
    <video>
      <model type='vmvga' vram='8192'/>
    </video>
  </devices>
</domain>

Comment 5 Richard W.M. Jones 2014-09-15 07:58:01 UTC
(In reply to tingting zheng from comment #4)
> Tested with:
> virt-v2v-1.27.45-1.1.el7.x86_64
> libguestfs-1.27.45-1.1.el7.x86_64
> 
> # virt-v2v -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1
> esx5.1-clone-test -v -x
> [   0.0] Opening the source -i libvirt -ic
> vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 esx5.1-clone-test
> Enter username for 10.66.7.125 [administrator]: 
> Enter administrator's password for 10.66.7.125: 
> virt-v2v: error: access: No such file or directory: [esx5.1] 
> esx5.0-clone-test/esx5.0-clone-test.vmdk

Remote disk support is completely broken in 1.27.45.  See:

https://bugzilla.redhat.com/show_bug.cgi?id=1141654#c2

Comment 6 tingting zheng 2014-09-16 07:59:19 UTC
Tested with:
libguestfs-1.27.46-1.1.el7.x86_64
virt-v2v-1.27.46-1.1.el7.x86_64
libvirt-1.2.8-2.el7.x86_64

1.# virt-v2v -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 dvs
[   0.0] Opening the source -i libvirt -ic vpx://10.66.7.125/tzheng-test/10.66.71.84/?no_verify=1 dvs
Enter username for 10.66.7.125 [administrator]: 
Enter administrator's password for 10.66.7.125: 
curl -s --insecure -I 'https://10.66.7.125/folder/dvs/dvs-flat.vmdk?dcPath=tzheng-test&dsName=datastore1' ||:
HTTP/1.1 401 Unauthorized
Date: Fri, 16 May 2014 12:14:05 GMT
Set-Cookie: vmware_soap_session="52a8ed97-6882-4809-2931-1b54adaee860"; Path=/; HttpOnly; 
Connection: close
WWW-Authenticate: Basic realm="VMware HTTP server"
Content-Length: 0

virt-v2v: error: esx: incorrect username or password.  You might need to 
specify the username in the URI like this: vpx://USERNAME@[etc]

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

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

Error info shows to tell me to put the username into the URL,then put username in URL try again:
2.# virt-v2v -ic vpx://administrator.7.125/tzheng-test/10.66.71.84/?no_verify=1 dvs
[   0.0] Opening the source -i libvirt -ic vpx://administrator.7.125/tzheng-test/10.66.71.84/?no_verify=1 dvs
Enter administrator's password for 10.66.7.125: 
Enter host password for user 'administrator':
[  52.0] Creating an overlay to protect the source from being modified
[  52.0] Opening the overlay
[  76.0] Initializing the target -o libvirt -os default
[  76.0] Inspecting the overlay
[ 156.0] Checking for sufficient free disk space in the guest
[ 156.0] Estimating space required on target for each disk
[ 156.0] Converting Red Hat Enterprise Linux Server release 6.4 (Santiago) to run on KVM
[ 776.0] Mapping filesystem data to avoid copying unused and blank areas
[ 782.0] Closing the overlay
[ 782.0] Copying disk 1/1 to /var/lib/libvirt/images/dvs-sda (raw)

In step 2,I need to input the password twice,is it a problem?

Comment 7 Richard W.M. Jones 2014-09-16 08:45:33 UTC
(In reply to tingting zheng from comment #6)
> In step 2,I need to input the password twice,is it a problem?

Yes, that's unfortunately necessary.  It is mentioned in the manual:

       Note that you may be asked for the vCenter password twice.  This
       happens once because libvirt needs it, and a second time because
       virt-v2v itself connects directly to the server.

Comment 8 tingting zheng 2014-09-16 10:40:38 UTC
(In reply to Richard W.M. Jones from comment #7)
> (In reply to tingting zheng from comment #6)
> > In step 2,I need to input the password twice,is it a problem?
> 
> Yes, that's unfortunately necessary.  It is mentioned in the manual:
> 
>        Note that you may be asked for the vCenter password twice.  This
>        happens once because libvirt needs it, and a second time because
>        virt-v2v itself connects directly to the server.

Yes,I saw it from virt-v2v manual,refer to comment 6 and comment 7,move the bug to VERIFIED.

Comment 10 errata-xmlrpc 2015-03-05 13:44:34 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://rhn.redhat.com/errata/RHBA-2015-0303.html


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