Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm currently using virtio-blk but I'd like to change to the new virtio-scsi, especially because it supports trim/ discard. The host is an ubuntu quantal system (kernel 3.5.0, qemu 1.2.0).

This is how I start my guest:

kvm -cpu kvm64 -smp sockets=1,cores=2 -cpu kvm64 -m 1024 -device virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5 -drive file=rbd:data/disk-1,if=none,id=drive-scsi1,cache=writeback,aio=native -device scsi-hd,drive=drive-scsi1,id=scsi1,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,bootindex=100 -device virtio-net-pci,netdev=net0,bus=pci.0,addr=0x12,id=net0,mac=62:79:D8:1E:E0:BF,bootindex=200 -netdev type=tap,id=net0,vhost=on -enable-kvm -nodefaults -boot menu=on -vga cirrus -cdrom rbd:data/ubuntu-12.10-server.iso

The vm starts fine an I can connect using the console and vnc.

info block on the console show both drives are there:

drive-scsi1: removable=0 io-status=ok file=rbd:data/disk-1 ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
ide1-cd0: removable=1 locked=1 tray-open=0 io-status=ok file=rbd:data/ubuntu-12.10-server.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0

How ever the disk is not accessible in any way from inside the vm:

  1. The disk is not shown in the bios boot menu. There's only the cdrom and network card (pxe).

  2. When I boot ubuntu quantal (kernel 3.5.0) from the cdrom, it does not detect the disk, although I somewhere read virtio-scsi devices should be support as of kernel 3.4.0.

What am I doing wrong and how to get it working? :)

share|improve this question

1 Answer 1

To verify that your version of qemu supports virtio-scsi devices run the following command on your linux host:

kvm -device ? 2>&1|grep virtio

see for the following output:

name "virtio-scsi-pci", bus PCI, alias "virtio-scsi"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.