Bug 993776

Summary: VM fails to start due to duplicate device ID
Product: Red Hat Enterprise Virtualization Manager Reporter: Gadi Ickowicz <gickowic>
Component: ovirt-engineAssignee: Sergey Gotliv <sgotliv>
Status: CLOSED CURRENTRELEASE QA Contact: Gadi Ickowicz <gickowic>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: abaron, acathrow, amureini, bazulay, iheim, lpeer, nlevinki, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---Keywords: Regression
Target Release: 3.3.0Flags: amureini: Triaged+
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: is11 Doc Type: Bug Fix
Doc Text:
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:
Attachments:
Description Flags
engine + vdsm logs none

Description Gadi Ickowicz 2013-08-06 12:12:22 UTC
Created attachment 783300 [details]
engine + vdsm logs

Description of problem:
Trying to run a VM that has 2 disks fails during _startUnderlyingVm due to "Duplicate ID 'drive-scsi0-0-0-0' for drive". The xml sent to libvirt shows that only one of the disks has an <address> tag, however it is labelled as sdb, whereas sda does not have an address:


		<disk device="disk" snapshot="no" type="block">
			<source dev="/rhev/data-center/89967d0a-401e-4a3f-a356-f87fbc22500f/0b401111-c12f-4e1b-8402-969aa6362f06/images/fbd6f26b-fc82-4c7d-ab63-197a36998aff/bfa42693-df2c-428d-ba7b-7ffca03a384f"/>
			<target bus="scsi" dev="sda"/>
			<serial>fbd6f26b-fc82-4c7d-ab63-197a36998aff</serial>
			<boot order="1"/>
			<driver cache="none" error_policy="stop" io="native" name="qemu" type="qcow2"/>
		</disk>
		<disk device="disk" snapshot="no" type="block">
			<address bus="0" controller="0" target="0" type="drive" unit="0"/>
			<source dev="/rhev/data-center/89967d0a-401e-4a3f-a356-f87fbc22500f/0b401111-c12f-4e1b-8402-969aa6362f06/images/c1100649-c75c-48f9-8f6b-f77f47da0b36/6c4ff8e1-c749-471e-84bb-ff75dcfe5250"/>
			<target bus="scsi" dev="sdb"/>
			<serial>c1100649-c75c-48f9-8f6b-f77f47da0b36</serial>
			<driver cache="none" error_policy="stop" io="native" name="qemu" type="qcow2"/>
		</disk>


After speaking with Eduardo and looking into the devices dictionary sent by engine for vmCreate:
>>> devices = p['devices']
[{'device': 'qxl', 'specParams': {'vram': '65536'}, 'type': 'video', 'deviceId': 'ec21d98e-3fd3-4dc7-ba17-710f36b17845'}, {'shared': 'false', 'index': '2', 'readonly': 'true', 'iface': 'ide', 'deviceId': '48ae75e2
-732d-41d3-8e22-0ddeb81ba634', 'specParams': {'path': ''}, 'device': 'cdrom', 'path': '', 'type': 'disk'}, {'index': 0, 'iface': 'scsi', 'type': 'disk', 'format': 'cow', 'bootOrder': '1', 'volumeID': 'bfa42693-df2
c-428d-ba7b-7ffca03a384f', 'imageID': 'fbd6f26b-fc82-4c7d-ab63-197a36998aff', 'specParams': {}, 'readonly': 'false', 'domainID': '0b401111-c12f-4e1b-8402-969aa6362f06', 'deviceId': 'fbd6f26b-fc82-4c7d-ab63-197a369
98aff', 'poolID': '89967d0a-401e-4a3f-a356-f87fbc22500f', 'device': 'disk', 'shared': 'false', 'propagateErrors': 'off', 'optional': 'false'}, {'domainID': '0b401111-c12f-4e1b-8402-969aa6362f06', 'format': 'cow',
'poolID': '89967d0a-401e-4a3f-a356-f87fbc22500f', 'deviceId': 'c1100649-c75c-48f9-8f6b-f77f47da0b36', 'address': {' controller': '0', ' target': '0', ' bus': '0', 'unit': '0', ' type': 'drive'}, 'device': 'disk',
'propagateErrors': 'off', 'optional': 'false', 'iface': 'scsi', 'volumeID': '6c4ff8e1-c749-471e-84bb-ff75dcfe5250', 'imageID': 'c1100649-c75c-48f9-8f6b-f77f47da0b36', 'specParams': {}, 'readonly': 'false', 'shared
': 'false', 'type': 'disk'}, {'device': 'scsi', 'model': 'virtio-scsi', 'type': 'controller'}, {'linkActive': 'true', 'deviceId': 'd7c6c9b9-19a1-47c5-86ac-e10acc3e655b', 'address': {'bus': '0x00', ' function': '0x
0', ' domain': '0x0000', ' type': 'pci', ' slot': '0x03'}, 'device': 'bridge', 'nicModel': 'pv', 'macAddr': '00:1a:4a:16:81:cc', 'network': 'rhevm', 'custom': {}, 'filter': 'vdsm-no-mac-spoofing', 'specParams': {}
, 'type': 'interface'}, {'device': 'ac97', 'specParams': {}, 'type': 'sound', 'deviceId': 'b0149206-341d-4b9e-a541-a09ec395bbac', 'address': {'bus': '0x00', ' function': '0x0', ' domain': '0x0000', ' type': 'pci',
 ' slot': '0x04'}}, {'device': 'memballoon', 'specParams': {'model': 'virtio'}, 'type': 'balloon', 'deviceId': 'cc3af4be-d467-48c1-853c-d45b85a0bc92'}]

