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

[Fixes issue: 343] Adding capability to set bootloader filename #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MS-Daniel-Matolcsi
Copy link

Adding capability to set bootloader filename

This commit adds the feature to aii-dhcp plugin to fetch bootloader filename for DHCP config to be included. Also handles situation if default bootloader may differ from the one would be used in case of rescue mode.

@jouvin
Copy link
Contributor

jouvin commented Apr 19, 2024

I don't think you need AII to configure anything in DHCP. It is currently support by AII to boot in rescue mode (can in fact be anything you have configured) by executing "aii-shellfe --rescue node.name". To work, you need to write a Grub2 config file rescue.cfg file similar to localboot.cfg that will be used by the node when booting. rescue.cfg can be something like (not sure it is a working configuration):


set default=0
set timeout=2
menuentry "Rescue CentOS 7 (x86_64)" {
set root=(pxe)
linuxefi /quattor/rescue-el7_x86_64/vmlinuz ro crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb
initrdefi /quattor/rescue-el7_x86_64/initrd.img
}
}

You can also do something similar for legacy BIOS if you need.

Did I miss something in your usecase?

@MS-Daniel-Matolcsi
Copy link
Author

We specifically need to use a different bootloader when using rescue mode. This is an edge case ESXi hypervisors' UEFI booting:

  • normally using VMware's mboot.efi, but it can't do a chainload or boot a LiveCD image
  • hence, in case we have to boot from a Linux LiveCD in case of rescue (eg. due to revise hardware / doing an firmware upgrade), we have to switch to grub-efi eg. That is what covered in my change, if it's given in profile, AII would change 'filename' option in DHCP conf.

if ($opts->(filename)) {
$filename = $opts->(filename);
}
if ($rescue eq 'rescue' && $opts->(rescue)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it is not an elsif? It makes no point to set the filename to $opts->(filename) in rescue mode or did I miss something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be a case when there's 'filename' set, and 'rescue' not, also if both 'filename' and 'rescue' are set.
I wanted to make sure if there's a 'filename' set, get it anyway, and if there's 'rescue' there as well, overwrite it.

@MS-Daniel-Matolcsi MS-Daniel-Matolcsi force-pushed the matolcsi_bootloader_filename branch from 0a507ed to 0459d0d Compare May 24, 2024 12:26
…ofile

This commit adds the feature to aii-dhcp plugin to fetch bootloader filename for DHCP config to be included.
Also handles situation if default bootloader may differ from the one would be used in case of rescue mode.
@MS-Daniel-Matolcsi MS-Daniel-Matolcsi force-pushed the matolcsi_bootloader_filename branch from 0459d0d to 2c33e2b Compare July 1, 2024 15:24
@jrha jrha added this to the 25.next milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants