Ubuntu 22.04 UEFI booting not working

Problem:
I’m trying to pxe boot some Dell servers with UEFI boot mode and can’t seem to get it to work. I can do BIOS boot with on these servers with PXE Loader: PXELinux and set the DHCP server bootp file to pxelinux.0 and that works fine.

But… when I switch to use the PXE Loader: Grub2 UEFI, on the dhcp server set the boot file to grub2/grubx64.efi, the server starts to boot, and then it tries to reach out to get the ubuntu.iso from the foreman server, and then it gives the error “network unreachable”.

What are the steps needed to get foreman to provision Ubuntu 22.04 on a UEFI enabled server. I can’t seem to find any documentation on this. For some reason I think I need to use Grub2 UEFI setting as that is what seems to be what people say to use for UEFI?

Expected outcome:
Provision Dell server when in UEFI boot mode.

Foreman and Proxy versions:
3.5.1

Distribution and version:
AlmaLinux 8.7

Hey! @wrender

Can you elaborate your BIOS boot setup a bit further:

I am not really familiar with DHCP bootp configurations. But, AFAIK it is a mechanism for your host (the DELL server) to find a DHCP server in your network which provides the host with the necessary boot files (initrd/kernel). In this setup, does the Foreman still act as such DHCP server? Then, your deployment should not really differ from an “normal” Ubuntu deployment, right?

You write that your PXELinux/BIOS deployment works fine - did you also deploy Ubuntu 22.04 with PXELinux/BIOS or just older verions? In case you deploy 22.04 successfully already, do you also see your host (DELL server) trying to download the image from your Foreman?

Last but not least: What templates are you using?
Is it the following for your UEFI deployment? Link

Looking forward to hear from you!

Hi.

From this I assume that GRUB2 can be successfully loaded from TFTP server and it can fetch its configuration from TFTP server?

Your configuration should look similar to this:

menuentry 'Preseed default PXEGrub2 Autoinstall' {                                 
  linuxefi boot/ubuntu-22-04-local-open-f2S3cv7iz6MN-vmlinuz ... url=http://foreman.test:80/pub/installation_media/ubuntu/22.04-x86_64.iso ... autoinstall "ds=nocloud-net;s=http://foreman.test:8000/userdata/" ip=dhcp  ...
  initrdefi boot/ubuntu-22-04-local-open-f2S3cv7iz6MN-initrd                       
} 

The ip=dhcp is mandatory here because this allows configuration of network required to download the Ubuntu ISO from the pub/ directory.

If this fails (network unreachable) then you maybe have some misconfiguration in your network configuration provided via DHCP (gateway? DNS?).

After failed download of Ubuntu ISO you can press any key and you should end up in a shell. Check:

(initramfs) ip a
(initramfs) ip r
(initramfs) cat /etc/resolv.conf

Thanks. I ended up getting this working. I think the problem was I was just using a wrong combination of templates for Ubuntu.

Could you post here what you found to be the correct combination of templates? Thanks man!