Bug 1187794 - "Ejecting" an ISO in the Admin Portal fails, but if you mount the same ISO it "Unmounts" the ISO from the guest
Summary: "Ejecting" an ISO in the Admin Portal fails, but if you mount the same ISO it...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Shmuel Melamud
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On: 1289069
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-30 21:00 UTC by Bill Sanford
Modified: 2016-08-24 19:27 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-20 01:31:33 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Libvirt debug log (9.49 MB, text/plain)
2015-04-27 15:27 UTC, Bill Sanford
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 626305 0 urgent CLOSED [vdsm] [libvirt] RFE - libvirt should allow user to ask for force eject 2021-02-22 00:41:40 UTC
oVirt gerrit 38357 0 master MERGED engine: Do not change CD to the same ISO 2020-09-18 14:49:13 UTC

Internal Links: 626305

Description Bill Sanford 2015-01-30 21:00:44 UTC
Description of problem:
With a Linux guest, when applying the ChangeCD list in RHEV-M, you can add and change CDs (ISOs), but when you try to "Eject" them from the ChangeCD menu, the CDs (ISOs) stay mounted. It does not show a message that you need to unmount it locally on the Linux guest.

When you try to "ChangeCD" to the same one currently mounted in the Linux guest, you get an error message about Using <Eject> from the ChangeCD drop-down for Windows guests, using the unmount command for Linux guests and then the ChangeCD action unmounts the ISO from the guest.

Version-Release number of selected component (if applicable):
RHEV-M 3.5 (vt13.8/el6/)
RHEL-7.1-20150122.0 (snap 4) client
virt-viewer-0.6.0-12-el7

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
If you mount the same ISO in the Admin Portal that is on the Linux guest, it shows an error dialog box and dismounts the ISO.

Expected results:
If you mount the same ISO in the Admin Portal that is on the Linux guest, it should either mount it like it is not mounted, or display a message that it is already mounted.

Additional info:

Comment 1 Shmuel Melamud 2015-03-02 23:05:20 UTC
I agree that if user tries to change disk to the same ISO that is already mounted, nothing should happen. The current behaviour is incorrect.

But my observations of the current behaviour differ in details from your description. I see the following:

1. When I'm ejecting a CD that's mounted in a guest OS, it is ejected without any message. In web interface the disk displayed as ejected. In the guest OS it still displayed as mounted, but not readable.

2. When I'm changing a CD to the same ISO that was previously mounted in the guest OS, it is ejected without any message. In web interface the disk is still the same. In the guest OS it still displayed as mounted, but not readable.

3. The message saying that you need to unmount the CD in the guest OS is displayed when some other error occurs, for example, when ISO file is not accessible.

Can you please repeat again the scenarios that you've described? In what case you get the error message? If it appears, what you see in the web interface, in the guest OS? Is ISO file accessible?

Comment 2 Bill Sanford 2015-03-04 20:07:03 UTC
I retested a Windows 7 VM and a RHEL 7.1 VM. The Windows VM behaves as expected. The RHEL 7.1 VM still behaves badly.

(1) When you try to "ChangeCD" of a RHEL 7.1 guest a new ISO (Not eject) for the guest, the RHEL VM behaves as expected.

(2) When you try to "ChangeCD" of a RHEL 7.1 guest to any other ISO (Not eject), you get an error message:

Operation Canceled - Dialog box title

Error while executing action Change CD: Failed to perform "Change CD" operation, CD might be still in use by the VM.
Please try to manually detach the CD from withing the VM:
1. Log in to the VM
2 For Linux VMs, un-mount the CD using umount command;
For Windows VMs, right click on the CD drive and click 'Eject';

(3) You can dismount any ISO on the RHEL 7 VM by the umount command or right-click from the VM icon of the ISO.

(4) When you try to "ChangeCD" of a RHEL 7.1 guest to eject the ISO on the RHEL 7 VM, the "Change CD" dialog box closes and the CD is NOT unmounted from the RHEL guest.

