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.
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.
We started importing the domain in 3.6, just fyi.
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.