Bug 1098773

Summary: Building vm from template throws "Exception: VDSGenericException: VDSErrorException" if the template was create RawSparse on NFS and was copied to ISCSI domain
Product: Red Hat Enterprise Virtualization Manager Reporter: Ori Gofen <ogofen>
Component: ovirt-engineAssignee: Vered Volansky <vered>
Status: CLOSED CURRENTRELEASE QA Contact: Ori Gofen <ogofen>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: acanan, amureini, gklein, iheim, lpeer, rbalakri, Rhev-m-bugs, scohen, tnisan, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: ovirt-engine-3.5.0_alpha1.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 960934    

Description Ori Gofen 2014-05-18 10:35:09 UTC
Description of problem:

When coping a template that was create as raw sparse on NFS to ISCSI domain,it is actually creating a raw preallocated template (BZ #1098258),therefore,the operation of creating vm with thin provision disk from template is aloud by ovirt-engine in the case of an iscsi domain which has free space that is less than disks actual size, but it fails (with termination of "VDSErrorException") sense there is not enough space for the completion of the command


Version-Release number of selected component (if applicable):
vdsm-4.14.7-2.el6ev.x86_64
rhevm-3.4.0-0.20.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:

Setup:have a dc with 2 domains of each kind(1 NFS,1ISCSI)

1.create vm+thin provision disk on NFS,make a template out of this vm
2.copy template to ISCSI domain and make sure-> 
{disks actual size} > {ISCSI's free space} > {3giga}
3.create vm from template (mark it thin provision on ISCSI domain)

Actual results:
operation fails from vdsm logs:

ERROR::2014-05-18 12:58:16,790::image::736::Storage.Image::(copyCollapsed) Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/image.py", line 731, in copyCollapsed
    dstVol.extend(newsize)
  File "/usr/share/vdsm/storage/blockVolume.py", line 272, in extend
    lvm.extendLV(self.sdUUID, self.volUUID, sizemb)
  File "/usr/share/vdsm/storage/lvm.py", line 1151, in extendLV
    _resizeLV("lvextend", vgName, lvName, size)
  File "/usr/share/vdsm/storage/lvm.py", line 1145, in _resizeLV
    free_size / constants.MEGAB))

from ovirt-engine logs:

2014-05-18 12:58:25,128 ERROR [org.ovirt.engine.core.bll.SPMAsyncTask] (DefaultQuartzScheduler_Worker-80) BaseAsyncTask::LogEndTaskFailure: Task a63ba93d-505a-4cfe-b860-4a3bb45d50c7 (Parent Command AddVmFromTemplate, Parameters Type org.ovirt.engine.core.common asynctasks.AsyncTaskParameters) ended with failure:
 - Result: cleanSuccess
-- Message: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTa ksStatusesVDS, error = Volume Group not big enough,
-- Exception: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTasksStatusesVDS, error = Volume Group not big enough 


Expected results:
operation should succeed

Additional info:

Comment 1 Allon Mureinik 2014-05-18 13:22:07 UTC
Generally speaking, we're lacking proper space validation for this scenario, regardless of the move from file to block.

Comment 2 Vered Volansky 2014-05-20 11:32:35 UTC
This issue should be solved in 3.5.0, in the above patches.

Comment 3 Ori Gofen 2014-07-08 11:04:32 UTC
verified on alpha2,an error message pops up

Comment 4 Allon Mureinik 2015-02-16 19:12:34 UTC
RHEV-M 3.5.0 has been released, closing this bug.

Comment 5 Allon Mureinik 2015-02-16 19:12:35 UTC
RHEV-M 3.5.0 has been released, closing this bug.