Bug 997736 - virtio scsi disk could not be initialized when hotplug virtio scsi disk more than 995
virtio scsi disk could not be initialized when hotplug virtio scsi disk more ...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Asias He
Virtualization Bugs
:
Depends On: 841519
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-16 01:46 EDT by Xu Han
Modified: 2013-09-04 03:39 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 841519
Environment:
Last Closed: 2013-09-04 03:39:21 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 Xu Han 2013-08-16 01:46:26 EDT
+++ This bug was initially created as a clone of Bug #841519 +++

Description of problem:
 qemu monitor display "could not open disk image /home/disk/disk996.qcow2: Too many open files
 Property 'scsi-hd.drive' can't find value 'scsi996'
" when hotplug number more than 995.  not find any error message from syslog. host and guest work well. 

Version-Release number of selected component (if applicable):
#rpm -qa|grep qemu
qemu-kvm-1.5.2-3.el7.x86_64

# uname -r
3.10.0-8.el7.x86_64

guest: rhel7.0

How reproducible:
100%

Steps to Reproduce:
1./usr/libexec/qemu-kvm -enable-kvm -M pc-i440fx-rhel7.0.0 -smp 4 -m 3G -usb -device usb-tablet,id=input0 -name RHEL-Server-7.0-64 -drive file=/home/guest/scalability-RHEL7.0-64.qcow2,if=none,id=hd,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0 -device scsi-hd,drive=hd,scsi-id=0,lun=0,id=scsi_image,bootindex=1 -netdev tap,script=/etc/qemu-ifup-switch,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -spice port=5931,disable-ticketing -vga qxl -monitor stdio

2. hotplug virtio-scsi with this script
i=1
j=0
while [ $i -lt 16388 ]
do
    j=$((i%255))
    sleep 1 

    echo "drive_add localhost file=/home/disk/disk$i.qcow2,format=qcow2,media=disk,id=scsi$i,if=none" | nc -U /tmp/monitor2
    echo "device_add scsi-hd,bus=bus1.0,drive=scsi$i,scsi-id=$j,id=hd$i" |nc -U /tmp/monitor2

    i=$(($i+1))
done

3.check disks inside guest
(qemu) info block
  
Actual results:
(qemu) drive_add localhost file=/home/disk/disk995.qcow2,format=qcow2,media=disk,id=scsi995,if=none
OK
(qemu) QEMU 1.5.2 monitor - type 'help' for more information
(qemu) device_add scsi-hd,bus=bus1.0,drive=scsi995,scsi-id=230,id=hd995
(qemu) QEMU 1.5.2 monitor - type 'help' for more information
(qemu) drive_add localhost file=/home/disk/disk996.qcow2,format=qcow2,media=disk,id=scsi996,if=none
could not open disk image /home/disk/disk996.qcow2: Too many open files
(qemu) QEMU 1.5.2 monitor - type 'help' for more information
(qemu) device_add scsi-hd,bus=bus1.0,drive=scsi996,scsi-id=231,id=hd996
Property 'scsi-hd.drive' can't find value 'scsi996'

(qemu) info block
drive-virtio-disk1: removable=0 io-status=ok file=/home/guest/scalability-RHEL7.0-64.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
ide1-cd0: removable=1 locked=0 tray-open=0 io-status=ok [not inserted]
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
scsi1: removable=0 io-status=ok file=/home/disk/disk1.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
scsi2: removable=0 io-status=ok file=/home/disk/disk2.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
...
scsi994: removable=0 io-status=ok file=/home/disk/disk994.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
scsi995: removable=0 io-status=ok file=/home/disk/disk995.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0


Expected results:
can hotplug 16384 virtio scsi disk.

Additional info:
Comment 2 Xu Han 2013-08-21 23:09:23 EDT
Last week I just forgot to modify the limit on the number of open files.
Now, I have re-tested, and wouldn't hit this issue.
But in rhel7 guest, I find only 512 disks can be recognized, like weizhang hitted in Bug 841519, is it a problem?
Comment 3 Xu Han 2013-08-22 00:26:24 EDT
Forgot to say, this time I bind all luns to one target, so the maximum lun number is 512?
Comment 4 Asias He 2013-09-04 00:46:31 EDT
(In reply to xuhan from comment #3)
> Forgot to say, this time I bind all luns to one target, so the maximum lun
> number is 512?

We are supposed to support 2^14 == 16384 luns per target by virtio-scsi's design.
The largest luns per target I have ever seen is 512.

See: Bug 1000340 - linux guest can not support more than 512 luns per target
Comment 5 Xu Han 2013-09-04 03:39:21 EDT
According to comment2. This is not bug.

QE will track bz1000340 as well.

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