← Back to team overview

maas-devel team mailing list archive

Re: Idea for dynamic/static IP allocation

 

Not sure cleanup will be enough:

- lxc containers generate random mac addresses
- dhcpd is designed to keep all MACs around forever in case it can hand the
same IP back to a known host
- dhcp lease time (default is quite large, IIUC to reduce the amount of
dhcp traffic)

Combine this with our lab in OIL which does a new openstack deployment
every 30 minutes 24x7, times 8 runs in parallel (and we'll increase as we
have new customer hardware).

I don't believe there is an easy way to tell dhcpd that an lxc is done with
its IP.  And at the rate of which lxc containers are going to be going up
and down this could create a lot of churn on maas re-writing dhcpd.leases
and/or restarting DHCPd.

Ryan






On Mon, May 5, 2014 at 11:21 AM, Bjorn Tillenius <bjorn@xxxxxxxxxxxxx>wrote:

> On Mon, May 05, 2014 at 12:07:48PM +1000, Julian Edwards wrote:
> > 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.
>
> 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.
>
>
> --
> Björn Tillenius | https://launchpad.net/~bjornt
>
> --
> Mailing list: https://launchpad.net/~maas-devel
> Post to     : maas-devel@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maas-devel
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References