← Back to team overview

maas-devel team mailing list archive

Re: Idea for dynamic/static IP allocation

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/05/14 02:31, Ryan Harper wrote:
> * Julian Edwards <julian.edwards@xxxxxxxxxxxxx> [2014-05-05
> 19:00]:
>> On 06/05/14 02:50, Ryan Harper wrote:
>>> 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
>> 
>> Can you elaborate on this?  The lease file is cleaned every hour
>> or so and expired leases are removed.
> 
> I don't have it handy, but some googling about pruning the lease
> file revealed a discussion on why the leases file wasn't pruned by
> dhcpd; and the response was because they wanted to keep them around
> to hand them out again.  This of course is in the context of
> physical machines.

The leases file definitely gets pruned, I just read dhcpd's source
code.  If you want to see yourself, grab it and look for
LEASE_REWRITE_PERIOD (which defaults to an hour).

However, I've seen some people say that the dhcpd started for maas
doesn't rotate the leases file properly and that there's some
permission errors in the log file.  This could be why the leases file
is getting huge, so can you confirm if you're seeing those sorts of
errors?

>> If the LXC is shut down correctly, dhcpc will release the lease.
>> If the LXC is just ripped out, then the zombie lease will exist
>> until it expires.
> 
> In our case, we run juju destroy-environment;  it's not clear to me
> if this results in a "clean" lxc shutdown.

I am told it does "lxc-stop" followed by "lxc-destroy".  I think that
does a clean shutdown.

Cheers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlNpl94ACgkQWhGlTF8G/HencACfbqIyynBECk/eRP3o15MpBDSw
YykAoI2OcZ+vgzhvY8rbCgAF2Zh7T18O
=ilI0
-----END PGP SIGNATURE-----


References