Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvm: add support for the bootindex property in bootable devices #1573

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gedia
Copy link
Contributor

@gedia gedia commented Jan 25, 2021

This PR adds support for setting the bootindex property in all bootable devices currently managed by ganeti, namely disks, nics, cdroms and floppy drives. The bootindex property can be used for more fine-grained control of the boot order preference. AFAICT, the legacy boot X or boot order=X qemu syntax relies on BIOS enumeration to determine the boot device, allowing one to effectively only deterministically specify a boot order preference for a specific device type, which is insufficient when a guest has multiple devices per type (e.g. two disks or two nics). BIOSes can still only boot from one device per device type (even with the bootindex property set), but UEFI implementations should be able to fail over to a device of the same type if the previous higher bootindex priority has failed.

The primary motivation for writing this patch was to overcome boot failures encountered when passing storage devices through to the guest via methods bypassing ganeti storage management (i.e. using kvm_extra), but I expect it might be useful in other cases too, especially for UEFI guests. It builds upon #1572 and includes improvements included therein, but I can clean it up if needed.

Usage

  • when configuring an instance, the user can specify the bootindex property for the following device types:
    • disks: by supplying a "bootindex" parameter (e.g. size=128M,bootindex=0)
    • nics by supplying a "bootindex" parameter (e.g. link=br0,bootindex=1)
    • cdrom: by setting the cdrom_bootindex hypervisor parameter for KVM
    • cdrom2: by setting the cdrom2_bootindex hypervisor parameter for KVM
    • floppy: by setting the floppy_bootindex hypervisor parameter for KVM
  • bootindex values can be any integer
    • to unset the bootindex (after it has been set), supply any negative value (negative values are ignored)

Changes

In addition to changes needed to accommodate bootindex-related functionality, this PR also introduces the following:

  • cdrom will no longer be forced to be type=ide when configured to be bootable
  • cdrom drive def no longer uses the deprecated if=virtio syntax. The function now performs the same processing done for block devices:
    • the newer -drive ... -device ... syntax is now used
    • when cdrom_disk_type is set to paravirtual, -device will be set to scsi-cd which supports booting, hooked on a virtio-scsi-pci controller
    • floppy drive is now configured using the -global isa-fdc. syntax (more on that later)

Caveats

  • Setting bootindex to a negative value isn't very elegant. I tried to implement a MaybeInt type to accomodate Int or None for its values, but wasn't very successful (but some groundwork has been laid in this patch). Any help would be appreciated
  • The -global isa-fdc. syntax is deprecated. Unfortunately there seems to be some sort of bug when using the newer syntax (-device floppy,unit=0,drive=) which affects Windows guests (the floppy device is visible in explorer, but on accessing it one is presented with a cryptic error, there are reports of this online). The new cdrom device creation logic in this patch will render drives unreadable by windows guests when cdrom_disk_type is set to paravirtual, so in this case a working floppy implementation is needed to load the virtio drivers. I settled for using the legacy syntax supporting bootindex for floppies which also works with windows guests as a compromise.
  • Currently it is possible to have both boot order=N and bootindex options in the qemu cmdline at the same time. qemu documentation advises against this, but I haven't encountered any issues during (manual) testing. Having said that, I haven't tried conflicting options for these two methods (e.g. setting boot order to disk whilst having the highest bootindex priority set to a nic device). Thoughts?
  • The patch doesn't check for duplicate bootindex values within an instance.

TODO

  • Docs
  • Tests (help!)
  • Sanity review

Successful manual testing so far:

Create an instance command and result:

gnt-instance add -t file -s 512M -o debootstrap+default --net 0:link=br0 -B memory=256M --no-start -n debtest.debtest.local -H kvm:kernel_path="/boot/vmlinuz-5.10.0-1-amd64" test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xd,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-S
Add bootindex to existing disk command and result

gnt-instance modify --disk 0:modify,bootindex=1 test1.debtest.local

-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xd,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-S
Add bootindex to existing nic command and result:

gnt-instance modify --net 0:modify,bootindex=2 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xd,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-S
Add cdrom image with bootindex command and result:

gnt-instance modify -H cdrom_image_path='/srv/ganeti/shared-file-storage/cd.iso',cdrom_bootindex=3 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xd,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-S
Add floppy image with bootindex command and result:

gnt-instance modify -H floppy_image_path='/srv/ganeti/shared-file-storage/floppy.img',floppy_bootindex=4 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xd,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-global isa-fdc.bootindexA=4
-S
Add new disk with bootindex command and result:

gnt-instance modify --disk add:size=128M,bootindex=5 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xe,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-blk-pci,id=disk-beea6f4f-eec4-4ff2,bus=pci.0,addr=0xd,drive=disk-beea6f4f-eec4-4ff2,bootindex=5
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:1,format=raw,if=none,id=disk-beea6f4f-eec4-4ff2
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-global isa-fdc.bootindexA=4
-S
Add new nic with bootindex command and result:

gnt-instance modify --net add:link=br0,bootindex=6 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xe,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-netdev type=tap,id=nic-34ecd8e6-4bc7-4839,fd=11
-device virtio-net-pci,id=nic-34ecd8e6-4bc7-4839,bus=pci.0,addr=0xf,netdev=nic-34ecd8e6-4bc7-4839,mac=aa:00:00:8a:d2:08,bootindex=6
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-blk-pci,id=disk-beea6f4f-eec4-4ff2,bus=pci.0,addr=0xd,drive=disk-beea6f4f-eec4-4ff2,bootindex=5
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:1,format=raw,if=none,id=disk-beea6f4f-eec4-4ff2
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-global isa-fdc.bootindexA=4
-S
Remove bootindex from floppy command and result:

