Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1119798

Summary: uploading an ovf file to an export domain creates tmp folder with vm's full size
Product: Red Hat Enterprise Virtualization Manager Reporter: sefi litmanovich <slitmano>
Component: ovirt-image-uploaderAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED ERRATA QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.4.0CC: adahms, didi, gklein, iheim, lveyde, rbalakri, Rhev-m-bugs, sbonazzo, sherold, stirabos, yeylon
Target Milestone: ---Keywords: Performance
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: rhevm-image-uploader-3.5.0-0.2.master.el6_5 Doc Type: Bug Fix
Doc Text:
This update provides improvements to free space requirements by better handling of sparse files.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 17:46:49 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:
Bug Depends On:    
Bug Blocks: 1142923, 1156165    
Description Flags
image-uploader log none

Description sefi litmanovich 2014-07-15 14:22:24 UTC
Created attachment 918182 [details]
image-uploader log

Description of problem:

trying to upload a vm ovf file that was creates from a vm with 8gb disk size allocated with thin provisioning.
uploading failed with message:

Not enough space in /tmp: 8192Mb are needed.

the free space on the machine running engine at the time was < 8gb.

Is this the behaviour of image-uploader? actually writing the whole vm to the local tmp folder? (also with thin provisioned disk for the vm).

the ovf file size itself was approx. 8MB.
vm's disk wasn't full. no data saved on it, it was created for testing only.

Steps to Reproduce:

1. add export domain to engine.
2. create a vm and allocate a disk with size > available size on server that runs engine.
3.export the vm to export domain.
4. connect to the storage domain and in from the folder of the vm in the export domain create an ovf file: tar -cvzf my_1.ovf images/ master/
5. send the ovf file to the server running engine.
6. try to upload the file to the export domain ##########

Actual results:

uploading fails with the following message:

Not enough space in /tmp: $SIZEMb are needed.

$SIZE = the same amount that was allocated for the vm's disk.

Expected results:

image-uploader doesn't create a full image of the vm on the tmp folder of the server running the command.
Uploading is successful.

Additional info:

Comment 1 Simone Tiraboschi 2014-08-05 15:23:47 UTC
Going deeper, it seams that the bug is indeed more tedious than I thought.

Our .ovf image file are basically just .tar.gz with contain the disk image plus metadata.
Disk image, using thin provisioning, are sparse file to preserve disk space and to speed up copy actions

Creating a gzip compressed tar archive with the -S option preservers sparse behavior: when the user extract the file with GNU tar from CLI the file is still sparse.

Unfortunately python tarfile library doesn't seams to honor that and all the files will be extracted as regular ones so a thin provisioned VM always becomes thick if uploaded via engine-image-uploader

Probably we should rely on GNU tar binary instead of python tarfile lib.

Comment 3 sefi litmanovich 2014-09-04 08:07:21 UTC
Verified with ovirt-engine-3.5.0-0.0.master.20140821064931.gitb794d66.el6.noarch.

1. when creating the sparse ovf file with tar -cSvzf and and uploading that file via engine-image-uploader the process is much faster and still successful.

2. when creating an ovf file from a vm with disk > local server disk (server where engine-uploader is used), using command:

engine-image-uploader -e Export_Dom -v --ignore-lsc upload my_test.ovf

upload succeeds and the full disk size isn't copied to server tmp folder.

Comment 5 errata-xmlrpc 2015-02-11 17:46:49 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.