DHCP addresses for containers should be released on teardown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned | ||
juju-core |
Fix Released
|
High
|
Dimiter Naydenov | ||
1.24 |
Fix Released
|
High
|
Dimiter Naydenov |
Bug Description
We've noticed a problem in the Garage MAAS where the number of container IPs leased and no longer used, but unreleased, clogs up DHCP. Containers get their IP address from DHCP, when they die that IP address could be released but unless it's told to do so the DHCP server tries to keep the IP address reserved for 8 hours.
dhclient can release IP addresses:
dhclient -r
In cases where a container is being destroyed, it would be polite to explicitly release the leases assigned to it.
And of course MAAS needs to notice and free up the lease when the container signals it to do so.
This may be just as applicable to full machines as it is to containers. Essentially, Juju is in the privileged position of knowing that the machine is *going away* conceptually, not just rebooting or shutting down temporarily. If it sent a DHCP Release message, the resources consumed would be immediately available for another machine.
I don't believe that normal ifupdown scripts or network-manager scripts use DHCP Release at all - I see no logged messages to that effect on my home network, but I may be wrong.
This will need careful consideration as to timing - the machine may need to access the network on its way down as part of unmounting network drives or terminating services. So we can't just turn its network off. But we should try to find an elegant way of releasing the IP addresses as a final step on the way out before we turn out the lights.
tags: | added: oil |
tags: |
added: network removed: networking |
Changed in juju-core: | |
milestone: | 1.21 → 1.22 |
Changed in juju-core: | |
milestone: | 1.22-alpha1 → 1.23 |
Changed in juju-core: | |
milestone: | 1.23 → 1.24-alpha1 |
Changed in juju-core: | |
importance: | High → Critical |
Changed in juju-core: | |
milestone: | 1.24-alpha1 → 1.25.0 |
Changed in juju-core: | |
assignee: | Dimiter Naydenov (dimitern) → Michael Foord (mfoord) |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
If we call ifdown on the way to shutdown or reboot of a container, then it might be we can set a flag which will make ifdown send the dhcp release message.