← Back to team overview

maas-devel team mailing list archive

Static DHCP configs

 

Given the trouble with the OMAPI stuff, I'm trying to get to having a static 
config file instead so that it can be set up once and forgotten about.

Here's what I think will work based on chats I've had with a few people 
(thanks Robie!).  Please can people take a look and correct any mistakes.

Here's the sequence of events:

 1.  When a new provisioning worker is installed, it contacts the MAAS server 
(Avahi, or through a known address).  MAAS auto-configures that worker’s node 
group by auto-allocating an IP range (10.0.0.0/16)
 2.  Alternatively, an admin can manually set up the node group on the MAAS 
server.
 3.  MAAS sets up a celery job targeted at that provisioning worker which 
writes out the required DHCPD config and restarts the DHCPD server.

The static DHCPD config will have to differentiate between architectures of 
the requesting nodes, so that the right PXE boot file can be supplied (or 
faked, in the case of Uboot running on ARM).

Something similar to this config should work:

class "pxe" {
   match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
}
class "uboot-highbank" {
   match if substring (option vendor-class-identifier, 0, 21) = "U-
boot.armv7.highbank";
}
subnet 10.1.0.0 netmask 255.255.0.0 {
       server-name "10.100.0.1";
       next-server 10.100.0.1;
       option tftp-server-name "10.100.0.1";
       option subnet-mask 255.255.0.0;
       option broadcast-address 10.1.255.255;
       option domain-name-servers 1.2.3.4;
       option routers 10.1.0.254;
       range 10.1.0.1 10.1.255.255;
       pool {
               allow members of "uboot-highbank";
               filename "/arm/highbank/empty";
       }
       pool {
               allow members of "pxe";
               filename "/x86/pxelinux.0";
       }
}

In this example, separate ‘classes’ are defined for machines with a different 
vendor-class-identifier, which causes a match in different pool declarations. 
The different pool declarations then set a PXE filename appropriate to that 
hardware.

In the case of the uboot hardware, it doesn’t actually download the file 
because uboot emulates PXE by having its own file embedded.  However, this 
does have the effect of setting the directory in which to find the PXE config 
file.

I'd appreciate any feedback you may have on this.

Cheers.


Follow ups