Bug 786942

Summary: Import of compressed qcow2 images fails
Product: [Retired] oVirt Reporter: Ian McLeod <imcleod>
Component: vdsmAssignee: Federico Simoncelli <fsimonce>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: abaron, acathrow, amureini, bazulay, danken, fsimonce, iheim, imcleod, smizrahi, virt-maint, ykaul
Target Milestone: ---   
Target Release: 3.3.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 09:37:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ian McLeod 2012-02-02 17:43:38 UTC
Imports of a compressed qcow2 image will fail if the uncompressed qcow2 image size differs substantially from the compressed size.

This issue is the root cause of image import failures observed in the Image Factory component of Aeolus tracked under this BZ:

https://bugzilla.redhat.com/show_bug.cgi?id=768013

Comment 1 Saggi Mizrahi 2012-02-02 17:49:43 UTC
The root of the problem lies in how VDSM allocates the target storage when doing a qcow2->qcow2 copy.
VDSM assumes that because both files have the same format the target will have the same size or less. This is not true in case of compressed source files as the target will be uncompressed.

More info at
https://bugzilla.redhat.com/show_bug.cgi?id=768013#c43

Comment 2 Saggi Mizrahi 2012-02-03 16:16:08 UTC
I was told not anyone can see my comment on the linked bug.
Here it is copied verbatim here.
You can now have you eyes touched with the light of it's hidden splendor.

"""
The issue seems to be the fact that you are trying to import a compressed qcow2
image.

VDSM allocates the volume base on the size of the original file. Upon
conversion the qcow gets uncompressed and inflates significantly and
effectively runs out of space.

A workaround would be to just not use compressed qcow images. (VDSM should
check this before copying?)

For the long run VDSM needs a way to calculate the target uncompressed size so
it can allocate enough disk space.

Just for people looking to write a patch for this the problem is in:
file: image.py
method: _createTargetImage()
look for: dstVol.extend((volParams['apparentsize'] + 511) / 512)
""""

Comment 3 Itamar Heim 2013-03-12 09:37:30 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.