Created attachment 918182 [details]
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 ##########
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.
image-uploader doesn't create a full image of the vm on the tmp folder of the server running the command.
Uploading is successful.
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.
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.
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.