Use an external PXE (DHCP+TFTP) subsystem for UEFI-based hosts installation

We build our BIOS-based hosts by Satellite using an external PXE subsystem (DHCP+TFTP) because we have a multi-use menu system, used also for other reasons.
It uses pxelinux.0 as bootloader and a menu with an entry to chain to Satellite:

LABEL Satellite
        MENU LABEL Satellite
        KERNEL pxechain.com
        APPEND 10.61.0.199::pxelinux.0

Now I’m trying to do same thing for UEFI-based servers, using grub2 (or any other bootloader) but I’m unable to find a method to chain to Satellite. Any help?

Just a quick question @Mimmus,

Have you tried this: https://docs.theforeman.org/master/Provisioning_Guide/index-foreman.html#creating-hosts-with-uefi-http-boot-provisioning_provisioning

No, @mcorr, it sounds interesting but problem is always that I don’t know how to configure external DHCP+TFTP to have a menu entry to point to Satellite.

Thanks again

We don’t ship or test any configuration or workflow utilizing this kind of chainbooting. Just try PXELinux EFI, it’s shipped with Fedora in syslinux-efi64-6.04 package, unfortunately you will not find it in EL7.

PXELinux-EFI works but unfortunately no chainloading is supported.

I have to dismiss my menu-based PXE server and point DHCP directly to Satellite every time I need to build a UEFI bare-metal host.

I don’t think so.

Grub2 has a powerful shell-like scripting language. You can do quite something with it. How about:

  • grub2 is loaded using PXE/UEFI or HTTP UEFI
  • grub2 loads its configuration
  • one of the entry is customized by you “Load menu from a different server”

Now, you can easily dismiss the current menu and replace it with a new menu from Satellite or any source actually. I am assuming you want to load from Foreman/Satellite Proxy/Capsule.

set root=(tftp,192.168.1.1)
source /grub2/grub.cfg

The first statement sets root variable to the new TFTP server (you can probably even use hostname). The second is similar to bash - load and evaluate a “script”. Once those statements get evaluated, since root is now correct it will perform various other things like trying to load customized MAC based configuration, the template is here:

Alternatively if TFTP is not the option, you can enable HTTPBoot feature on the Proxy/Capsule and then do:

set root=(http,hostname)
source (http,hostname)/httpboot/grub2/grub.cfg

It will do the same but over HTTP, for this you make sure you have grubx64.efi from the latest RHEL 7.9, HTTP had some bugs which we recently fixed.

It sounds interesting!
But I have the opposite need: i have a DHCP/TFTP server, with the menu-system and I need an entry to “forward” to Satellite/Capsule default menu.
I was able to boot UEFI using grub2 and to create a menu by grub.cfg config file but I have some troubles to build an entry for Satellite:

menuentry 'Satellite' {
  set root=(tftp,10.61.0.199)
  set prefix=(tftp,10.61.0.199)/grub2
  source /grub2/grub.cfg
}

What other config options do I need to insert?

OK, after enabling my operating system in PXEGrub2 template, IT WORKS!

Thank you very much