Hello,
I've been trying out the new "kvm_extra" feature in ganeti-2.7.0-rc2 which allows passing arbitrary arguments to qemu-kvm, in order to use a virtio-scsi storage interface. Although the following options do not return an error when starting qemu-kvm from the command line, starting an instance where the kvm_extra option has been configured with the same values produces an error. Unfortunately, neither virtio-scsi nor kvm_extra are sufficiently documented online, so I might be doing something wrong here:
This is how I'm configuring kvm_extra. I've put this together by googling around for examples, I suppose it should do the following: 1) create a virtual SCSI initiator in the VM (-device virtio-scsi-pci), 2) Configure the two drives for use within the instance, and assign an ID to them so that we have a way of making references to them (-drive file=/dev/sdX,id=sdX...), 3) Attach these drives to the virtual SCSI initiator scsihw0 (-device scsi-hd,drive=sdX...). I've had to escape commas, which I discovered by trial and error:
gnt-instance modify -H kvm_extra="-device virtio-scsi-pci\,id=scsihw0 -drive file=/dev/sdb\,if=none\,id=sdb\,cache=writeback\,aio=native -device scsi-hd\,drive=sdb\,id=scsi1\,bus=scsihw0.0\,channel=0\,scsi-id=0\,lun=0\,bootindex=100 -drive file=/dev/sdc\,if=none\,id=sdc\,cache=writeback\,aio=native -device scsi-hd\,drive=sdc\,id=scsi2\,bus=scsihw0.0\,channel=0\,scsi-id=1\,lun=0\,bootindex=101" nas.mydomain.tld
gnt-instance succeeds in setting this:
Modified instance nas.mydomain.tld
- hv/kvm_extra -> -device virtio-scsi-pci,id=scsihw0 -drive file=/dev/sdb,if=none,id=sdb,cache=writeback,aio=native -device scsi-hd,drive=sdb,id=scsi1,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,bootindex=100 -drive file=/dev/sdc,if=none,id=sdc,cache=writeback,aio=native -device scsi-hd,drive=sdc,id=scsi2,bus=scsihw0.0,channel=0,scsi-id=1,lun=0,bootindex=101
Please don't forget that most parameters take effect only at the next (re)start of the instance initiated by ganeti; restarting from within the instance will not be enough.
Starting the instance produces an error:
death ~ # gnt-instance start nas.mydomain.tld
Waiting for job 93062 for nas.mydomain.tld ...
Job 93062 for nas.mydomain.tld has failed: Failure: command execution error:
Could not start instance: Hypervisor error: Failed to start instance nas.mydomain.tld: exited with exit code 1 (qemu-system-x86_64: -device virtio-scsi-pci,id=scsihw0 -drive file=/dev/sdb,if=none,id=sdb,cache=writeback,aio=native -device scsi-hd,drive=sdb,id=scsi1,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,bootindex=100 -drive file=/dev/sdc,if=none,id=sdc,cache=writeback,aio=native -device scsi-hd,drive=sdc,id=scsi2,bus=scsihw0.0,channel=0,scsi-id=1,lun=0,bootindex=101: invalid option
)
Passing these options to qemu-kvm results in no complaining whatsoever, though. I can't really tell whether it's working as expected, but at least I can tell that kvm_extra is not passed properly to qemu-kvm.
Any clues? Thanks