Project

General

Profile

action #110229

[tools][qemu] Managing device boot order with bootindex

Added by rfan1 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
2022-04-24
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Hello tool team experts,

Description

Can I ask for your kindly help to see if we can set boot order for VMs with qemu backend?

We used to set bootindex=0 for disk or cdrom, but I don't know if we can set the boot order for different devices with bootindex proertity.

For example, I need set:

DISK->bootindex=0
CDROM->bootindex=1
NET->bootindex=2

Expect result

If we have multiple boot devices, we can set the boot order for them.

History

#1 Updated by okurz 4 months ago

  • Due date set to 2022-05-08
  • Category set to Support
  • Status changed from New to Feedback
  • Assignee set to okurz
  • Target version set to Ready

It is possible to use either boot indeces or the bootorder parameter, see https://qemu.readthedocs.io/en/latest/system/bootindex.html . I don't know what to help. Maybe you can explain in more details what the requirement is unless the mentioned URL already helps you enough.

#2 Updated by rfan1 4 months ago

Thanks Oliver for the quick response! Let me add more detail information for my requirements.
Actually, we have had some discussion within Security and Migration teams on migration tests, take the below cases as example:

http://openqa.suse.de/tests/8445566#
we can see the job setting: "BOOTFROM =d", the the backend qemu command sets cdrom as "bootindex=0"

-device scsi-cd,id=cd0-device,drive=cd0-overlay0,bootindex=0,serial=cd0

https://openqa.suse.de/tests/8571022
we can see the job setting: "BOOT_HDD_IMAGE=1", the the backend qemu command sets virtio disk as "bootindex=0"

-device virtio-blk,id=hd0-device,drive=hd0-overlay0,bootindex=0,serial=hd0

Seems we can only set "bootindex=0" here, based on our test requirement, we may need set "bootindex=1" for other boot devices if possible.

It will help much for our test with this change, especially for offline migration tests, since we used to attach both virtio disk and cdrom at the same time in qemu backend, we may need set them as "boot order = 0,1".

Current logic is we set bootindex=0 for cdrom device, and in boot menu, we switch to "boot from disk" every time we try to boot the disk device.
http://openqa.suse.de/tests/8445566#step/boot_to_desktop/2

In openQA automation tests, if we can define virtio-disk as 1st boot device, and set cdrom as 2nd boot device, then after booting from disk, once we exit from grub2 phase, it will switch to cdrom boot by default.

Please feel free to let me know if any concerns.

#3 Updated by rfan1 4 months ago

In summary,

My requirement is:

Based on our job setting:
"BOOTFROM =d" or "BOOT_HDD_IMAGE=1", then in qemu backend command, one boot device is set to "bootindex=0".

I want to set another boot device to "bootindex=1" if possible.

#4 Updated by mkittler 4 months ago

Ok, so I guess adding a test variable for setting the boot index of a specific device would help you. E.g. we could implement the following:

  • BOOT_INDEX_ISO=n would set bootindex=n for ISO
  • BOOT_INDEX_HDD_i=n would set bootindex=n for HDD_i

That would be a presumably easy change in configure_blockdevs (in os-autoinst/OpenQA/Qemu/Proc.pm).

#5 Updated by rfan1 4 months ago

Thank you mkittler, that should be great!

#6 Updated by okurz 4 months ago

  • Due date deleted (2022-05-08)
  • Category changed from Support to Feature requests
  • Status changed from Feedback to New
  • Assignee deleted (okurz)
  • Priority changed from Normal to Low
  • Target version changed from Ready to future

rfan1 I think with the ideas given in #110229#note-4 this is something you could try to add yourself. Feel welcome to provide even an incomplete draft pull request for https://github.com/os-autoinst/os-autoinst and we can provide help in the pull request.

#7 Updated by rfan1 4 months ago

Thank you okurz, let me try to do that.

Also available in: Atom PDF