Kexec?

Hi there, does anyone know where I can enable kexec for MaaS? I know curtin supports it, but I have no idea how that would be enabled with the way MaaS integrates it. We are also using the packer-maas build repo, so perhaps its done in the preseed configs? Thanks for any help.

-BJ

how do you plan to use kexec, on which machines, and to boot what new kernels from which old ones?

I want to be able to boot into the operating system with whatever kernel the installer uses directly after the install is finished. This is the same way that Talos operates. It’s more about saving a reboot when it’s unnecessary - as the reboots can sometimes take upward of 5+ minutes.

It’d be nice to know how to do it with Centos or Ubuntu, although I don’t think Linux distro matters.

Curtin definitely supports it. I just wasn’t able to find any mention of it in the Maas docs.

I was able to find what appears might be a correct answer from ChatGPT.

To get kexec working with MAAS, you need to follow these steps:

  1. Install the kexec-tools package on the MAAS server using the following command:
sudo apt-get install kexec-tools
  1. Make sure that the kexec kernel image is present in the MAAS images. If not, download the kexec kernel image and add it to the MAAS images.
  2. Edit the MAAS configuration file /etc/maas/maas_local_settings.py and add the following line:
MAAS_PXE_KERNEL_EXTRA_ARGS = "--entry=kexec"

This line adds the --entry=kexec parameter to the MAAS PXE kernel command line.
4. Restart the MAAS services using the following command:

sudo systemctl restart maas-regiond maas-proxy
  1. Now, when you commission or deploy a machine using MAAS, it will use kexec to boot the machine instead of rebooting it.

Note: It is recommended to test the kexec functionality in a lab environment before using it in a production environment.