Bug 839312 - 3.1 - _interImagesCopy will create fully allocated raw files when copying raw sparse file volumes between NFS domains.
3.1 - _interImagesCopy will create fully allocated raw files when copying raw...
Status: CLOSED DUPLICATE of bug 748386
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vdsm (Show other bugs)
6.2
All Linux
high Severity high
: rc
: ---
Assigned To: Yeela Kaplan
Haim
storage
:
Depends On:
Blocks: 782183 840699
  Show dependency treegraph
 
Reported: 2012-07-11 10:23 EDT by Lee Yarwood
Modified: 2016-02-02 17:39 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-23 10:32:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 154323 None None None 2012-07-11 14:31:11 EDT

  None (edit)
Description Lee Yarwood 2012-07-11 10:23:59 EDT
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 14:29:55 EDT
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.