xcat-core icon indicating copy to clipboard operation
xcat-core copied to clipboard

min-lease-time overrides max-lease-time in pxe class of dhcpd.conf

Open po1vo opened this issue 2 years ago • 4 comments
trafficstars

Please see a sample from dhcpd.conf below. max-lease-time in "pxe" class gets overridden by min-lease-time in subnet blocks. See xCAT_plugin/dhcp.pm

...
class "pxe" {
   match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
   ddns-updates off;
   max-lease-time 600;
}
#shared-network !remote! {
  subnet 10.20.1.0 netmask 255.255.255.0 {
    authoritative;
    max-lease-time 43200;
    min-lease-time 43200;
...

po1vo avatar Mar 11 '23 18:03 po1vo

@po1vo Is it not how you would want it? shared-network configuration is more specific than the more general class entries ?

gurevichmark avatar Mar 22 '23 19:03 gurevichmark

I want leases to PXEClients last no longer than the specified max-lease-time 600, otherwise there's no point in having this class. May be adding min-lease-time 600 to "pxe" will solve the issue, i haven't checked.

po1vo avatar Mar 22 '23 19:03 po1vo

You can try modifying the dhcplease attribute in site table to the desired value. Then running makedhcp -n will update dhcpd.conf with the shared-network block lease times set to your desired value.

gurevichmark avatar Mar 22 '23 19:03 gurevichmark

dhcplease defines both min and max values, and the min value overrides max-lease-time in "pxe" class. If this is the intended behavior i have nothing else to say.

po1vo avatar Mar 22 '23 19:03 po1vo