Bug 1167668

Summary: [hosted-engine] [iSCSI support] The device that is being used by the engine's VM for the VM disk, and is listed as a direct LUN in the engine, is allowed to be removed from the setup
Product: Red Hat Enterprise Virtualization Manager Reporter: Elad <ebenahar>
Component: ovirt-hosted-engine-setupAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: acanan, amureini, ecohen, gklein, iheim, lsurette, sbonazzo, scohen, tnisan
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: org.ovirt.engine-root-3.5.0-25 Doc Type: Bug Fix
Doc Text:
Cause: Manipulating the LUN disk which contains the hosted engine may cause harm to the hosted engine and crash it. Consequence: HE may crash. Fix: Blocking the manipulation of the disk containing HE. Result: The LUN disk with the name "hosted_engine" cannot be moved, deleted or modified in any fashion.
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: 1164308, 1164311    
Attachments:
Description Flags
logs from the host and from the engine none

Description Elad 2014-11-25 09:27:31 UTC
Created attachment 961094 [details]
logs from the host and from the engine

Description of problem:
While testing the fix of https://bugzilla.redhat.com/show_bug.cgi?id=1157238, which adds Hosted Engine disk to the engine as direct lun in order to allow
the engine to know about the LUN used by Hosted engine, I checked if the LUN is allowed to be deleted from the setup and it does. 

Version-Release number of selected component (if applicable):
rhev 3.5 vt11
ovirt-hosted-engine-ha-1.2.4-1.el7.noarch
ovirt-hosted-engine-setup-1.2.1-4.el7ev.noarch


How reproducible:
Always

Steps to Reproduce:
1. Deploy hosted engine usind iSCSI storage
2. Once the hosted engine is up, access it and navigate to 'Disks' main tab. There should be the device which is being used by the engine's VM, it should be listed as a direct LUN 
3. Try to remove the device

Actual results:
Removing the device is allowed. 

2014-11-25 08:56:49,208 INFO  [org.ovirt.engine.core.bll.RemoveDiskCommand] (org.ovirt.thread.pool-7-thread-9) [40cbf672] Running command: RemoveDiskCommand internal: false. Entities affected :  ID: e8f0a0e7-3d81-45e4-a347-5ab04a5c7aea Type: DiskAction group DELETE_DISK with role type USER



Expected results:
Performing operations on this disk should not be allowed since this disk existence supposed to block user from doing operations like:

- import the hosted-engine's storage domain
- put the iSCSI domain in maintenance while the hosted-engine is installed on it
- pick the lun for storage domain creation/extension

Additional info:
logs from the host and from the engine

Comment 1 Allon Mureinik 2014-11-26 16:55:01 UTC
Sandro, how is the engine supposed to know which Direct LUN is the HE?

Comment 2 Sandro Bonazzola 2014-12-01 13:37:10 UTC
It has image alias 'hosted_engine'

Comment 3 Sandro Bonazzola 2014-12-01 13:37:38 UTC
For reference: http://gerrit.ovirt.org/34782

Comment 4 Allon Mureinik 2014-12-01 13:48:37 UTC
Seems like an easy fix then.
Tal, can we bang out a quick-and-dirty patch please?

Comment 5 Tal Nisan 2014-12-02 13:54:41 UTC
Done, not as dirty as you'd expect :)

Comment 6 Tal Nisan 2014-12-02 16:06:01 UTC
Btw, I considered doing a frontend patch that will grey out the edit/attach/remove on the HE disk but then I figured it might be confusing to the user since no explanation is given there and it's better in the rare case that someone tries to run an disallowed option to have a reason coming back from the engine

Comment 7 Allon Mureinik 2014-12-02 20:09:19 UTC
(In reply to Tal Nisan from comment #6)
> Btw, I considered doing a frontend patch that will grey out the
> edit/attach/remove on the HE disk but then I figured it might be confusing
> to the user since no explanation is given there and it's better in the rare
> case that someone tries to run an disallowed option to have a reason coming
> back from the engine
Agreed.
Einav - can you ack/nack this decision from a UX perspective?

Comment 8 Einav Cohen 2014-12-02 20:34:15 UTC
(In reply to Allon Mureinik from comment #7)
> (In reply to Tal Nisan from comment #6)
> > Btw, I considered doing a frontend patch that will grey out the
> > edit/attach/remove on the HE disk but then I figured it might be confusing
> > to the user since no explanation is given there and it's better in the rare
> > case that someone tries to run an disallowed option to have a reason coming
> > back from the engine
> Agreed.
> Einav - can you ack/nack this decision from a UX perspective?

ack - this is consistent with various other parts of the GUI.

Comment 11 Elad 2014-12-16 09:35:18 UTC
The direct LUN, used for identifying the hosted-engine disk, is not allowed to be removed/attached to VM

Remove: 

2014-12-16 09:26:08,668 WARN  [org.ovirt.engine.core.bll.RemoveDiskCommand] (ajp-/127.0.0.1:8702-4) [43487008] CanDoAction of action RemoveDisk failed. Reasons:VAR__ACTION__REMOVE,VAR__TYPE__VM_DISK,ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK

Attach to VM
2014-12-16 09:27:39,630 WARN  [org.ovirt.engine.core.bll.AttachDiskToVmCommand] (ajp-/127.0.0.1:8702-8) [47a7337b] CanDoAction of action AttachDiskToVm failed. Reasons:VAR__ACTION__ATTACH_ACTION_TO,VAR__TYPE__VM_DISK,ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK

Veirified using rhev 3.5 vt13.3
rhevm-3.5.0-0.25.el6ev.noarch
ovirt-hosted-engine-setup-1.2.1-7.el6ev.noarch

Comment 12 Allon Mureinik 2015-02-16 19:13:54 UTC
RHEV-M 3.5.0 has been released, closing this bug.

Comment 13 Allon Mureinik 2015-02-16 19:14:01 UTC
RHEV-M 3.5.0 has been released, closing this bug.