Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 828334

Summary: webadmin: create template is sent to vdsm even though there is not enough disk space on target domain
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: Gilad Chaplik <gchaplik>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: medium Docs Contact:
Priority: low    
Version: 3.1.0CC: abaron, amureini, dfediuck, dyasny, ecohen, hateya, iheim, lpeer, mkenneth, Rhev-m-bugs, yeylon, ykaul
Target Milestone: ---Keywords: Regression
Target Release: 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: si16 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:
Attachments:
Description Flags
logs none

Description Dafna Ron 2012-06-04 16:01:55 UTC
Description of problem:

we send create template commands to the vdsm even when there is not enough disk space in the target domain. 
we need to block this commands in an earlier stage like we do for CreateVmFromTemplateCommand. 

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

si4

How reproducible:

100%

Steps to Reproduce:
1. create a 100GB domain
2. create a vm with 60GB preallocated disk
3. try to create a template from the vm 
  
Actual results:

the command is sent to vdsm and rolled back. 

Expected results:

we should block the command either in webadmin or with CanDoAction in backend. 

Additional info: logs


eca01d0c-348b-4f2b-bfb3-5d710eb22e67::ERROR::2012-06-01 18:33:05,264::task::853::TaskManager.Task::(_setError) Task=`eca01d0c-348b-4f2b-bfb3-5d710eb22e67`::Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 861, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/storage/task.py", line 320, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/share/vdsm/storage/securable.py", line 63, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/vdsm/storage/sp.py", line 1624, in copyImage
    volType, volFormat, preallocate, postZero, force)
  File "/usr/share/vdsm/storage/image.py", line 835, in copy
    dstVol.extend(newsize)
  File "/usr/share/vdsm/storage/blockVolume.py", line 356, in extend
    lvm.extendLV(self.sdUUID, self.volUUID, sizemb)
  File "/usr/share/vdsm/storage/lvm.py", line 1021, in extendLV
    raise se.VolumeGroupSizeError("%s/%s %d > %d (MiB)" % (vgName, lvName, int(size), free_size / constants.MEGAB))
VolumeGroupSizeError: Volume Group not big enough: ('3bf28e38-9a83-4b31-9580-72cf8ea39a4c/c154a959-3629-4952-902c-363f28149515 40960 > 34432 (MiB)',)
eca01d0c-348b-4f2b-bfb3-5d710eb22e67::DEBUG::2012-06-01 18:33:05,265::task::872::TaskManager.Task::(_run) Task=`eca01d0c-348b-4f2b-bfb3-5d710eb22e67`::Task._run: eca01d0c-348b-4f2b-bfb3-5d710eb22e67 () {} failed - stopping task
eca01d0c-348b-4f2b-bfb3-5d710eb22e67::DEBUG::2012-06-01 18:33:05,265::task::1199::TaskManager.Task::(stop) Task=`eca01d0c-348b-4f2b-bfb3-5d710eb22e67`::stopping in state running (force False)
eca01d0c-348b-4f2b-bfb3-5d710eb22e67::DEBUG::2012-06-01 18:33:05,266::task::978::TaskManager.Task::(_decref) Task=`eca01d0c-348b-4f2b-bfb3-5d710eb22e67`::ref 1 aborting True
eca01d0c-348b-4f2b-bfb3-5d710eb22e67::DEBUG::2012-06-01 18:33:05,266::task::903::TaskManager.Task::(_runJobs) Task=`eca01d0c-348b-4f2b-bfb3-5d710eb22e67`::aborting: Task is aborted: 'Volume Group not big enough' - code 504


2012-06-01 18:27:09,400 ERROR [org.ovirt.engine.core.bll.SPMAsyncTask] (QuartzScheduler_Worker-25) BaseAsyncTask::LogEndTaskFailure: Task 7ab19ef3-9b1a-4d79-a400-2427bd52eed2 (Parent Command AddVmTemplate, Parameters Type org.ovirt.engin
e.core.common.asynctasks.AsyncTaskParameters) ended with failure:
-- Result: cleanSuccess
-- Message: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTasksStatusesVDS, error = Volume Group not big enough,
-- Exception: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTasksStatusesVDS, error = Volume Group not big enough
2012-06-01 18:27:09,404 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (QuartzScheduler_Worker-25) EntityAsyncTask::EndActionIfNecessary: All tasks of entity 529bdbfc-0e7b-404a-ba04-22c0e3cbc3d0 has ended -> executing EndAction
2012-06-01 18:27:09,406 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (QuartzScheduler_Worker-25) EntityAsyncTask::EndAction: Ending action for 1 tasks (entity ID: 529bdbfc-0e7b-404a-ba04-22c0e3cbc3d0): calling EndAction for action t
ype AddVmTemplate.
2012-06-01 18:27:09,407 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-10-thread-45) EntityAsyncTask::EndCommandAction [within thread]context: Attempting to EndAction AddVmTemplate
2012-06-01 18:27:09,571 ERROR [org.ovirt.engine.core.bll.AddVmTemplateCommand] (pool-10-thread-45) [55c8cc6e] Ending command with failure: org.ovirt.engine.core.bll.AddVmTemplateCommand

Comment 1 Dafna Ron 2012-06-04 16:03:49 UTC
Created attachment 589197 [details]
logs

Comment 3 Haim 2012-06-04 17:06:53 UTC
Dafna, why this is a vdsm bug and not a backend? imho, this should fail in the can_do_action that calculates free space on dest storage domain.

Comment 6 Gilad Chaplik 2012-08-21 09:29:02 UTC
pushed upstream (http://gerrit.ovirt.org/7367)

Comment 9 Dafna Ron 2012-09-02 09:05:45 UTC
verified on si16 - we get a CanDoAction 

2012-09-02 11:53:05,062 WARN  [org.ovirt.engine.core.bll.AddVmTemplateCommand] (ajp-/127.0.0.1:8009-7) [2e316857] CanDoAction of action AddVmTemplate failed. Reasons:VAR__ACTION__ADD,VAR__TYPE__VM_TEMPLATE,ACTION_TYPE_FAILED_DISK_SPACE_LOW