← Back to team overview

maas-devel team mailing list archive

Re: Idea for dynamic/static IP allocation

 

On 06/05/14 23:38, Bjorn Tillenius wrote:
> On Tue, May 06, 2014 at 09:58:02AM +1000, Julian Edwards wrote:
>> On 06/05/14 02:21, Bjorn Tillenius wrote:
>>> I don't think having pools too small is the problem here. For example,
>>> I'm looking at our test lab. There are 15 machines there and each time
>>> we deploy openstack we create around 10 LXCs. At any given time we use
>>> maybe at most 30 ip addresses. Yet dhcpd.leases contains more than 1000
>>> host entries. I wouldn't say that our IP pool is too small.
>>>
>>> I think it's more a problem that no cleanup is done to remove host
>>> entries for LXCs that are gone.
>>
>> MAAS already cleans up host entries that it created for nodes that it
>> knows about.
>>
>> Do you mean old leases hanging around?  If so this may well be caused by
>> LXCs not getting cleanly shut down.
> 
> There are old host and lease entries in the dhcp.leases files. Here's an
> example:
> 
>     lease 10.96.3.31 {
>       starts 1 2014/04/14 07:05:19;
>       ends 1 2014/04/14 19:05:19;
>       tstp 1 2014/04/14 19:05:19;
>       cltt 1 2014/04/14 07:05:19;
>       binding state free;
>       hardware ethernet 00:16:3e:cf:df:95;
>     }
> 
>     host 10.96.3.31 {
>       dynamic;
>       hardware ethernet 00:16:3e:cf:df:95;
>       fixed-address 10.96.3.31;
>     }

Right, so the host entry is permanent until the node is deleted from
inside MAAS, at which point it would remove the host entry too.

> We clean up test runs by shutting down the MAAS nodes. It would be good
> if MAAS could handle that, rather than requiring us to wait for the LXCs
> to shut down cleanly. And will that really clean up the host entry?

The lease blocks are entirely under the control of the dhcpd.  It's
supposed to prune the file occasionally.  MAAS has absolutely no control
of these, unless we write a purpose-built dhcp server.

One of the problems we have is that juju creates containers inside the
maas nodes, and maas knows nothing about these at all.  That means that
IP addresses for containers won't get a host map.

Anyway, the team is actively discussing ways to work around this
problem, but it's not an easy one to solve.

J.


References