Bug 1402789

Summary: Engine - Prevent deactivation of hosted engine storage domain
Product: Red Hat Enterprise Virtualization Manager Reporter: Nir Soffer <nsoffer>
Component: ovirt-engineAssignee: Tal Nisan <tnisan>
Status: CLOSED ERRATA QA Contact: Nikolai Sednev <nsednev>
Severity: urgent Docs Contact:
Priority: high    
Version: 4.0.6CC: alitke, amureini, bazulay, bugs, eedri, gklein, lsurette, mgoldboi, mkalinin, nashok, nsednev, nsoffer, ratamir, rbalakri, Rhev-m-bugs, sbonazzo, srevivo, tnisan, ycui, ykaul, ylavi
Target Milestone: ovirt-4.1.0-betaKeywords: Regression, Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard: hosted-engine
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1398822 Environment:
Last Closed: 2017-04-25 00:49:08 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: 1401540    

Comment 1 Nir Soffer 2016-12-08 11:11:59 UTC
This bug was opened as vdsm bug 1398822, but the root cause is ovirt-engine bug.

ovirt-engine must not deactivate the hosted engine storage domain it is running
on. Deactivating the storage domain will lead to killing the hosted engine vm.

Comment 3 Nir Soffer 2016-12-14 06:34:06 UTC
This is a regression from earlier versions. In the past the hosted engine storage
domain was not visible in engine, so engine could not deactivate it. In version
4.0(?) we started to import the hosted engine storage domain into engine. All
the storage flows must avoid deactivation of the hosted engine storage domain.

Note that recent fix in vdsm (bug 1398822) hides this issue - even if hosted
engine storage domain is deactivated, sanlock does not kill the owner of the
leases in the storage domain. This means sanlock is accessing an inactive
storage domain, which may lead to various failures later, and is not supported.

Comment 5 Martin Sivák 2016-12-14 10:52:14 UTC
We started importing the domain in 3.6, just fyi.

Comment 8 Nikolai Sednev 2017-01-24 16:05:19 UTC
Works for me on these components on engine:
Red Hat Virtualization Manager Version: 4.1.0.1-0.1.el7 
rhev-guest-tools-iso-4.1-3.el7ev.noarch
rhevm-doc-4.1.0-1.el7ev.noarch
rhevm-dependencies-4.1.0-1.el7ev.noarch
rhevm-setup-plugins-4.1.0-1.el7ev.noarch
rhevm-4.1.0.1-0.1.el7.noarch
rhevm-guest-agent-common-1.0.12-3.el7ev.noarch
rhevm-branding-rhev-4.1.0-0.el7ev.noarch
Linux version 3.10.0-514.6.1.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Sat Dec 10 11:15:38 EST 2016
Linux 3.10.0-514.6.1.el7.x86_64 #1 SMP Sat Dec 10 11:15:38 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.3 (Maipo)

On host:
rhvm-appliance-4.1.20170119.1-1.el7ev.noarch
ovirt-imageio-common-0.5.0-0.el7ev.noarch
ovirt-host-deploy-1.6.0-1.el7ev.noarch
ovirt-vmconsole-1.0.4-1.el7ev.noarch
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64
ovirt-vmconsole-host-1.0.4-1.el7ev.noarch
rhev-release-4.0.6-1-001.noarch
ovirt-engine-sdk-python-3.6.9.1-1.el7ev.noarch
mom-0.5.8-1.el7ev.noarch
vdsm-4.19.2-2.el7ev.x86_64
libvirt-client-2.0.0-10.el7_3.4.x86_64
sanlock-3.4.0-1.el7.x86_64
ovirt-hosted-engine-setup-2.1.0-2.el7ev.noarch
ovirt-imageio-daemon-0.5.0-0.el7ev.noarch
ovirt-hosted-engine-ha-2.1.0-1.el7ev.noarch
ovirt-setup-lib-1.1.0-1.el7ev.noarch
Linux version 3.10.0-514.6.1.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Sat Dec 10 11:15:38 EST 2016
Linux 3.10.0-514.6.1.el7.x86_64 #1 SMP Sat Dec 10 11:15:38 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.3 (Maipo)

1-Deployed HE over iSCSI.
2-Added single NFS data storage domain.
3-Got hosted-storage auto-imported.
4-Tried to set hosted-storage in to the maintenance and received error as appears below:
Operation Canceled
Error while executing action: Cannot deactivate Storage. The storage selected contains the self hosted engine.

Moving to verified.