Bug 1056640

Summary: virt-v2v OVA/OVF import fails when no (optional) ovf:capacityAllocationUnits is specified
Product: [Community] Virtualization Tools Reporter: Ronald van Zantvoort <van.zantvoort>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mbooth, ptoscano, rbalakri, rjones, shavivi, van.zantvoort
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-15 15:47:57 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:
Attachments:
Description Flags
Proposed patch to solve a few disk sizing issues none

Description Ronald van Zantvoort 2014-01-22 15:43:00 UTC
Description of problem:
When an OVF file under it's DiskSection defines any disk without the ovf:capacityAllocationUnits, import will fail with
Unexpected ovf:capacityAllocationUnits:  at /usr/share/perl5/vendor_perl/Sys/VirtConvert/Connection/VMwareOVASource.pm line 345.

However, according to spec, the default is bytes and the property is optional.

Version-Release number of selected component (if applicable):
Fedora 20 / virt-v2v 0.9.0

How reproducible:
Import an OVA/OVF with a DiskSection and a Disk in it without the ovf:capacityAllocationUnits but with the ovf:capacity property

Actual results:
Import fails.

Expected results:
Import succeeds with ovf:capacity interpreted as bytes 

Additional info:
The OVF standard (http://www.dmtf.org/sites/default/files/standards/documents/DSP0243_1.0.0.pdf) defines:

"The capacity of a virtual disk shall be specified by the ovf:capacity attribute with an xs:long integer 
value. The default unit of allocation shall be bytes. The optional string attribute 
ovf:capacityAllocationUnits may be used to specify a particular unit of allocation"

Comment 1 Ronald van Zantvoort 2014-01-22 16:07:51 UTC
Created attachment 853937 [details]
Proposed patch to solve a few disk sizing issues

Proposed patch for resolution of issue.

* ovf:capacityAllocationUnits becomes optional
* ovf:capacityAllocationUnits is now interpreted the same way as the patch for https://bugzilla.redhat.com/show_bug.cgi?id=1056126 proposes, with OVF-compliant parsing of the value, collapsing it into a bytes value.

Comment 2 Richard W.M. Jones 2015-04-15 15:47:57 UTC
Hi, thanks for the bug report.  Unfortunately it is filed against a
very old version of virt-v2v (0.9) which we don't support at all.

Luckily there is a newer version which almost certainly fixes your
bug already.  It's available starting in Fedora 21.  If you still
experience this bug, please try with the new version, and reopen
if it still happens.

Comment 3 Ronald van Zantvoort 2015-08-27 14:33:06 UTC
(In reply to Richard W.M. Jones from comment #1)
> Unfortunately it is filed against a
> very old version of virt-v2v (0.9) 

Well, that tends to happen if you wait 16 months with a reply to a ready2commit submitted patch.