RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 832336 - block streaming "explodes" a qcow2 file to the full virtual size of the disk
Summary: block streaming "explodes" a qcow2 file to the full virtual size of the disk
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-15 08:06 UTC by Paolo Bonzini
Modified: 2013-07-17 18:50 UTC (History)
12 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.320.el6
Doc Type: Bug Fix
Doc Text:
Running a block_stream operation on a qcow2 image allocated disk space for the entire image, causing the image to grow to the size of the virtual disk. Now, block streaming does not copy unallocated sectors from the backing file. The target image thus will not grow by more than the size of the backing file.
Clone Of:
Environment:
Last Closed: 2013-02-21 13:07:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0543 0 normal SHIPPED_LIVE qemu-kvm-rhev, qemu-kvm-rhev-tools, qemu-img-rhev bug fix update 2013-02-21 18:06:57 UTC

Description Paolo Bonzini 2012-06-15 08:06:41 UTC
From bug 582475 comment 34:
1. install a image(rhel63-64.qcow2)
   # qemu-img info rhel63-64.qcow2
   image: rhel63-64.qcow2
   file format: qcow2
   virtual size: 10G (10737418240 bytes)
   disk size: 2.1G
   cluster_size: 65536

2. create a src.qow2 with a backing file rhel63-64.qcow2
   # qemu-img create -f qcow2 -b rhel63-64.qcow2 -F qcow2 src.qcow2

3. start the guest in qemu cmd line with src.qcow2
4. (qemu) block-stream ide0-hd0
   # qemu-img info src.qcow2
   image: src.qcow2
   file format: qcow2
   virtual size: 10G (10737418240 bytes)
   disk size: 10G
   cluster_size: 65536

Expected results:
The size of src.qcow2 should be ~2.1G, roughly the same as rhel63-64.qcow2.

Actual results:
The size is 10G whereas the size of the backing file is 2.1G.

Additional information:
This was done by design in upstream QEMU and backported this way to RHEL.  We changed it before the 1.1 release in upstream QEMU, but it was too late for RHEL6.3.  We should backport the change.

Related to bug 808114.

Comment 1 RHEL Program Management 2012-07-10 08:13:43 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2012-07-11 01:45:10 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 7 Qunfang Zhang 2012-11-07 10:04:26 UTC
Reproduced on qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64 and verified pass on qemu-kvm-rhev-0.12.1.2-2.334.el6.x86_64.

Steps.
1. Install a rhel6.3 qcow2 image
2. create snapshot src.qcow2.
# qemu-img create -f qcow2 -b rhel6.3-virtio.qcow2 -F qcow2 src.qcow2
# qemu-img info src.qcow2 
image: src.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 136K
cluster_size: 65536
backing file: rhel6.3-virtio.qcow2

# qemu-img info rhel6.3-virtio.qcow2 
image: rhel6.3-virtio.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 3.1G
cluster_size: 65536

3. Boot the src.qcow2 
(qemu) info block
disk0: removable=0 io-status=ok file=/home/src.qcow2 backing_file=rhel6.3-virtio.qcow2 ro=0 drv=qcow2 encrypted=0

4. (qemu) block-stream disk0
(qemu) info block-jobs 
Streaming device disk0: Completed 28377088 of 21474836480 bytes, speed limit 0 bytes/s

=============
On the old version qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64, it takes very long time to finish the block stream job. And after step 4 finished, the disk size of src.qcow2 is 20G, same as virtual size.

# qemu-img info src.qcow2 
image: src.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 20G
cluster_size: 65536


On the fixed version qemu-kvm-rhev-0.12.1.2-2.334.el6.x86_64, the block stream job finishes quickly than old version. And finally the disk size is 3.1G, not 20G.

# qemu-img info src.qcow2 
image: src.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 3.1G
cluster_size: 65536

Based on above, this issue is fixed.

Comment 10 errata-xmlrpc 2013-02-21 13:07:40 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-2013-0543.html


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