Bug 975114

Summary: engine: no CanDoAction for creating vm from snapshot when snapshot has a disk on a maintenance domain
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: acathrow, amureini, derez, ebenahar, iheim, jkt, lpeer, Rhev-m-bugs, scohen, sgotliv, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: ovirt-3.4.0-beta3 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: 1078909, 1142926    
Attachments:
Description Flags
logs none

Description Dafna Ron 2013-06-17 16:15:22 UTC
Created attachment 762099 [details]
logs

Description of problem:

I tried cloning a vm from a snapshot that has a disk on a domain in maintenance. 
the command is not blocked by engine and sent to vdsm 

although the command fails in vdsm on low level Image copy failed the error user gets in UI is: 

Error while executing action AddVmFromSnapshot: Error creating a new volume

also, in other commands (like preview) there is an engine CanDoAction.

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

sf18

How reproducible:

100%

Steps to Reproduce:
1. create two storage domains
2. create a vm with 2 disks, one disk on each domain
3. create a snapshot for the vm
4. put one of the domains in maintenance
5. clone a vm from the snapshot

Actual results:

the command is not blocked by CanDoAction and sent to vdsm
when it fails we get the following error in UI: 

Error while executing action AddVmFromSnapshot: Error creating a new volume

Expected results:

engine needs to add a CanDoAction 

Additional info: logs

2013-06-17 19:08:16,623 ERROR [org.ovirt.engine.core.bll.SPMAsyncTask] (QuartzScheduler_Worker-34) BaseAsyncTask::LogEndTaskFailure: Task 1b5040a0-bfe3-44af-993e-410410f0de75 (
Parent Command AddVmFromSnapshot, Parameters Type org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters) ended with failure:
-- Result: cleanSuccess
-- Message: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTasksStatusesVDS, error = 1b5040a0-bfe3-44af-993e-410410f0de75,
-- Exception: VDSGenericException: VDSErrorException: Failed in vdscommand to HSMGetAllTasksStatusesVDS, error = 1b5040a0-bfe3-44af-993e-410410f0de75
2013-06-17 19:08:16,623 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (QuartzScheduler_Worker-34) EntityAsyncTask::EndActionIfNecessary: All tasks of entity acd56356-fd0b-4
e31-ac07-ef88087e07a4 has ended -> executing EndAction


1b5040a0-bfe3-44af-993e-410410f0de75::ERROR::2013-06-17 19:08:11,970::task::850::TaskManager.Task::(_setError) Task=`1b5040a0-bfe3-44af-993e-410410f0de75`::Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 857, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/storage/task.py", line 318, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/share/vdsm/storage/securable.py", line 68, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/vdsm/storage/sp.py", line 1708, in copyImage
    volType, volFormat, preallocate, postZero, force)
  File "/usr/share/vdsm/storage/image.py", line 878, in copy
    raise se.CopyImageError("src image=%s, dst image=%s: msg=%s" % (srcImgUUID, dstImgUUID, str(e)))

Comment 1 Elad 2014-02-17 15:59:41 UTC
Unable to clone a VM from a snapshot of VM which has one of its disks located on an inactive storage domain. I'm getting a CDA:
2014-02-17 17:51:43,067 WARN  [org.ovirt.engine.core.bll.AddVmFromSnapshotCommand] (ajp-/127.0.0.1:8702-8) CanDoAction of action AddVmFromSnapshot failed. Reasons:VAR__ACTION__ADD,VAR__TYPE__VM,ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2,Maintenance


Verified on RHEV3.4-av1
rhevm-3.4.0-0.2.master.el6ev.noarch

Comment 2 Sandro Bonazzola 2014-02-19 12:26:51 UTC
This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA

Comment 4 Itamar Heim 2014-06-12 14:08:56 UTC
Closing as part of 3.4.0