Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1357962 - Copying a preallocated file based disks will create a disk with the true actual size
Summary: Copying a preallocated file based disks will create a disk with the true actu...
Status: CLOSED DUPLICATE of bug 1405822
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: ovirt-4.1.0-beta
: ---
Assignee: Liron Aravot
QA Contact: Raz Tamir
Depends On:
TreeView+ depends on / blocked
Reported: 2016-07-19 16:46 UTC by Raz Tamir
Modified: 2017-01-11 12:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-01-11 12:29:38 UTC
oVirt Team: Storage
amureini: ovirt-4.1?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?

Attachments (Terms of Use)
screenshot (deleted)
2016-07-19 16:46 UTC, Raz Tamir
no flags Details
vdsm.log (deleted)
2016-07-19 16:47 UTC, Raz Tamir
no flags Details

Description Raz Tamir 2016-07-19 16:46:39 UTC
Created attachment 1181743 [details]

Description of problem:
I'm creating a 10 GB (with OS installed ~2.9GB) preallocated raw disk on nfs domain:
[vdsm images]# du -sh *
11G     dac2079c-e45d-45b9-9d4d-279deb14d3c5/82d395e0-d108-47e6-adbe-e5ab47e1b519
1.1M    dac2079c-e45d-45b9-9d4d-279deb14d3c5/
4.0K    dac2079c-e45d-45b9-9d4d-279deb14d3c5/82d395e0-d108-47e6-adbe-e5ab47e1b519.meta
11G     dac2079c-e45d-45b9-9d4d-279deb14d3c5

copying the disk (via the UI):
DEBUG::2016-07-19 19:18:06,398::qemuimg::224::QemuImg::(__init__) /usr/bin/taskset --cpu-list 0-1 /usr/bin/nice -n 19 /usr/bin/ionice -c 3 /usr/bin/qemu-img convert -p -t none 
-T none -f raw /rhev/data-center/ce185612-2017-4ca1-a76f-ee701f73bd33/5cf6dd4b-65db-413a-8226-95bac7ee9378/images/dac2079c-e45d-45b9-9d4d-279deb14d3c5/82d395e0-d108-47e6-adbe-e5ab47e1b519 -O raw /rhev/data-center/m
nt/ (cwd None)

And the newly copied disk is created as preallocated, raw but only with the actual size of the disk:
[vdsm images]# du -sh *
2.9G    258207a7-45ac-48ab-bd1e-a84ec61e9f82
2.8G    3e65a906-62e8-4c18-9b3b-2cef0b4c90bf/ce80aa84-d8b7-4ca3-883c-1e730916c7c0
1.1M    3e65a906-62e8-4c18-9b3b-2cef0b4c90bf/
4.0K    3e65a906-62e8-4c18-9b3b-2cef0b4c90bf/ce80aa84-d8b7-4ca3-883c-1e730916c7c0.meta

From the API:
<disk href="/ovirt-engine/api/disks/3e65a906-62e8-4c18-9b3b-2cef0b4c90bf" id="3e65a906-62e8-4c18-9b3b-2cef0b4c90bf">

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a vm with preallocated disk (10GB) on nfs storage domain and install OS
2. Copy the disk to the same domain
3. Attach the disk to the vm

Actual results:
The actual size will be the "true" disk size (Screenshot attached)

Expected results:
The disk should be with actual size of the provisioned size that was requested in creation of the source disk (source for the copy operation)

Additional info:

Comment 1 Raz Tamir 2016-07-19 16:47:28 UTC
Created attachment 1181744 [details]

Comment 2 Allon Mureinik 2016-07-21 12:13:20 UTC
Raz, isn't this just a subset of bug 1357919?

Comment 3 Raz Tamir 2016-07-21 12:20:50 UTC
No, In this case I expect from qume-img to act like it reads 10 GB of data because this is what the FS should expose to the client who reads a preallocated file.
The actual behavior is that qemu-img copies only the true data (2.9 GB) on the preallocated disk and doesn't fill the extra 7.1 GB with '0' (zeros).

Comment 4 Tal Nisan 2017-01-11 12:29:38 UTC

*** This bug has been marked as a duplicate of bug 1405822 ***

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