RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 950330 - Duplicate ID set for scsi controller when adding the second scsi disk
Summary: Duplicate ID set for scsi controller when adding the second scsi disk
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 949810
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-10 06:15 UTC by Martin Kletzander
Modified: 2014-09-03 20:25 UTC (History)
12 users (show)

Fixed In Version: virt-manager-0.10.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 949810
Environment:
Last Closed: 2014-06-13 10:04:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kletzander 2013-04-10 06:15:24 UTC
+++ This bug was initially created as a clone of Bug #949810 +++

Description
Duplicate ID set for scsi controller when adding the second scsi disk

Version:
virt-manager-0.9.5-1.el7.noarch
libvirt-1.0.3-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Make sure you  have a guest installed using scsi disk.
# virsh dumpxml scsi
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/scsi.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>

2.Add the second disk,choose disk "Device type" as virtio SCSI disk.
2013-04-08 14:36:24,829 (libvirtobject:135): Redefining 'scsi' with XML diff:
--- Original XML
+++ New XML
@@ -61,5 +61,6 @@
     <memballoon model="virtio">
       <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
     </memballoon>
+    <controller type="scsi" index="0" model="virtio-scsi"/>
   </devices>
 </domain>

2013-04-08 14:36:24,917 (libvirtobject:135): Redefining 'scsi' with XML diff:
--- Original XML
+++ New XML
@@ -64,5 +64,10 @@
     <memballoon model="virtio">
       <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
     </memballoon>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="raw"/>
+      <source file="/var/lib/libvirt/images/scsi-5.img"/>
+      <target dev="sdb" bus="scsi"/>
+    </disk>
   </devices>
 </domain>

3.Start the guest,error shows for Duplicate ID 'scsi0' for device.
2013-04-08 14:36:29,829 (error:80): dialog message: Error starting domain: internal error process exited while connecting to monitor: qemu-kvm: -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8: Duplicate ID 'scsi0' for device
 : Error starting domain: internal error process exited while connecting to monitor: qemu-kvm: -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8: Duplicate ID 'scsi0' for device

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 117, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1160, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 692, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error process exited while connecting to monitor: qemu-kvm: -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8: Duplicate ID 'scsi0' for device

4.Check the xml of guest,the index of controller scsi is the same.
# virsh dumpxml scsi
    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>

5.If change the xml,modify index of the second scsi controller as a different value,guest can boot successfully.
    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='scsi' index='1' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>

Actual results:
As describes.

Expected results:
Correct ID set for scsi controller when adding the second scsi disk

Additional info:

--- Additional comment from Martin Kletzander on 2013-04-09 06:32:19 EDT ---

This looks like a libvirt's problem.  Even though virt-manager could change the model of the scsi controller which is not virtio-serial, this should work also and needs to be addressed in libvirt.  Reassigning.

--- Additional comment from Jiri Denemark on 2013-04-09 17:45:26 EDT ---

Well, libvirt should have refuse to add a new scsi controller with the same index (0). But it's virt-manager's fault that it even tried to add a second scsi controller with index='0'.

--- Additional comment from Martin Kletzander on 2013-04-10 02:13:06 EDT ---

You're right, I missed the fact that both controllers have the index already specified.  So there are two problems here, both libvirt and virt-manager should prevent this situation.

Comment 1 Martin Kletzander 2013-07-09 07:14:42 UTC
Moving to MODIFIED, this was fixed upstream with commit RELEASE-0.9.5-1-266-gc457363:

commit c457363f5a7402d77b43787bb0c84b68bd11cdda
Author: Martin Kletzander <mkletzan>
Date:   Tue Jun 18 16:12:39 2013 +0200

    Don't duplicate SCSI controller IDs and assign proper addresses

and picked up in virt-manager-0.10.0.

Comment 2 tingting zheng 2013-07-11 03:18:22 UTC
I tried the bug with:
virt-manager-0.10.0-1.el7.noarch
libvirt-1.0.6-1.el7.x86_64

However,I found that scsi disk has hidden from virt-manager,would you pls help to check this issue?

Comment 3 Martin Kletzander 2013-07-12 05:32:49 UTC
Be sure that the host supports KVM and the guest is created for KVM, not qemu without KVM.  virt-manager check that and doesn't offer 'Virtio SCSI disk' and others on non-KVM hosts.  For the installation you can choose whatever you want and then change it with virsh to:

...
  <target dev='sda' bus='scsi'/>
</disk>
<controller type='scsi' index='0'>
...

Just to match the specific criteria.  Then run virt-manager again and follow the steps to reproduce the bug.

