Bug 783184

Summary: storage cloning ignores "sparse" and creates non-sparse disk images
Product: Red Hat Enterprise Linux 6 Reporter: Marian Csontos <mcsontos>
Component: libvirtAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, jeder, jwu, karlamrhein, matsuu, mzhan, rwu, veillard, whuang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.10-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:46:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
virt-clone log with --debug none

Description Marian Csontos 2012-01-19 15:59:59 UTC
Description of problem:
virt-clone ignores "sparse" and creates non-sparse disk images

Version-Release number of selected component (if applicable):
python-virtinst-0.600.0-5.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. clone sparse VM
2. run stat and compare blocks allocated
  
Actual results:
cloned image is non sparse - the amount of blocks is several times bigger than original.

Expected results:
cloned image is sparse

Additional info:
I have not done any investigation on older versions.

Comment 2 Cole Robinson 2012-01-25 21:57:24 UTC
Please provide output of virt-clone --debug when reproducing

Comment 4 zhe peng 2012-02-03 07:43:33 UTC
Created attachment 559242 [details]
virt-clone log with --debug

Comment 5 Cole Robinson 2012-02-07 19:54:18 UTC
This is a libvirt bug, patch forthcoming.

Comment 10 zhe peng 2012-02-14 09:59:58 UTC
verify with:
libvirt-0.9.10-1.el6.x86_64
python-virtinst-0.600.0-7.el6.noarch

step same with comment 3
before clone:
# du v1.img 
2871456	v1.img
# stat v1.img 
  File: `v1.img'
  Size: 6291456000	Blocks: 5742912    IO Block: 4096   regular file
Device: 805h/2053d	Inode: 2885429     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-02-14 04:50:59.918362545 -0500
Modify: 2012-02-14 04:50:04.372426169 -0500
Change: 2012-02-14 04:50:30.955113070 -0500
after clone:
# du v1-clone.img 
749936	v1-clone.img
# stat v1-clone.img 
  File: `v1-clone.img'
  Size: 6291456000	Blocks: 1499872    IO Block: 4096   regular file
Device: 805h/2053d	Inode: 2885438     Links: 1
Access: (0644/-rw-r--r--)  Uid: (  107/    qemu)   Gid: (  107/    qemu)
Access: 2012-02-14 04:53:43.038592256 -0500
Modify: 2012-02-14 04:57:14.586157421 -0500
Change: 2012-02-14 04:57:14.586157421 -0500

the cloned image is sparse,verification passed.
move to verified.

Comment 13 errata-xmlrpc 2012-06-20 06:46:56 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/RHSA-2012-0748.html

Comment 14 MATSUU Takuto 2012-08-16 05:39:24 UTC
It seems that even if I set --nonsparse option, virt-clone always creates sparse disk image.