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 839312 - 3.1 - _interImagesCopy will create fully allocated raw files when copying raw sparse file volumes between NFS domains.
Summary: 3.1 - _interImagesCopy will create fully allocated raw files when copying raw...
Keywords:
Status: CLOSED DUPLICATE of bug 748386
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vdsm
Version: 6.2
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Yeela Kaplan
QA Contact: Haim
URL:
Whiteboard: storage
Depends On:
Blocks: 782183 840699
TreeView+ depends on / blocked
 
Reported: 2012-07-11 14:23 UTC by Lee Yarwood
Modified: 2018-12-02 19:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-23 14:32:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 154323 0 None None None 2012-07-11 18:31:11 UTC

Description Lee Yarwood 2012-07-11 14:23:59 UTC
Description of problem:
_interImagesCopy (vdsm/storage/image.py) will create fully allocated raw files when copying raw sparse file volumes between NFS domains. At present we call misc.ddWatchCopy() to copy data between the source and destination volumes. Given the sparse nature of the files dd will fully allocate every block in the destination volume.

You can reproduce this behavior outside of vdsm with :

# qemu-img create test.img 10M
Formatting 'test.img', fmt=raw size=10485760 
# qemu-img info test.img 
image: test.img
file format: raw
virtual size: 10M (10485760 bytes)
disk size: 0

# dd if=test.img of=copy.img
20480+0 records in
20480+0 records out
10485760 bytes (10 MB) copied, 0.0347086 s, 302 MB/s
# qemu-img info copy.img 
image: copy.img
file format: raw
virtual size: 10M (10485760 bytes)
disk size: 10M

With a possible workaround being the use of cp and the --sparse flag :

# cp --sparse=always copy.img sparse.img
# qemu-img info sparse.img 
image: sparse.img
file format: raw
virtual size: 10M (10485760 bytes)
disk size: 0

Version-Release number of selected component (if applicable):
vdsm-4.9-113.1 (and upstream)

How reproducible:
Always

Steps to Reproduce:
1. Create a guest with thin provisioned disks on a NFS domain.
2. Review the current virtual and actual size of the volumes.
3. Move the guest to another NFS domain.
4. Review the current virtual and actual size of the volumes. The virtual and actual size will now both show the volume as fully allocated.
  
Actual results:
The destination volumes are fully allocated by DD.

Expected results:
The destination volumes are left sparse just as the source is.

Additional info:
WIP Workaround to this is to use the --sparse=always switch with cp to recreate the volume. Current testing with pre-installed guests suggests this copies _all_ the required data but I'm still attempting to verify.

Comment 2 Lee Yarwood 2012-07-11 18:29:55 UTC
WIP patch upstream http://gerrit.ovirt.org/#/c/6160/1 , currently based on some successful downstream testing but likely to change with review.


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