Feature #12434

Allow override of filename options in DHCP host entry

Added by Tim Verhoeven over 5 years ago. Updated over 4 years ago.

Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:



For me personal this is related to getting UEFI PXE booting to work, but looking at other issues logged this could also be used by other people to play with iPXE e.g.

For the moment Foreman creates an entry in DHCP for each host (if so configured). In this entry the filename is hardcoded to point to "pxelinux.0" in the TFTP root. And I could not find any way to override this value.

I wanted to get UEFI PXE booting to work for my actual servers (IBM Flex nodes) but keep BIOS PXE booting working to to deploy VM's (managed by OpenNebula). So I created this TFTP structure:

  1. ls /var/lib/tftpboot/
    BIOS boot memdisk pxelinux.cfg UEFI
  2. ls /var/lib/tftpboot/BIOS/
    boot chain.c32 linux.c32 menu.c32 pxelinux.0 pxelinux.cfg
  3. ls /var/lib/tftpboot/UEFI/
    boot chain.c32 ldlinux.e64 libutil.c32 menu.c32 pxelinux.0 pxelinux.cfg

The boot and pxelinux.cfg items in the BIOS & UEFI directories are symlinks to the ones in /var/lib/tftpboot. And the UEFI directory contains a pxelinux.0 supporting UEFI from the latest syslinux release.

I've then added this code to the main dhcpd config file:

option architecture-type code 93 = unsigned integer 16;
if option architecture-type = 00:00 {
filename "BIOS/pxelinux.0";
} elsif option architecture-type = 00:09 {
filename "UEFI/pxelinux.0";
} elsif option architecture-type = 00:07 {
filename "UEFI/pxelinux.0";
} else {
filename "BIOS/pxelinux.0";

But because Foreman sets the filename for each hosts this mapping of the filename based on the servertype isn't working. So for the moment I just edited the foreman-proxy code to not write out this option anymore. A very crude fix, but it works for me ;)

The simplest fix would be to somewhere add an option to be able to tell Foreman not to add the filename option to each host entry in DHCP. So that the general settings are followed.

The best to fix it would be to allow to set/override the filename depending on HW type, hostgroup, OS or any of other items present in Foreman.

Related issues

Related to Foreman - Tracker #431: [TRACKER] UEFI PXE supportResolved

Related to Foreman - Feature #12634: New HW Model flag pxe_loader in UI/APIClosed2015-11-30


#1 Updated by Jeff Sparrow almost 5 years ago

Second this issue. We want dhcp to handle if/else statements in dhcpd.conf to pass out filename based on those statements. As it is right now, they are overridden each time.

@tim - if you happen to get notification on this edit, can you tell me what you changed i the foreman-proxy code to stop writing it?

#2 Updated by Lukas Zapletal almost 5 years ago

#3 Updated by Lukas Zapletal almost 5 years ago

  • Assignee set to Lukas Zapletal
  • Priority changed from High to Normal

We are currently working on PXE UEFI support, the patch (#12634) lets you select select "None" PXE Loader which will cause (a) TFTP orchestration to be skipped, (b) DHCP filename option will not be set at all. You can use that for your use case once it is merged.

#4 Updated by Lukas Zapletal almost 5 years ago

  • Related to Feature #12634: New HW Model flag pxe_loader in UI/API added

#5 Updated by Lukas Zapletal almost 5 years ago

  • Status changed from New to Feedback

UEFI support hits nightly, let me know if it fits your case.

#6 Updated by Lukas Zapletal over 4 years ago

  • Status changed from Feedback to Rejected

Tim&Jeff, 1.13 solved both of these issues and now ships with EFI support. I am closing this one.

#7 Updated by Stef Fen over 4 years ago

Hello, we are using Ubuntu 14.04 + Foreman 1.14.2 + puppet and trying to add PXELinux UEFI boot support additional to our PXELinux Bios support.
Since most of our machine still work with a non UEFI PXE request we need to have BIOS still available.
Tthe latest machines require us to set UEFI PXE boot.

With the current implementation we can set for a host PXE Loader to PXELinux UEFI.

This adds supersede server.filename = "pxelinux.efi"; to the DHCP host entry.
We manually added pxelinux.efi to /var/lib/tftpboot from syslinux 6.03 package.

The problem is, that on the tftp root we still have the BIOS version of c32 files, which are not working with UEFI PXE client.
We need at least 1 subdir providing UEFI syslinux files as proposed in this ticket.

From theforeman-dhcp puppet creates dhcpd.conf:

option architecture code 93 = unsigned integer 16 ;
if option architecture = 00:06 {
filename "grub2/bootia32.efi";
} elsif option architecture = 00:07 {
filename "grub2/bootx64.efi";
} elsif option architecture = 00:09 {
filename "grub2/bootx64.efi";
} else {
filename "pxelinux.0";

We need to provide for BIOS and EFI a different menu.c32 and other files. Or am I mistaken here?


Also available in: Atom PDF