I have 2 rack controllers where I want to configure DHCP HA (rack1, rack2). If I try to configure a secondary when the primary server is unavailable, the secondary will never respond the DHCP requests, even though it is correctly configured.
How to reproduce
================
1. Configure rackd1 as primary DHCP server for a VLAN, but do not configure a secondary(e.g: maas admin vlan update 1 3000 dhcp_on=True primary_rack=ntkhf7 )
2. Stop rackd1 (e.g. sudo service maas-rackd stop)
3. Configure rackd2 with the same primary and a different secondary (maas admin vlan update 1 3000 dhcp_on=True primary_rack=ntkhf7 secondary_rack=syxs8y)
4. Try to commission a machine
5. Machine won't PXE boot
Proposed solution
==================
There's one of two options:
1. When attempting to configure a secondary rack controller when the primary is down, MAAS should prevent the user from doing so, because the secondary will never answer requests until the first time it syncs with a primary (in this case, it never did).
2. When configuring a secondary rack controller when the primary is down, always make that secondary rack controller the primary regardless, so that DHCP works. Once the primary comes back (if it ever does), then the previous primary would become secondary.
We do not model wanted state vs current state, which would be a requirement to solve this the way you are describing. Its a rather big change and not a simple bug fix.