Bug 1119798 - uploading an ovf file to an export domain creates tmp folder with vm's full size
Summary: uploading an ovf file to an export domain creates tmp folder with vm's full size
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-image-uploader
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.5.0
Assignee: Simone Tiraboschi
QA Contact: sefi litmanovich
Whiteboard: integration
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
Reported: 2014-07-15 14:22 UTC by sefi litmanovich
Modified: 2015-02-11 17:46 UTC (History)
11 users (show)

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.
Clone Of:
Last Closed: 2015-02-11 17:46:49 UTC
oVirt Team: ---
Target Upstream Version:

Attachments (Terms of Use)
image-uploader log (109 bytes, text/x-log)
2014-07-15 14:22 UTC, sefi litmanovich
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 967513 0 high CLOSED [Image-uploader] image-uploader requisite space on the local system calculation time is very long 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:0192 0 normal SHIPPED_LIVE rhevm-image-uploader bug fix and enhancement update 2015-02-11 22:35:56 UTC
oVirt gerrit 31005 0 master MERGED upload: adding --ignore-lsc CLI options Never
oVirt gerrit 31011 0 ovirt-image-uploader-3.5 MERGED upload: adding --ignore-lsc CLI options Never

Internal Links: 967513

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.


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