Project

General

Profile

Actions

Feature #8824

closed

Update dhcp record on host build state changed and disable PXE for hosts successfully built

Added by Baptiste Agasse over 9 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The current behaviour in foreman for dhcp record updates is:

  • When we create new host or update it network configuration, foreman tell to the dhcp smart proxy to update the 'host' record.

The created/updated record look like this:

host foobar.baz.example.com {
  dynamic;
  hardware ethernet 52:54:00:xx:xx:xx;
  fixed-address 192.168.0.90;
        supersede server.filename = "pxelinux.0";
        supersede server.next-server = c0:a8:00:03;
        supersede host-name = "foobar.baz.example.com";
}

So when we boot the 'foobar.baz.example.com', if we are in 'build mode' (with kickstart installation), the TFTP server have a specific version of the pxe config for this host with a link to the kickstart etc in order to install the host. When the install finish, foreman is notified that the host is successfully built and the pxe config on the TFTP server is modified to use a default pxe menu with only local boot. The dhcp record is not modified when the host goes from 'build mode' to 'normal mode' (or from 'normal mode' to 'build mode' again).

With this modification, the dhcp record is updated when the 'build' boolean of the host is modified too. If the host is in 'build mode' the default dhcp record is used. If the host is not in 'build mode', the dhcp record will be the following:

host foobar.baz.example.com {
  dynamic;
  hardware ethernet 52:54:00:xx:xx:xx;
  fixed-address 192.168.0.90;
        supersede server.filename = "";
        supersede server.next-server = "";
        supersede host-name = "foobar.baz.example.com";
}

This disable the PXE boot for the current host and then bypass the following steps:
  • The dhcp server provide params
  • The host download wmlinuz and initrd on the TFTP server
  • The host print the PXE boot menu

The result is a faster boot when the host is installed and don't ask and download vmlinuz and initrd files on the network for local boot.

In more general usecase, if we use the discovery plugin or other default pxe configuration:
  • If you boot the host in build mode, you get the 'install' pxe boot with the kicstart etc..
  • If you boot the host in 'normal' mode (host successfully installed), pxe boot is disabled (the dhcp server don't provide you 'filename' and 'nextserver', so the boot process go ahead (commonly on your local disk)
  • If you boot an unknown host, this host don't have a dhcp record, so it will use the defaults defined for it subnet or the global defaults (boot on discovery image if discovery plugin is configured)

Tested with foreman 1.7.1 and ISC DHCP server.

Actions

Also available in: Atom PDF