← Back to team overview

maas-devel team mailing list archive

Re: Idea for dynamic/static IP allocation

 

On 03/05/14 01:20, Gavin Panella wrote:
> On 2 May 2014 15:12, Andres Rodriguez <andres.rodriguez@xxxxxxxxxxxxx> wrote:
>>>
>>> That's what happens now. However, it seems that dhcpd treats static
>>> assignments within a dynamic range as advisory only, and will give
>>> them out when it runs low of free addresses.
>>
>>
>> Not really. This is why we are seeing the bugs at this point. The IP's
>> become static on MAAS but never become static on the DHCP server. This is
>> why we see the bugs where the IP listed in the node is not the one that's
>> mapped with DNS, and is being assigned to a different node.  So I guess what
>> I'm trying to say is that this static mapping should be made available to
>> the DHCP server so there's no way that the DHCP gives the same IP to a
>> different host. (Maybe updating the config, or having a .d/ directory with
>> config of static leases?)
> 
> MAAS records the address in its database _and_ writes out a host entry
> to dhcpd via omshell, so the mapping is available to dhcpd. However, it
> seems that dhcpd is using the addresses reserved in these host entries
> when there are no free addresses elsewhere.
> 

Yes, let me re-iterate this.  The same IP *is not* handed out to another
node unless the lease expired first.

The problem stems from having pools that are either too small or only
just big enough for the DHCPD server, which causes it to start
scrambling for new addresses.  If it sees that the only available ones
are ones that were marked as static for a certain MAC, it will ignore
the map and allocate to a new node.

The *only* way we can fix this is to ensure that the host maps are
*outside* of dynamic ranges, which is why Gavin's solution is
necessarily complex.


Follow ups

References