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 949810 - 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: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 950330
TreeView+ depends on / blocked
 
Reported: 2013-04-09 05:25 UTC by tingting zheng
Modified: 2014-06-18 00:47 UTC (History)
11 users (show)

Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 950330 1218569 (view as bug list)
Environment:
Last Closed: 2014-06-13 11:21:12 UTC
Target Upstream Version:
Embargoed:
shyu: needinfo-


Attachments (Terms of Use)

Description tingting zheng 2013-04-09 05:25:14 UTC
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:

Comment 2 Martin Kletzander 2013-04-09 10:32:19 UTC
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.

Comment 3 Jiri Denemark 2013-04-09 21:45:26 UTC
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'.

Comment 4 Martin Kletzander 2013-04-10 06:13:06 UTC
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 5 Martin Kletzander 2013-05-30 07:46:49 UTC
Moving to MODIFIED as this was fixed with commit v1.0.4-273-g2bbbf0b:

commit 2bbbf0beb82dabac379770b61b619fbdddaae8c6
Author: Ján Tomko <jtomko>
Date:   Tue Apr 23 14:24:32 2013 +0200

    conf: reject controllers with duplicate indexes

Comment 6 Shanzhi Yu 2013-11-27 09:13:44 UTC
still reproduce it with latest libvirt & virt-manager

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

Steps:

1. define an guest 
# 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>
..

2. use virt-manager to add the second disk,choose disk "Device type" as Virtio SCSI Disk.

3. check 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>
..
The second disk added by virt-manager has the same ID set as first disk

Also test virsh command, it work well. 
1. # 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>
..
2. # attach-disk rhel6 /var/lib/libvirt/images/test.img sdb --driver qemu --subdriver qcow2 --cache none  --config
3. # 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='1'/>
    </disk>
..

Comment 7 Shanzhi Yu 2013-11-27 10:00:31 UTC
can't reproduce the problem in comments 6 and move this bug to REVERIED.

Comment 8 Ludek Smid 2014-06-13 11:21:12 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.