This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 982224 - Attaching of the Virtio-scsi [qcow2] drives fails with "error: internal error No more available PCI addresses"
Attaching of the Virtio-scsi [qcow2] drives fails with "error: internal error...
Status: CLOSED CURRENTRELEASE
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-08 08:18 EDT by chandrashekar shastri
Modified: 2016-04-09 20:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-09 20:11:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description chandrashekar shastri 2013-07-08 08:18:36 EDT
Description of problem:

If we try to attach the 256 Virtio-scsi [qcow2] drives it fails with an error as 

 "error: Failed to attach disk"
 "error: internal error No more available PCI addresses"

I reckon any linux machine supports 256 luns. 

Please refer to the below link:
https://community.emc.com/thread/90269

I have checked this issue on rhel and sles guests. I could add only 214 devices 
and started getting from 215th lun:

formatting '/home/images/virtio-scsi215.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off 
error: Failed to attach disk
error: internal error No more available PCI addresses

26 scsi controllers were added for these 214 devices.

<controller type='scsi' index='23'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1c' function='0x0'/>
    </controller>
    <controller type='scsi' index='24'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0'/>
    </controller>
    <controller type='scsi' index='25'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='scsi' index='26'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
Comment 1 chandrashekar shastri 2013-07-09 02:11:07 EDT
Script to create 256 volumes and attach to the guest.

####################################################

#!/usr/bin/bash
if [ x$1 != x ]; then
cmd=$1
c=1
while [ $c -le 256 ]
do
qemu-img create -f qcow2 /home/virtio-scsi$c.qcow2 1G
#sleep 1
i="`cat file | head -$c | tail -1`"
virsh attach-disk $cmd /home/images/virtio-scsi$c.qcow2 $i --persistent  --cache writethrough --sourcetype file --driver qemu --subdriver qcow2
#virsh detach-disk $cmd $i
 ((c++))
done
else
echo "enter the vm name"
fi

####################################################
Comment 2 Cole Robinson 2016-04-09 20:11:50 EDT
There's some more info here about scsi controller limitations:

https://www.redhat.com/archives/libvir-list/2013-November/msg01122.html

And FWIW running your script, but using virt-xml instead of virsh, works fine:

Domain 'scsi-test' defined successfully.
Disk #256
Domain 'scsi-test' defined successfully.

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