New hosts (pre-discovery) try to load bootx64.efi over UEFI

Problem:
I’m new to Foreman, but so far, I’ve successfully created hosts manually and have gotten them to boot and install an OS over the network using UEFI.
The problem I’m having now is with Discovery. I followed the directions for enabling discovery, but I get a tftpd error when the new node gets an IP:

in.tftpd[825999]: RRQ from 10.65.139.148 filename grub2/bootx64.efi
in.tftpd[825999]: sending NAK (1, File not found) to 10.65.139.148

At this point, the PXE booting process completely fails.

I finally discovered that this is because dhcpd is telling this new host to look for the bootx64.efi file, which does not exist in my /srv/tftp/grub2/ directory. I found the relevant lines in /etc/dhcp/dhcpd.conf that is causing this:

} elsif option architecture = 00:07 {
  filename "grub2/bootx64.efi";

If I manually change that to "grub2/grubx64.efi" and restart isc-dhcp-server, then the new host successfully loads the grub menu and subsequent discovery image.

The main problem with this, is that the next time I run foreman-installer, it wipes out this change I made to dhcpd.conf.

Am I missing some config or something that will allow the grubx64.efi file to be loaded for this node?

(The node I’m testing with is a VM on vSphere)

Expected outcome:
The VM should successfully PXE boot using the grubx64.efi file

Foreman and Proxy versions:
Foreman 3.6.1
Foreman-proxy 3.6.1-1+ubuntu2004

Foreman and Proxy plugin versions:
foreman-tasks: 7.2.1
foreman_ansible: 11.2.0
foreman_discovery: 22.0.4
foreman_puppet: 5.1.2
foreman_remote_execution: 9.1.0

Distribution and version:
Ubuntu 20.04.3

Other relevant data:

Hi.

What’s about using a symlink (adapt paths) as workaround?

ln -sr /var/lib/tftpboot/grub2/grubx64.efi /var/lib/tftpboot/grub2/bootx64.efi
2 Likes

@Jan , thanks for the recommendation. I just tried that and it does work. Since I’ve got Foreman installed on Ubuntu though, my paths are a little different:

ln -sr /srv/tftp/grub2/grubx64.efi /srv/tftp/grub2/bootx64.efi

While this method works, I was hoping to get some guidance on what the recommended approach for using UEFI is. Would provisioning with iPXE alleviate this issue?

Looks like your issue was recently fixed: debian grub2: update efi file name to align with new file path · theforeman/puppet-dhcp@e3ef40e · GitHub

The corresponding file on disk is /usr/share/foreman-installer/modules/dhcp/manifests/params.pp provided by foreman-installer package.

You might want to patch this file until latest release of foreman-installer consumes latest release of puppet-dhcp. Or simply keep the symlink until then.

1 Like

Awesome! Thank you very much for that information! Marking this as solved :slight_smile: