When deploying beta13 with MAAS 2.0 we noticed that juju picks random host's IPs for public address. Therefore juju status will report:
UNIT WORKLOAD AGENT MACHINE PORTS PUBLIC-ADDRESS MESSAGE
ubuntu/0 unknown idle 6 192.168.1.5
ubuntu/1 unknown allocating 7 172.16.10.6 Waiting for agent initialization to finish
While in MAAS logs I can see:
2016-08-23 13:07:46 INFO juju.worker.instancepoller updater.go:269 machine "6" has new addresses: [public:192.168.1.5 public:172.16.10.5]
2016-08-23 13:09:54 INFO juju.worker.instancepoller updater.go:269 machine "7" has new addresses: [public:172.16.10.6 public:192.168.1.6]
Both 192.168.1.x belong to the same space in MAAS. And hostnames of both machines resolve to 192.168.1.x IPs, while 172.16.10.x IPs resolve to 'interface hostnames'.
I would expect consistency and at least have juju pick the public IPs from the same space, one that could be configurable. Or at least fall back to DNS resolution and try to reverse lookup host's hostname.
I've prepared a hotfix patch for Ante to try on site, to verify a was to fix this.
Later a proper fix based on the tests outcome will be proposed.