xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
363 stars 171 forks source link

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

Open po1vo opened 1 year ago

po1vo commented 1 year ago

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;
...
gurevichmark commented 1 year ago

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

po1vo commented 1 year ago

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.

gurevichmark commented 1 year ago

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.

po1vo commented 1 year ago

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.