Bug 969641 - PRD34 - [RFE] Able to detach the ISO domain from the DataCenter though iso is attached and mounted in the VM
Summary: PRD34 - [RFE] Able to detach the ISO domain from the DataCenter though iso is...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.4.0
Assignee: Maor
QA Contact: Aharon Canan
URL:
Whiteboard: storage
Depends On: 1014039
Blocks: rhev3.4beta 1142926
TreeView+ depends on / blocked
 
Reported: 2013-06-01 09:17 UTC by Udayendu Sekhar Kar
Modified: 2018-12-05 16:05 UTC (History)
15 users (show)

Fixed In Version: av2
Doc Type: Enhancement
Doc Text:
Previously, you could put an ISO domain into maintenance even if there was an ISO image attached to a virtual machine. Now, attempting to put an ISO domain to maintenance while a virtual machine has an attached ISO image (not from Run-once) is blocked by an error message, and the operation is canceled.
Clone Of:
Environment:
Last Closed: 2014-06-09 14:59:29 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0506 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Virtualization Manager 3.4.0 update 2014-06-09 18:55:38 UTC
oVirt gerrit 20331 0 None MERGED core: Add a validation when deactivate ISO domain. 2020-10-21 08:35:48 UTC
oVirt gerrit 24462 0 None MERGED core: Add a validation when deactivate ISO domain. 2020-10-21 08:35:48 UTC

Description Udayendu Sekhar Kar 2013-06-01 09:17:51 UTC
Description of problem:
If an iso is attached to the VM and I am trying to detach the ISO domain from the DataCenter, I am able to do it successfully without any warning message.

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

How reproducible:
100%

Steps to Reproduce:
1. Attach an iso to a VM
2. Then remove the ISO domain from the DC
3. You should be able to detach it from the DC without any warning message

Actual results:
Able to detach the ISO domain without any warning message regarding the mounted iso on the VM.

Expected results:
It should pop-up an warning message like 'iso "XXXX" is still in use by the VM "YYYY"'. And should not allow to detach the ISO domain until the iso is attached to the VM.

Comment 1 Haim 2013-06-02 06:47:25 UTC
can we get engine + VDS logs (SOS)?

Comment 6 Maor 2013-07-09 08:29:12 UTC
We should add a warning message when deactivating the ISO storage domain

We should check if all the vms in the Data Center has empty path in the cdrom vm_device.
SELECT type,device,spec_params FROM vm_device where device='cdrom' and type='disk';

If the path is empty then we can detach the ISO domain, if not we should present a warning.

Take in notice that there is a bug that when user ejects the CD of the running VM, VDSM still reports the device is attached.

Comment 7 Maor 2013-07-10 07:17:42 UTC
Even when the ISO will be moved to maintenance the VM should still see the ISO path, since it is already mounted in the host.

Comment 8 Maor 2013-10-20 14:17:38 UTC
The fix prints an audit log when deactivating ISO domain, only if the VM uses this ISO file.
The indication whether the VM uses this is file is if in the DB the vm deivce of the disk of the floppy has a non-empty path.

Comment 9 Ayal Baron 2013-12-18 09:33:14 UTC
Maor, update on this? patch is stale upstream.

Comment 10 Maor 2013-12-18 09:48:48 UTC
Yes, I have talked with Omer yesterday about it, and this bug is actually blocked on another bug I'm looking at right now.
The other bug, is that VDSM reports the engine that the VM has still attached ISO file although the user has already removed the CD from the VM.

If we will block detaching ISO domain with a CDA, that will just make the user angry since from his perspective he already removed the ISO cd from the VM and still can't detach the ISO. 

So this could be handled in two ways:
1) We can use an audit log warning for now (as implemented in posted patch), so we won't block the user, until that bug will be fixed.
2) Find/Open the VDSM bug and just block it on this one. (ether way, there should be a bug on it)

Comment 11 Maor 2013-12-22 10:17:22 UTC
(In reply to Maor from comment #10)
> Yes, I have talked with Omer yesterday about it, and this bug is actually
> blocked on another bug I'm looking at right now.
> The other bug, is that VDSM reports the engine that the VM has still
> attached ISO file although the user has already removed the CD from the VM.
I have managed to check it with vdsm-4.12.0-131 and this bug did not reproduced,
So I'm changing the patch to use CDA validation instead or warnning.
> 
> If we will block detaching ISO domain with a CDA, that will just make the
> user angry since from his perspective he already removed the ISO cd from the
> VM and still can't detach the ISO. 
> 
> So this could be handled in two ways:
> 1) We can use an audit log warning for now (as implemented in posted patch),
> so we won't block the user, until that bug will be fixed.
> 2) Find/Open the VDSM bug and just block it on this one. (ether way, there
> should be a bug on it)

Comment 13 Maor 2014-02-06 08:30:24 UTC
Fix for BZ1014039 has been merged upstream, the bug is not longer blocked

Comment 15 Maor 2014-02-16 09:28:31 UTC
Keep in mind, there is still an issue when starting a VM with run once.
Since there is no persistence in the DB of the iso file. The current_cd in vm_dynamic should be changed when the VM is starting up.

Comment 16 Maor 2014-02-16 09:46:29 UTC
(In reply to Maor from comment #15)
> Keep in mind, there is still an issue when starting a VM with run once.
> Since there is no persistence in the DB of the iso file. The current_cd in
> vm_dynamic should be changed when the VM is starting up.
opened a bug https://bugzilla.redhat.com/1065719

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

Comment 18 Elad 2014-03-30 15:08:08 UTC
Putting ISO domain to maintenance while there is an ISO attached to VM (not from Run-once) is blocked with the following error message on UI:
	
Operation Canceled
Error while executing action: Cannot deactivate Storage. The ISO Storage Domain is being used by the following VMs: dc1-1.

CDA failure in engine.log:

2014-03-30 17:59:42,273 WARN  [org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand] (ajp-/127.0.0.1:8702-9) [254b18e2] CanDoAction of action DeactivateStorageDomain failed. Reasons:VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__DEACTIVATE,ERROR_CANNOT_DEACTIVATE_STORAGE_DOMAIN_WITH_ISO_ATTACHED,$VmNames dc1-1



============
Steps to reproduce:
On a shared DC with ISO domain attached and active:
1) Run a VM
2) 'Change CD' to the VM - attach an ISO to it
3) Put the ISO domain to maintenance
============

Still, due to: https://bugzilla.redhat.com/show_bug.cgi?id=1065719, putting ISO domain to maintenance while an ISO is attached to a VM from Run-once isn't blocked.


===========

Link to TCMS run:
https://tcms.engineering.redhat.com/run/123142/

Comment 19 errata-xmlrpc 2014-06-09 14:59:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0506.html


Note You need to log in before you can comment on or make changes to this bug.