Comment 4 tingting zheng 2013-07-15 06:01:43 UTC
(In reply to Martin Kletzander from comment #3)
> Be sure that the host supports KVM and the guest is created for KVM, not
> qemu without KVM.  virt-manager check that and doesn't offer 'Virtio SCSI
> disk' and others on non-KVM hosts. 

'Virtio SCSI disk' is among 'device type',I mean 'SCSI disk' is not there,I remember the bug can only be reproduced with first 'SCSI disk' then add 'Vritio SCSI disk' or vice versa.

Comment 5 Martin Kletzander 2013-07-15 06:20:43 UTC
'SCSI disk' and 'USB disk' aren't supported on virt-manager in RHEL due to various reasons.  However, you can install the machine as usual (or take any defined machine already), edit the XML so there is only one scsi controller, it has index='0' and no model specified.  Then if you try to add SCSI disk in virt-manager, the machine shouldn't start with virt-manager-0.9.5-1, but should start with virt-manager-0.10.0-1.

Let me know if I can help you with anything else.

Comment 6 tingting zheng 2013-07-17 09:00:44 UTC
(In reply to Martin Kletzander from comment #5)
> 'SCSI disk' and 'USB disk' aren't supported on virt-manager in RHEL due to
> various reasons.  However, you can install the machine as usual (or take any
> defined machine already), edit the XML so there is only one scsi controller,
> it has index='0' and no model specified.  Then if you try to add SCSI disk
> in virt-manager, the machine shouldn't start with virt-manager-0.9.5-1, but
> should start with virt-manager-0.10.0-1.
> 
> Let me know if I can help you with anything else.

As discussed on IRC,when I edit the xml of guest to add a scsi disk and scsi controller.

   <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/demo.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </controller>

I will get xml error from libvirt:
error: internal error Unable to determine model for scsi controller
Failed. Try again? [y,n,f,?]:

If I add model='virtio-scsi',then I can edit the xml successfully.

Comment 7 Martin Kletzander 2013-07-17 09:15:49 UTC
That is libvirt error which is part of bug 974943, not caused by virt-manager.  You can get around this by downgrading qemu (for the purpose of this bug's verification).

Comment 8 tingting zheng 2013-07-18 06:27:08 UTC
Tested with:
virt-manager-0.10.0-1.el7.noarch
qemu-kvm-1.3.0-5.el7.x86_64

Steps:
1.Update xml to add a scsi disk and scsi controller.
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/test.img'/>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>

2.Launch virt-manager,add a virtio scsi disk.

3.Boot the guest,the guest can be started successfully.
Check the xml of the guest,it has added:
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/test-1.img'/>
      <target dev='sdb' bus='scsi'/>
      <alias name='scsi1-0-0-0'/>
      <address type='drive' controller='1' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='1' model='virtio-scsi'>
      <alias name='scsi1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>

So refer to the above comments,move the bug to VERIFIED.

Comment 9 Shanzhi Yu 2013-11-28 02:57:43 UTC
Hi Martin,
I met below problem by chance
when there is an virtio scsi disk, then add second one by virt-manager will met an similar problem like "Duplicate ID 'drive-scsi0-0-0-0' for drive"

Versions:

libvirt-1.1.1-13.el7.x86_64
virt-manager-0.10.0-7.el7.noarch

Steps:
1. define an guest with virtio scsi disk.
# virsh dumxpml rhel6
..
 <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
 <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
..
2. add second by virt-manager. choose disk "Device type" as virtio SCSI disk.

3. check the guest xml.
# virsh dumpxml rhel6
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/test.img'/>
      <target dev='sdb' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...
sda and sdb have same
"<address type='drive' controller='0' bus='0' target='0' unit='0'/>"

Should reopen this bug or file new one?



Additional info:

Error starting domain: internal error: process exited while connecting to monitor: qemu-kvm: -drive file=/var/lib/libvirt/images/test.img,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none: Duplicate ID 'drive-scsi0-0-0-0' for drive


Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 100, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 122, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1220, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 698, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error: process exited while connecting to monitor: qemu-kvm: -drive file=/var/lib/libvirt/images/test.img,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none: Duplicate ID 'drive-scsi0-0-0-0' for drive

Comment 10 Martin Kletzander 2013-12-02 10:31:36 UTC
Thanks for finding that out, please file a new one, both for virt-manager and libvirt, since the error comes from qemu.  Thank you.

Comment 11 Shanzhi Yu 2013-12-02 14:14:55 UTC
(In reply to Martin Kletzander from comment #10)
> Thanks for finding that out, please file a new one, both for virt-manager
> and libvirt, since the error comes from qemu.  Thank you.

Thanks, file two track this.
1036715
1036716

Comment 12 Ludek Smid 2014-06-13 10:04:50 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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