Unable to PXE boot Discovery Image in UEFI mode ( Legacy is working)

I am currently installing a fresh new foreman in our environment. After successful installation of foreman I have installed Discovery plugin and after that I tried to boot one of our VM’s for discovery process. The discovery process happens in Legacy mode but when I try with UEFI then a grub command line appears. When I use SET command then I can find that it has picked the correct IP and all details. The problem is its not booting with UEFI mode whereas it is working in legacy mode. I tried with all the different settings in the forum. Can anyone please help me with the right process of Installing foreman. Below is the process which I have followed.

  1. Installed foreman on centos 7 as per the official Foreman :: Quickstart
  2. Then I have configured the firewall
    firewall-cmd --permanent --add-port=53/tcp
    firewall-cmd --permanent --add-port=67-69/udp
    firewall-cmd --permanent --add-port=80/tcp
    firewall-cmd --permanent --add-port=443/tcp
    firewall-cmd --permanent --add-port=3000/tcp
    firewall-cmd --permanent --add-port=3306/tcp
    firewall-cmd --permanent --add-port=5910-5930/tcp
    firewall-cmd --permanent --add-port=5432/tcp
    firewall-cmd --permanent --add-port=8140/tcp
    firewall-cmd --permanent --add-port=8443/tcp

firewall-cmd --reload
3. Set up the LDAP which is working fine.

  1. Enable DHCP server to hand out IP addresses and provide PXE/UEFI boot capabilities.
    foreman-installer --enable-foreman-plugin-dhcp-browser
    –foreman-proxy-dhcp-managed true
    –foreman-proxy-dhcp-gateway “10.XXX.XXX.XXX”
    –foreman-proxy-dhcp-interface “eth0”
    –foreman-proxy-dhcp-nameservers “XX.XXX.XXX.XXX,XXX.XXX.XXX.XXX”
    –foreman-proxy-dhcp-range “10.100.XXX.1 10.100.XXX.99”
    –foreman-proxy-tftp true
    –foreman-proxy-tftp-managed true

  2. Set up the Subnet in Subnet section.

  3. Add Host Discovery to Foreman.
    –foreman-proxy-plugin-discovery-install-images=true ( Which is failing and i have to manually install as below)

yum install tfm-rubygem-foreman_discovery
systemctl restart httpd.service

  1. Then Set Administer→ Settings → Provisioning → Default PXE global template entry → Set this to ‘discovery’
  2. Hosts → Provisioning Templates → Push the “Build PXE Default” button
    Now it’s Booting in Legacy mode but not in UEFI.

Can anyone please help me if I am missing anything. I think I am missing something.

Expected outcome:
Discovery Image booting and get the unknown host details.

Foreman and Proxy versions:
Foreman 2.3

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

Found that I am getting the same error as you need to load kernel first. I tried with all the troubleshooting as mentioned in Httpboot provisoning files missing - #5 by lzap.
I can curl and its giving output. http://proxy:8000/httpboot/pxelinux.cfg/default.

In UEFI mode PXELinux is not used, Grub2 should be fetched from the HTTP proxy: /httpboot/grub2/grubx64.efi. Check proxy.log, enable debug, see what exactly it tries to fetch.

Make sure to use the latest grubx64.efi from Fedora, there are many EL7 or Debian builds which will not work, HTTP UEFI boot is a quite new code in Grub2.

1 Like

Finally I found the Issue with Discovery Image. I think this might be useful as its a simple syntax error in codebase of foreman. Please correct me if I am wrong.

  1. After the Initial installation of Foreman and Discovery Image the discovery image fails to boot up. Its due to a “Snippet syntax error” in pxegrub2_chainload as below. This also exists in other snippet like pxegrub_chainload.

There is a ’ which needs to be removed.
This will correct the boot issue. Now the discovery image will boot but will still give an error as below.

  1. This is because of an issue of Grub2 version in which redhat is looking
    1870035 – The "grubx64.efi" provided by latest grub2-efi-x64-2.02-0.86.el7_8.x86_64 package have broken PXE based discovery for EFI systems on Satellite 6.7
    and the possible way is to resolve is downgrade or replace an older version of grubx64.efi under “/var/lib/tftpboot/grub2/grubx64.efi”. I have used 2.02-0.81.el7.

After that I am finally able to boot the discovery image.

1 Like

Oh thanks, we have a patch that fixes it. To be merged soon and we need to backport this into 2.4 and 2.3 as this looks like an important issue.