gnt-instance modify -H floppy_bootindex=-4 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xe,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-netdev type=tap,id=nic-34ecd8e6-4bc7-4839,fd=11
-device virtio-net-pci,id=nic-34ecd8e6-4bc7-4839,bus=pci.0,addr=0xf,netdev=nic-34ecd8e6-4bc7-4839,mac=aa:00:00:8a:d2:08,bootindex=6
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-blk-pci,id=disk-beea6f4f-eec4-4ff2,bus=pci.0,addr=0xd,drive=disk-beea6f4f-eec4-4ff2,bootindex=5
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:1,format=raw,if=none,id=disk-beea6f4f-eec4-4ff2
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-S
Add cdrom2 image with bootindex command and result:

gnt-instance modify -H cdrom2_image_path='/srv/ganeti/shared-file-storage/cd2.iso',cdrom2_bootindex=8 test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xe,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-netdev type=tap,id=nic-34ecd8e6-4bc7-4839,fd=11
-device virtio-net-pci,id=nic-34ecd8e6-4bc7-4839,bus=pci.0,addr=0xf,netdev=nic-34ecd8e6-4bc7-4839,mac=aa:00:00:8a:d2:08,bootindex=6
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-blk-pci,id=disk-beea6f4f-eec4-4ff2,bus=pci.0,addr=0xd,drive=disk-beea6f4f-eec4-4ff2,bootindex=5
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:1,format=raw,if=none,id=disk-beea6f4f-eec4-4ff2
-device virtio-scsi-pci,id=scsi
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device scsi-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/cd2.iso,media=cdrom,format=raw,if=none,id=cd1
-device scsi-cd,drive=cd1,bootindex=8
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-S
Change cdrom_disk_type to ide command and result:

gnt-instance modify -H cdrom_disk_type=ide test1.debtest.local

/usr/bin/kvm
-name test1.debtest.local,debug-threads=off
-m 256
-smp 2
-pidfile /var/run/ganeti/kvm-hypervisor/pid/test1.debtest.local
-device virtio-balloon
-daemonize
-D /var/log/ganeti/kvm/test1.debtest.local.log
-machine pc-i440fx-5.2
-kernel /boot/vmlinuz-5.10.0-1-amd64
-append root=/dev/vda1 ro console=ttyS0,38400
-monitor unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.monitor,server,nowait
-serial unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.serial,server,nowait
-usb
-display none
-uuid 12b429b1-16bd-4257-923e-4b19acdc1668
-netdev type=tap,id=nic-34062bad-fc63-4d1f,fd=10
-device virtio-net-pci,id=nic-34062bad-fc63-4d1f,bus=pci.0,addr=0xe,netdev=nic-34062bad-fc63-4d1f,mac=aa:00:00:b0:6b:1f,bootindex=2
-netdev type=tap,id=nic-34ecd8e6-4bc7-4839,fd=11
-device virtio-net-pci,id=nic-34ecd8e6-4bc7-4839,bus=pci.0,addr=0xf,netdev=nic-34ecd8e6-4bc7-4839,mac=aa:00:00:8a:d2:08,bootindex=6
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.qmp,server,nowait
-qmp unix:/var/run/ganeti/kvm-hypervisor/ctrl/test1.debtest.local.kvmd,server,nowait
-device virtio-blk-pci,id=disk-fafd85a6-4d1c-4187,bus=pci.0,addr=0xc,drive=disk-fafd85a6-4d1c-4187,bootindex=1
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:0,format=raw,if=none,id=disk-fafd85a6-4d1c-4187
-device virtio-blk-pci,id=disk-beea6f4f-eec4-4ff2,bus=pci.0,addr=0xd,drive=disk-beea6f4f-eec4-4ff2,bootindex=5
-drive file=/var/run/ganeti/instance-disks/test1.debtest.local:1,format=raw,if=none,id=disk-beea6f4f-eec4-4ff2
-drive file=/srv/ganeti/shared-file-storage/cd.iso,media=cdrom,format=raw,if=none,id=cd0
-device ide-cd,drive=cd0,bootindex=3
-drive file=/srv/ganeti/shared-file-storage/cd2.iso,media=cdrom,format=raw,if=none,id=cd1
-device ide-cd,drive=cd1,bootindex=8
-drive file=/srv/ganeti/shared-file-storage/floppy.img,id=fd1,format=raw,if=none
-global isa-fdc.driveA=fd1
-S

@gedia gedia force-pushed the feature_bootindex_31 branch 9 times, most recently from 69e5353 to fec38f9 Compare January 27, 2021 17:17
This patch adds multiple device support for the boot_order
setting. Valid values are still disk, cdrom, network and floppy,
but the user can now supply a comma-separated list of those instead
of a single value only.

Additionally, this patch will now use the newer
'-boot order=drives' syntax for the qemu command line,
instead of the deprecated '-boot drives'.
This patch extends ganeti to support setting the bootindex property
for bootable devices, namely disks, nics, cdroms and floppy.
The bootindex property allows more fine-grained control of boot
order preference, and supports multiple devices per device type
(when booting via EFI).
@gedia
Copy link
Contributor Author

gedia commented Aug 27, 2021

Update: If you want to test this patch (and #1605 #1604 #1572 as well), there's build instructions for bullseye here: https://github.com/modulus-sa/ganeti/wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant