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...
Keywords:
Status: CLOSED DUPLICATE of bug 1405822
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.1.0-beta
: ---
Assignee: Liron Aravot
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2017-01-11 12:29:38 UTC
oVirt Team: Storage
Embargoed:
amureini: ovirt-4.1?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)
screenshot (212.16 KB, image/png)
2016-07-19 16:46 UTC, Raz Tamir
no flags Details
vdsm.log (4.09 MB, text/plain)
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]
screenshot

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/82d395e0-d108-47e6-adbe-e5ab47e1b519.lease
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/10.35.64.11:_vol_RHEV_Storage_storage__jenkins__ge5__nfs__0/5cf6dd4b-65db-413a-8226-95bac7ee9378/images/3e65a906-62e8-4c18-9b3b-2cef0b4c90bf/ce80aa84-d8b7-4ca3-883c-1e730916c7c0 (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/ce80aa84-d8b7-4ca3-883c-1e730916c7c0.lease
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">
<actual_size>3003183104</actual_size>
<format>raw</format>
<image_id>ce80aa84-d8b7-4ca3-883c-1e730916c7c0</image_id>
<provisioned_size>10737418240</provisioned_size>
<sparse>false</sparse>



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


How reproducible:
100%

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]
vdsm.log

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
Allon,
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.