Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save archerslaw/11363801 to your computer and use it in GitHub Desktop.
Save archerslaw/11363801 to your computer and use it in GitHub Desktop.
hotplug 1024 scsi-hd disk to one virtio-scsi-pci controller.
#...-monitor unix:/tmp/monitor2,server,nowait -device virtio-scsi-pci,id=bus1
i=0
j=0
while [ $i -lt 1024 ]
do
j=$((i%255))
sleep $((1+i/1000))
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment