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
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
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