Bug 1057969

Summary: vdsm: cannot start a vm in read only with IDE disk type
Product: Red Hat Enterprise Virtualization Manager Reporter: Sean Cohen <scohen>
Component: vdsmAssignee: Sergey Gotliv <sgotliv>
Status: CLOSED ERRATA QA Contact: Aharon Canan <acanan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, adahms, bazulay, dron, gklein, iheim, knesenko, lnatapov, lpeer, mgoldboi, sbonazzo, sgotliv, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: ovirt-3.4.0-beta3 Doc Type: Bug Fix
Doc Text:
Previously, it was possible to specify the 'Read Only' option for disks that used the IDE interface and were attached to virtual machines. This prevented virtual machines with this setting enabled from starting due to an exception in libvirt. Now, it is no longer possible to specify this option for disks using the IDE interface.
Story Points: ---
Clone Of: 1057546 Environment:
Last Closed: 2014-06-09 13:28:11 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:
Bug Depends On: 1057546    
Bug Blocks: 1078909, 1142926    

Description Sean Cohen 2014-01-26 08:57:46 UTC
+++ This bug was initially created as a clone of Bug #1057546 +++

Description of problem:

we cannot start a vm with IDE disk+read-only. 

This looks like it might fail in libvirt. 

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

[root@cougar06 ~]# rpm -qa |grep libvirt 
[root@cougar06 ~]# rpm -qa |grep vdsm
[root@cougar06 ~]# rpm -qa |grep qemu
[root@cougar06 ~]# 

How reproducible:


Steps to Reproduce:
1. create a vm with IDE disk and read-only
2. start it

Actual results:

we fail to start the vm

Expected results:

we should either fail in Engine with CanDoAction or support this. 

Additional info:

Thread-37694::ERROR::2014-01-24 12:16:02,114::vm::2273::vm.Vm::(_startUnderlyingVm) vmId=`a895a0db-e35a-47a5-b019-9ebfc0033545`::The vm start process failed
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 2233, in _startUnderlyingVm
  File "/usr/share/vdsm/vm.py", line 3164, in _run
    self._connection.createXML(domxml, flags),
  File "/usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py", line 92, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2665, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: internal error process exited while connecting to monitor: qemu-kvm: -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Can't use a read-only drive
qemu-kvm: -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Device 'ide-drive' could not be initialized

.SimpleLogAdapter instance at 0x7fa9fc1507e8> name:hdc networkDev:False path: readonly:true reqsize:0 serial: shared:false specParams:{'path': ''} transientDisk:False truesize:0 type:disk volExtensionChunk:1024 watermarkLimit:536870912
Traceback (most recent call last):
  File "/usr/share/vdsm/clientIF.py", line 326, in teardownVolumePath
    res = self.irs.teardownImage(drive['domainID'],
  File "/usr/share/vdsm/vm.py", line 1493, in __getitem__
    raise KeyError(key)
KeyError: 'domainID'
Thread-37770::INFO::2014-01-24 12:17:54,287::logUtils::44::dispatcher::(wrapper) Run and protect: teardownImage(sdUUID='be5731ac-ce60-4302-ab04-99573f6799e4', spUUID='6fe33247-68e1-4e46-be2a-ab90ab4384e3', imgUUID='76297de9-4ac8-4822-b1df-58dbc36da7b6', volUUID=None)
Thread-37770::INFO::2014-01-24 12:17:54,288::logUtils::47::dispatcher::(wrapper) Run and protect: teardownImage, Return response: None
Thread-37770::INFO::2014-01-24 12:17:54,291::logUtils::44::dispatcher::(wrapper) Run and protect: inappropriateDevices(thiefId='a895a0db-e35a-47a5-b019-9ebfc0033545')
Thread-37770::INFO::2014-01-24 12:17:54,300::logUtils::47::dispatcher::(wrapper) Run and protect: inappropriateDevices, Return response: None
Thread-37770::DEBUG::2014-01-24 12:17:54,300::vm::4609::vm.Vm::(deleteVm) vmId=`a895a0db-e35a-47a5-b019-9ebfc0033545`::Total desktops after destroy of a895a0db-e35a-47a5-b019-9ebfc0033545 is 0
Thread-37770::DEBUG::2014-01-24 12:17:54,301::BindingXMLRPC::977::vds::(wrapper) return vmDestroy with {'status': {'message': 'Machine destroyed', 'code': 0}

--- Additional comment from Itamar Heim on 2014-01-26 03:11:11 EST ---

Setting target release to current version for consideration and review. please
do not push non-RFE bugs to an undefined target release to make sure bugs are
reviewed for relevancy, fix, closure, etc.

Comment 2 Sergey Gotliv 2014-01-28 10:55:01 UTC
Read only IDE disks are not supported by QEMU. The only exception for that is the cdrom. We can only validate that the IDE disk is not marked as a read-only.

Comment 6 Leonid Natapov 2014-02-19 15:10:50 UTC
tested on 3.4.0-0.11.beta3.el6. IDE disk can not be read only. It blocked by UI and backend.

Comment 12 errata-xmlrpc 2014-06-09 13:28:11 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.