Bug 1194240

Summary: virt-v2v fails to convert ESX guest with "Server does not support 'range' (byte ranges).: Invalid argument"
Product: Red Hat Enterprise Linux 7 Reporter: akotov
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.1CC: jbuchta, nicolas, ptoscano
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-19 11:56:27 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:

Description akotov 2015-02-19 11:48:28 UTC
Description of problem:

When converting RHEL6 ESX guest

libguestfs: trace: get_cachedir = "/var/tmp"
qemu-img create -q -f qcow2 -b 'json: { "file.cookie": "vmware_soap_session=\"525c33cf-e5d1-66fd-99e2-7ef2e9ea332a\"", "file.sslverify": "off", "file.driver": "https", "file.url": "https://xxx.com/folder/rhel6%5flvm%5fakotov/rhel6%5flvm%5fakotov-flat.vmdk?dcPath=ha-datacenter&dsName=datastore1%20%282%29", "file.timeout": 600 }' -o 'compat=1.1,backing_fmt=raw' /var/tmp/v2vovlb8eebd.qcow2
qemu-img: /var/tmp/v2vovlb8eebd.qcow2: Could not open 'json: { "file.cookie": "vmware_soap_session=\"525c33cf-e5d1-66fd-99e2-7ef2e9ea332a\"", "file.sslverify": "off", "file.driver": "https", "file.url": "https://xxx.com/folder/rhel6%5flvm%5fakotov/rhel6%5flvm%5fakotov-flat.vmdk?dcPath=ha-datacenter&dsName=datastore1%20%282%29", "file.timeout": 600 }': CURL: Error opening file: Server does not support 'range' (byte ranges).: Invalid argument
virt-v2v: error: qemu-img command failed, see earlier errors



Version-Release number of selected component (if applicable):

libguestfs-1.28.1-1.18.el7.x86_64
libguestfs-tools-1.28.1-1.18.el7.noarch
libguestfs-tools-c-1.28.1-1.18.el7.x86_64
virt-v2v-1.28.1-1.18.el7.x86_64


How reproducible:

Always

Steps to Reproduce:
1.  # virt-v2v -v -x -ic esx://root.com/?no_verify=1 -o rhev -os 1.1.1.1:/var/lib/exports/v2v --network rhevm rhel6_lvm


Actual results:

qemu-img command failed

Expected results:

V2v process starts

Additional info:

Comment 2 Richard W.M. Jones 2015-02-19 11:56:27 UTC
This is a known and documented problem (with ESX actually) that
we cannot fix.  The customer must install vCenter.

http://libguestfs.org/virt-v2v.1.html#hypervisors-input
"Must be managed by VMware vCenter. Unmanaged, direct input from ESXi is not supported."

Comment 3 Richard W.M. Jones 2015-02-19 11:57:56 UTC
It might be an idea to add a KB article about this, especially
pointing out the error message that people would see and
what to do about it.

Comment 6 Nicolas Ecarnot 2015-04-03 07:45:34 UTC
Hi richard,

I'm right into this subject right now, and trying to virt-v2v 3 vmWare VMs from an ESXi to an oVirt, using a dedicated V2V server.

As I'm facing the exact same error with the exact same command, what is the recommended way (I don't know well vmWare products).
Do one have to export the VM from some vmWare product into an .ova then import it into oVirt ?

As I'm not comfortable with the vmWare part, may I ask you to briefly explain the steps, I'll search by myself the details.

Comment 7 Nicolas Ecarnot 2015-04-03 07:45:47 UTC
Hi Richard,

I'm right into this subject right now, and trying to virt-v2v 3 vmWare VMs from an ESXi to an oVirt, using a dedicated V2V server.

As I'm facing the exact same error with the exact same command, what is the recommended way (I don't know well vmWare products).
Do one have to export the VM from some vmWare product into an .ova then import it into oVirt ?

As I'm not comfortable with the vmWare part, may I ask you to briefly explain the steps, I'll search by myself the details.

Comment 8 Richard W.M. Jones 2015-04-07 09:11:28 UTC
You've got two options:

(1) Using vSphere. export it as an .ova file, and import it through
virt-v2v, using 'virt-v2v -i ova [...]'

(2) Install the VMware ESX appliance, and use that.

If you were going to export a lot of guests, method (2) is the one
I would choose.  Method (1) is fine if you are only doing a few
guests.

Comment 9 Richard W.M. Jones 2015-04-07 09:12:13 UTC
(In reply to Richard W.M. Jones from comment #8)
> (2) Install the VMware ESX appliance, and use that.

I mean, of course, VMware _vCenter_ appliance.

Comment 10 Nicolas Ecarnot 2015-04-07 11:40:00 UTC
(In reply to Richard W.M. Jones from comment #8)
> You've got two options:
> 
> (1) Using vSphere. export it as an .ova file, and import it through
> virt-v2v, using 'virt-v2v -i ova [...]'
> 
> (2) Install the VMware ESX appliance, and use that.
> 
> If you were going to export a lot of guests, method (2) is the one
> I would choose.  Method (1) is fine if you are only doing a few
> guests.

Thank you Richard.

Comment 11 Nicolas Ecarnot 2015-04-07 14:58:42 UTC
Just for the record, (and as I think I can not install vCenter appliance for licence reasons) :

- from a vSphere client, I exported (called "OVA export") the guest into a directory that created :
  - 2 .vmdk files (one for each disk)
  - 1 manifest file
  - 1 .ovf (xml) file

- using virt-v2v -v -x -i ova ./ -o rhev -of qcow2 -os nfssrv:/dir
  is failing with the following message :
 qemu-img: error while reading sector 131072: Invalid argument

- so according to this webpage (http://www.slsmk.com/import-esxi-5-vmdk-into-kvm-qcow2/), I tried to install vmware-vdiskmanager and use this :

 vmware-vdiskmanager -r srv-disk1.vmdk -t 0 srv-disk1-converted_t0.vmdk
that is also failing with the error below :

 Convert: 6% done.Inflate failed (data error)
 Failed to convert disk: Unknown error (0xa0700000001).

And now, googling around is not helping anymore.

Conversion using qemu-img has also been tried with no luck.

If it doesn't disturb, I will probably post here if getting any further, for future googlers.

Comment 12 Richard W.M. Jones 2015-04-07 15:08:17 UTC
Should continue this on libguestfs.org mailing list.