Comment 3 Bill Sanford 2015-03-05 20:24:21 UTC
Forgot to add in #2 when you have all that happen, then the CD currently in the VM, gets ejected, anyway.

Comment 4 Bill Sanford 2015-03-13 18:14:13 UTC
I added an ISO with no issue the first time. When I added the same ISO the second time, I got the error I described in comment 2, part 2. 

Here is the tail -f vdsm.log:

http://pastebin.test.redhat.com/269675

Comment 5 Shmuel Melamud 2015-03-15 10:07:52 UTC
(In reply to Bill Sanford from comment #4)

> http://pastebin.test.redhat.com/269675

Sorry, I don't see anything in the pastebin. Is URL correct?

Comment 6 Bill Sanford 2015-03-23 15:25:38 UTC
http://pastebin.test.redhat.com/271458 should have the log file tail you need.

Comment 7 Shmuel Melamud 2015-03-24 12:46:42 UTC
(In reply to Bill Sanford from comment #6)

Thanks, now I see it. And I see very strange thing here - QEMU returns error that device is locked regardless of libvirt.VIR_DOMAIN_DEVICE_MODIFY_FORCE flag. This shouldn't happen and this shows another bug may be here.

Do you have libvirt log for this run? This would help a much. And also, to be sure, what version of libvirt do you use?

Comment 8 Bill Sanford 2015-03-24 15:05:59 UTC
[root@giediprime ~]# rpm -qa | grep libvirt
libvirt-0.10.2-46.el6_6.3.x86_64
libvirt-client-0.10.2-46.el6_6.3.x86_64
libvirt-lock-sanlock-0.10.2-46.el6_6.3.x86_64
libvirt-python-0.10.2-46.el6_6.3.x86_64

Comment 9 Bill Sanford 2015-03-24 15:24:46 UTC
The libvirt log on the host showed this:

2015-03-24 15:20:27.634+0000: 11513: error : virDomainObjGetMetadata:16665 : metadata not found: Requested metadata element is not present
2015-03-24 15:20:41.386+0000: 11516: error : qemuMonitorJSONCheckError:359 : internal error unable to execute QEMU command 'change': Device 'drive-ide0-1-0' is locked
2015-03-24 15:20:42.061+0000: 11515: error : virDomainObjGetMetadata:16665 : metadata not found: Requested metadata element is not present

Comment 10 Shmuel Melamud 2015-03-24 15:43:27 UTC
Can you please run it again with debug logging in libvirt on?

Comment 11 Bill Sanford 2015-04-27 15:27:52 UTC
Created attachment 1019357 [details]
Libvirt debug log

Comment 12 Xuesong Zhang 2015-11-20 07:15:55 UTC
hi, 

I'm the QE from libvirt team, we can reproduce your scenario with libvirt, this issue is fixed in RHEL7.2 in BZ 1147471, seems need to be fixed in RHEL6.8 also. It only depend on the libvirt version in registered host, not the guest os version, will not reproduce this scenarios with RHEL7.2 host.

@eblake

I'd like to clone BZ 1147471 to RHEL6.8 since it cause some scenarios of RHEVM failed, is it ok?

Following are the details:
Scenarios: existing an iso in guest, change cd to another iso, need to execute twice command "change-media" on RHEL6 host, the 1st time is open the tray, the 2nd time is change the media.

1. change-media 1st time to open the tray
# virsh change-media guest sda  /tmp/a.iso --insert
error: Failed to complete action insert on media
error: internal error: unable to execute QEMU command 'eject': Device 'drive-scsi0-0-0-0' is locked

2. change-media 2nd time to change the iso file.
# virsh change-media guest sda  /tmp/a.iso --insert
Successfully inserted media.

domain xml : 

1. guest xml with a cdrom device.
<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/rhev/data-center/mnt/10.66.5.165:_home_nfs_iso/a4c2d6a2-6338-469d-bf38-2a3ba633b09e/images/11111111-1111-1111-1111-111111111111/Windows_Server_2008_R2_RC_EN.iso' startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>

2. do change media at the first time. tray open
<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/rhev/data-center/mnt/10.66.5.165:_home_nfs_iso/a4c2d6a2-6338-469d-bf38-2a3ba633b09e/images/11111111-1111-1111-1111-111111111111/Windows_Server_2008_R2_RC_EN.iso' startupPolicy='optional'/>
      <target dev='hdc' bus='ide' tray='open'/>   < ======== tray open
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>

3.do change media second time, media changed, no tray again.
<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/rhev/data-center/mnt/10.66.5.165:_home_nfs_iso/a4c2d6a2-6338-469d-bf38-2a3ba633b09e/images/11111111-1111-1111-1111-111111111111/en_windows_7_ultimate_x64_dvd_x15-65922.iso' startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>

Comment 13 Michal Skrivanek 2015-12-07 12:41:23 UTC
Since this is a host-side fix we don't need RHEL 6. The bug is targeted to 3.6 where RHEL6 hosts are dropped, so we're fine with having the fix only in RHEL 7.2

Comment 14 Xuesong Zhang 2015-12-07 12:52:38 UTC
(In reply to Michal Skrivanek from comment #13)
> Since this is a host-side fix we don't need RHEL 6. The bug is targeted to
> 3.6 where RHEL6 hosts are dropped, so we're fine with having the fix only in
> RHEL 7.2

hi, Michal

We can not reproduce this bug with RHEL7.2 host, only can reproduce this bug with RHEL6.y. Would you please double check and let me know if you can meet this issue with RHEL7.2 host?

Comment 15 Israel Pinto 2015-12-08 07:26:27 UTC
I tested it with guest Fedora 23, and host 7.2

Comment 16 Xuesong Zhang 2015-12-08 09:11:03 UTC
(In reply to Israel Pinto from comment #15)
> I tested it with guest Fedora 23, and host 7.2

hi, Israel,

Would you please lend me your env for future debugging? it's strange that we can not reproduce with rhel7.2 host in our rhevm env.

Comment 17 Israel Pinto 2015-12-08 09:24:12 UTC
sent setup details via mail

Comment 19 Israel Pinto 2016-02-28 09:37:52 UTC
Verify with:
RHEVM: 3.6.3.2-0.1.el6
Host;
OS Version:RHEL - 7.2 - 9.el7_2.1
Kernel Version:3.10.0 - 327.10.1.el7.x86_64
KVM Version:2.3.0 - 31.el7_2.7
LIBVIRT Version:libvirt-1.2.17-13.el7_2.3
VDSM Version:vdsm-4.17.21-0.el7ev
Guest:
redhat-release: Red Hat Enterprise Linux Server release 7.2 (Maipo)
Info: 3.10.0-327.el7.x86_64 x86_64 x86_64 GNU/Linux


Scenario:
1. Attached CD to VM with OS with 'run once'.
2. Check that disk is attached:  
#find / -name Fedora*
/dev/disk/by-label/Fedora-S-21-x86_64
3. Monut disk:
# mount /dev/disk/by-label/Fedora-S-21-x86_64 /mnt/disk_1/
4. Check disk content:
# ll /mnt/disk_1/
total 20
drwxrwsr-x.  3 root 101737 2048 Dec  3  2014 EFI
drwxrwsr-x.  3 root 101737 2048 Dec  3  2014 images
drwxrwsr-x.  2 root 101737 4096 Dec  3  2014 isolinux
drwxrwsr-x.  2 root 101737 2048 Dec  3  2014 LiveOS
drwxrwsr-x. 29 root 101737 4096 Dec  3  2014 Packages
drwxrwsr-x.  2 root 101737 4096 Dec  3  2014 repodata
-r--r--r--.  1 root root   1753 Dec  3  2014 TRANS.TBL
5. Eject CD from RHEVM GUI:
  Disk successfully ejected
6. Check that the disk is not mounted 
   ll  /mnt/disk_1/ 
   total 0
7. Check that re-attach of the same disk, need remount.  
Check pass


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