We've successfully verified the normal LXC shutdown path (lxc-stop -n <name> juju uses) DOES NOT send a DHCPRELEASE packet (verified by running dhcpdump -i juju-br0 on the host). However, injecting a simple init job (upstart or systemd) that does /sbin/ifdown -a --force during shutdown does the trick. Forcefully destroying the host machine (with juju or outside of it) prevents that job in the container from executing, so the proposed fix will only work for non-forceful machine (and environment) destruction. Containers can still be destroyed with --force (in case there are units on them) and the job still works.
We've successfully verified the normal LXC shutdown path (lxc-stop -n <name> juju uses) DOES NOT send a DHCPRELEASE packet (verified by running dhcpdump -i juju-br0 on the host). However, injecting a simple init job (upstart or systemd) that does /sbin/ifdown -a --force during shutdown does the trick. Forcefully destroying the host machine (with juju or outside of it) prevents that job in the container from executing, so the proposed fix will only work for non-forceful machine (and environment) destruction. Containers can still be destroyed with --force (in case there are units on them) and the job still works.