Bug 969770

Summary: engine: cannot deactivate a domain when it has an inactive disk attached to a running vm
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: Allon Mureinik <amureini>
Status: CLOSED DUPLICATE QA Contact: Aharon Canan <acanan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: abaron, acathrow, amureini, ebenahar, iheim, jkt, lpeer, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-26 17:55:31 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:
Bug Depends On:    
Bug Blocks: 1078909, 1142926    
Attachments:
Description Flags
logs none

Description Dafna Ron 2013-06-02 09:49:55 UTC
Created attachment 755792 [details]
logs

Description of problem:

I wanted to put a domain in maintenance when it has a disk attached to a running vm and disk is deactivate ->  I get a CanDoAction. 
however we can attach an inactive disk to a running vm when the domain is in maintenance. 

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

sf17.2

How reproducible:

100%

Steps to Reproduce:
1. create a vm with two disks located on different domains
2. deactivate the second disk (not the boot disk) 
3. try to put the domain in maintenance
4. detach the disk
5. put the domain in maintenance
6. attach the disk as inactive
7. activate the domain
8. deactivate the doamin

Actual results:

we cannot put a domain in maintenance because of running vms even when the disk on it is inactive
we can however attach a disk as inactive to a vm while the domain is in maintenance. 

Expected results:

we should succeed to put the domain in maintenance if the disk is inactive

Additional info: logs

Comment 1 Alissa 2013-07-09 09:27:07 UTC
The relevant backend command is DeactivateStorageDomainCommand.
The canDoAction (as described above) checks if there are active VMs.
It looks like for all active VMs need to add a check whether the disk is indeed inactive - and then not to fail canDoAction.

Comment 2 Allon Mureinik 2014-02-17 13:23:00 UTC
*** Bug 1065747 has been marked as a duplicate of this bug. ***

Comment 3 Allon Mureinik 2014-02-26 17:55:31 UTC
bug 1065747 and this one describe the same issue. I've reopened 1065747 and closed this one as the oVirt gerrit hooks require an oVirt bug and not a RHEV one.

*** This bug has been marked as a duplicate of bug 1065747 ***