Bug 1117540

Summary: Support virt-sparsify option to allow specifying temporary file or block device
Product: Red Hat Enterprise Linux 6 Reporter: Federico Simoncelli <fsimonce>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: amureini, huzhan, leiwang, mbooth, ptoscano, rjones, virt-bugs, wshi, yuliu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.11-10.el6 Doc Type: Enhancement
Doc Text:
Feature: More options for the temporary space of virt-sparsify. Reason: Give better control of the temporary space, because of space or potential privacy issues. Result: The temporary space for virt-sparsify can also be, other than a directory, a block device, or a particular QCOW2 image (useful for oVirt).
Story Points: ---
Clone Of: 1113020 Environment:
Last Closed: 2014-10-14 06:35:34 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:
Bug Depends On: 1021149, 1113020, 1134635    
Bug Blocks: 1035038, 1082754    

Description Federico Simoncelli 2014-07-08 22:37:01 UTC
+++ This bug was initially created as a clone of Bug #1113020 +++

Description of problem:
virt-sparsify requires a large amount of temporary space in order to sparsify an image. On oVirt nodes we may not have enough temporary local space and we don't want to pollute the hosts with potentially sensible data (even though the temporary layer would most likely just contain zeroes).

It should be possible to specify a temporary oVirt volume (residing on the storage domains) that can be used for processing the image.
The volume can either be a single file or a single block device (logical volume).

Comment 2 Richard W.M. Jones 2014-07-09 09:28:35 UTC
dev-ack, but I believe it's too late for RHEL 6.6 now.

Comment 3 Federico Simoncelli 2014-07-15 22:46:14 UTC
We also need the --tmp prebuilt: support.

Comment 4 Richard W.M. Jones 2014-08-05 08:46:41 UTC
The two commit which implement this are:

9b47a53a4b sparsify: Add --tmp prebuilt:file option.
870c17e99a sparsify: Add --tmp option to allow specifying temp directory or

Federico has requested that we try to get this into RHEL 6.6,
to support the next release of oVirt.

Comment 6 yuliu 2014-09-03 07:56:36 UTC
Version:
Host: RHEL6.6(2.6.32-498.el6.x86_64)
libguestfs: libguestfs-1.20.11-10.el6.x86_64

Steps:
1. virt-sparify -v $image1 image2 --tmp /nfs
2. ll /nfs
-rw-------. 1 root root 4651810816 Sep  3 15:55 sparsify78ca25.qcow2

Result:

We can verify this bug as above.

Comment 7 errata-xmlrpc 2014-10-14 06:35:34 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.

http://rhn.redhat.com/errata/RHBA-2014-1458.html