this contains 2 disks:

>>> disks = [d for d in devices if d.get('device', None) == 'disk']
[{'index': 0, 'iface': 'scsi', 'type': 'disk', 'format': 'cow', 'bootOrder': '1', 'volumeID': 'bfa42693-df2c-428d-ba7b-7ffca03a384f', 'imageID': 'fbd6f26b-fc82-4c7d-ab63-197a36998aff', 'specParams': {}, 'readonly'
: 'false', 'domainID': '0b401111-c12f-4e1b-8402-969aa6362f06', 'deviceId': 'fbd6f26b-fc82-4c7d-ab63-197a36998aff', 'poolID': '89967d0a-401e-4a3f-a356-f87fbc22500f', 'device': 'disk', 'shared': 'false', 'propagateE
rrors': 'off', 'optional': 'false'}, {'domainID': '0b401111-c12f-4e1b-8402-969aa6362f06', 'format': 'cow', 'poolID': '89967d0a-401e-4a3f-a356-f87fbc22500f', 'deviceId': 'c1100649-c75c-48f9-8f6b-f77f47da0b36', 'add
ress': {' controller': '0', ' target': '0', ' bus': '0', 'unit': '0', ' type': 'drive'}, 'device': 'disk', 'propagateErrors': 'off', 'optional': 'false', 'iface': 'scsi', 'volumeID': '6c4ff8e1-c749-471e-84bb-ff75d
cfe5250', 'imageID': 'c1100649-c75c-48f9-8f6b-f77f47da0b36', 'specParams': {}, 'readonly': 'false', 'shared': 'false', 'type': 'disk'}]

one disk has an address sent - {' controller': '0', ' target': '0', ' bus': '0', 'unit': '0', ' type': 'drive'} and the other does not. however non have a label (sda/sdb). This label is added by vdsm in the same order they appear in the dictionary causing the second disk to receive the sdb label with address for sda.

Version-Release number of selected component (if applicable):
vdsm-4.12.0-rc3.13.git06ed3cc.el6ev.x86_64

How reproducible:
100% (with automated test)

Steps to Reproduce:
1. Create a vm with 1 disk and install OS on it
2. shutdown VM
3. Add disk to vm
4. create template from vm
5. clone new vm from template
6. boot vm

Actual results:
VM fails to start due to duplicate device id


Expected results:
VM should start

Additional info:

Comment 3 Gadi Ickowicz 2013-08-27 11:24:56 UTC
verified on is11. Ran the scenario described above and vm booted successfully.

Comment 4 Itamar Heim 2014-01-21 22:32:59 UTC
Closing - RHEV 3.3 Released

Comment 5 Itamar Heim 2014-01-21 22:33:06 UTC
Closing - RHEV 3.3 Released