Andres and I have discussed this further, and he pointed out that the LXCs can take a *long* time to start. That would be sufficient time for us to parse the leases file and update the DNS with a PTR for the new node (option #3).
I've tested this out locally. The LXC container took ~30minutes to start from `juju deploy mysql --to lxc:0`, and it acquired an IP address ~5 minutes before the juju agent showed as started. It was another 5 minutes until the mysql unit showed as started.
This is more than enough time for us to create DNS entries for the container, with a hostname either based on its IP address (e.g. maas-dynamic-1.maas) or based on the client-hostname field in the lease (e.g. juju-machine-0-lxc-0-dynamic.maas). The second is more meaningful, but it's also more code.
Andres and I agreed that this was a better solution than #2 above.
Andres and I have discussed this further, and he pointed out that the LXCs can take a *long* time to start. That would be sufficient time for us to parse the leases file and update the DNS with a PTR for the new node (option #3).
I've tested this out locally. The LXC container took ~30minutes to start from `juju deploy mysql --to lxc:0`, and it acquired an IP address ~5 minutes before the juju agent showed as started. It was another 5 minutes until the mysql unit showed as started.
This is more than enough time for us to create DNS entries for the container, with a hostname either based on its IP address (e.g. maas-dynamic- 1.maas) or based on the client-hostname field in the lease (e.g. juju-machine- 0-lxc-0- dynamic. maas). The second is more meaningful, but it's also more code.
Andres and I agreed that this was a better solution than #2 above.