Bug 1438691

Summary: Wrong calculation of initial size of disk when copying template disk from file Raw/Sparse to block Cow
Product: [oVirt] ovirt-engine Reporter: Fred Rolland <frolland>
Component: BLL.StorageAssignee: Fred Rolland <frolland>
Status: CLOSED CURRENTRELEASE QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: amureini, bugs, laravot, lveyde, tnisan
Target Milestone: ovirt-4.1.2Flags: rule-engine: ovirt-4.1+
Target Release: 4.1.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-23 08:12:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fred Rolland 2017-04-04 08:28:52 UTC
Description of problem:
The initial size of the destination volume when copying from file Raw/Sparse to block Cow is wrong, giving the provisioned size instead of the actual size.

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


How reproducible:
100%

Steps to Reproduce:
1. Move a raw/sparse disk not full to block/cow
2. 
3.

Actual results:
See that the volume is created with initial size as the provisioned and not the actual size.

Expected results:
See that the volume is created with initial size as the actual size.

Additional info:

Comment 1 Fred Rolland 2017-04-04 11:16:20 UTC
The scenario is create VM from template when the template disk is RAW on File system ( when the disk is not full) to QCOW on Block domain.

Comment 2 Kevin Alon Goldblatt 2017-04-27 14:46:54 UTC
Verified with the following code:
--------------------------------------


Verified with the following scenario:
--------------------------------------
1.Create a VM with a thin NFS disk 2gb (Raw/Sparse)
2.Create a Template of the VM and select the QCow/ISCSI for the target


Actual size of the target volume in the template is still displayed as the provisioned size of 2 instead of 1gb (minimum for iscsi thin

Moving to ASSIGNED!

Comment 3 Red Hat Bugzilla Rules Engine 2017-04-27 14:47:00 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 4 Fred Rolland 2017-05-03 13:03:43 UTC
I tested on 4.1.2 and looks OK.
Please retest. Thanks !!

Comment 5 Kevin Alon Goldblatt 2017-05-07 13:57:54 UTC
Verified with the following code:
--------------------------------------
ovirt-engine-4.1.2.1-0.1.el7.noarch
rhevm-4.1.2.1-0.1.el7.noarch
vdsm-4.19.12-1.el7ev.x86_64


Verified with the following scenario:
--------------------------------------
1.Create a VM with a thin NFS disk 2gb (Raw/Sparse)
2.Create a Template of the VM and select the RAW / NFS for the target > Virtual is 2 Actual is < 1
3.Create new VM from the Template and select the target as QCow / Block > Virtual is 2 and Actual is 1 as expected


Actual size of the target volume in the template is NOW CORRECTLY calculated and  displayed

Moving to VERIFIED!