With the switch to '-blockdev', it is necessary to explicitly specify
the device ID for SCSI drives, see also [0]. Otherwise, the device
paths in '/dev/disk/by-id' would be missing. For IDE/SATA, the paths
are still present with '-blockdev' without additional changes and
VirtIO block did not have such paths even before. The relevant
'ide-{cd,hd}' and 'virtio-blk-pci' devices do not seem to have an
option that would be equivalent to the 'scsi-{cd,hd}' 'device_id'
option.
While the change should be backwards-compatible even with '-drive',
guard it with machine version 10.0 just to be sure.
[0]: a1dce96236
Fixes: aaf48d8e ("command line: switch to blockdev starting with machine version 10.0")
Co-developed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250723111105.72422-1-f.ebner@proxmox.com
36 lines
2.6 KiB
Batchfile
36 lines
2.6 KiB
Batchfile
/usr/bin/kvm \
|
|
-id 8006 \
|
|
-name 'simple,debug-threads=on' \
|
|
-no-shutdown \
|
|
-chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
|
|
-mon 'chardev=qmp,mode=control' \
|
|
-chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect-ms=5000' \
|
|
-mon 'chardev=qmp-event,mode=control' \
|
|
-pidfile /var/run/qemu-server/8006.pid \
|
|
-daemonize \
|
|
-smp '1,sockets=1,cores=1,maxcpus=1' \
|
|
-nodefaults \
|
|
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
|
|
-vga none \
|
|
-nographic \
|
|
-cpu qemu64 \
|
|
-m 512 \
|
|
-object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
|
|
-object '{"id":"throttle-drive-sata0","limits":{},"qom-type":"throttle-group"}' \
|
|
-global 'PIIX4_PM.disable_s3=1' \
|
|
-global 'PIIX4_PM.disable_s4=1' \
|
|
-device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
|
|
-device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \
|
|
-device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \
|
|
-device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
|
|
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
|
|
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
|
|
-device 'ide-cd,bus=ide.1,unit=0,id=ide2,bootindex=200' \
|
|
-device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \
|
|
-blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/base-8006-disk-1.qcow2","node-name":"e1085774206ae4a6b6bf8426ff08f16","read-only":true},"node-name":"f1085774206ae4a6b6bf8426ff08f16","read-only":true},"node-name":"drive-scsi0","read-only":true,"throttle-group":"throttle-drive-scsi0"}' \
|
|
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,write-cache=on' \
|
|
-device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' \
|
|
-blockdev '{"driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/base-8006-disk-0.qcow2","node-name":"eab334c2e07734480f33dd80d89871b","read-only":false},"node-name":"fab334c2e07734480f33dd80d89871b","read-only":false},"node-name":"drive-sata0","read-only":false,"throttle-group":"throttle-drive-sata0"}' \
|
|
-device 'ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0,write-cache=on' \
|
|
-machine 'accel=tcg,smm=off,type=pc+pve0' \
|
|
-snapshot
|