In a HA deployment with 1 region+rack and 1 rack,
the dhcpd.conf file's section 'failover peer' has
IPv4+IPv6 address in 3.0.1 and only IPv4 in 3.0.2
The synthetic reproducer changes the order of IPs
in the maasdb so the IPv6 address has a _lower id_
than then IPv4 address (and thus goes first in the
for-loop in get_ip_address_for_rack_controller()).
(Steps are described in more detail in comment #3.)
# maas-test-db.psql
postgres=# \c maasdb
maasdb=# select id, ip from maasserver_staticipaddress order by id;
id | ip
----+-------------
1 | 10.30.200.2
2 | 10.30.200.3
3 | fc00::2
4 | fc00::3
(4 rows)
maasdb=# update maasserver_staticipaddress set ip='1.2.3.4' where id=4;
UPDATE 1
maasdb=# update maasserver_staticipaddress set ip='fc00::3' where id=2;
UPDATE 1
maasdb=# update maasserver_staticipaddress set ip='10.30.200.3' where id=4;
UPDATE 1
maasdb=# select id, ip from maasserver_staticipaddress order by id;
id | ip
----+-------------
1 | 10.30.200.2
2 | fc00::3
3 | fc00::2
4 | 10.30.200.3
(4 rows)
Verification done on MAAS 3.0.2.
In a HA deployment with 1 region+rack and 1 rack,
the dhcpd.conf file's section 'failover peer' has
IPv4+IPv6 address in 3.0.1 and only IPv4 in 3.0.2
The synthetic reproducer changes the order of IPs address_ for_rack_ controller( )).
in the maasdb so the IPv6 address has a _lower id_
than then IPv4 address (and thus goes first in the
for-loop in get_ip_
(Steps are described in more detail in comment #3.)
Before DB changes:
# maas admin rack-controllers read | jq '.[] | [.system_id, .hostname, (.interface_set[] | .links[] | [.id, .ip_address, .subnet.vlan.id])]' srv-30snap" , srv-peer- 30snap" ,
[
"hy37ba",
"maas-
[
1,
"10.30.200.2",
5001
],
[
3,
"fc00::2",
5001
]
]
[
"8meq3e",
"maas-
[
2,
"10.30.200.3",
5001
],
[
4,
"fc00::3",
5001
]
]
DB changes:
# maas-test-db.psql staticipaddress order by id;
postgres=# \c maasdb
maasdb=# select id, ip from maasserver_
id | ip
----+-------------
1 | 10.30.200.2
2 | 10.30.200.3
3 | fc00::2
4 | fc00::3
(4 rows)
maasdb=# update maasserver_ staticipaddress set ip='1.2.3.4' where id=4; staticipaddress set ip='fc00::3' where id=2; staticipaddress set ip='10.30.200.3' where id=4;
UPDATE 1
maasdb=# update maasserver_
UPDATE 1
maasdb=# update maasserver_
UPDATE 1
maasdb=# select id, ip from maasserver_ staticipaddress order by id;
id | ip
----+-------------
1 | 10.30.200.2
2 | fc00::3
3 | fc00::2
4 | 10.30.200.3
(4 rows)
maasdb=# \q
After DB changes:
# maas admin rack-controllers read | jq '.[] | [.system_id, .hostname, (.interface_set[] | .links[] | [.id, .ip_address, .subnet.vlan.id])]' srv-30snap" , srv-peer- 30snap" ,
[
"hy37ba",
"maas-
[
1,
"10.30.200.2",
5001
],
[
3,
"fc00::2",
5001
]
]
[
"8meq3e",
"maas-
[
2,
"fc00::3",
5001
],
[
4,
"10.30.200.3",
5001
]
]
MAAS 3.0.1:
# snap list maas g.82c730c57 28871 3.0/stable canonical✓ -
Name Version Rev Tracking Publisher Notes
maas 3.0.1-10052-
Enable DHCP with HA:
root@maas- srv-30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
primary;
address 10.30.200.2;
peer address fc00::3;
max-
max-
load balance max seconds 3;
mclt 3600;
split 255;
}
root@maas- srv-peer- 30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
secondary;
address fc00::3;
peer address 10.30.200.2;
max-
max-
load balance max seconds 3;
}
Disable/Re-enable DHCP with HA (switch the order of servers for testing purposes):
root@maas- srv-30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
secondary;
address 10.30.200.2;
peer address fc00::3;
max-
max-
load balance max seconds 3;
}
root@maas- srv-peer- 30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
primary;
address fc00::3;
peer address 10.30.200.2;
max-
max-
load balance max seconds 3;
mclt 3600;
split 255;
}
MAAS 3.0.2:
# snap refresh --channel=3.0/edge maas g.089ec66c2 33607 3.0/edge canonical✓ -
# snap list maas
Name Version Rev Tracking Publisher Notes
maas 3.0.2-10056-
Enable DHCP with HA:
root@maas- srv-30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
primary;
address 10.30.200.2;
peer address 10.30.200.3;
max-
max-
load balance max seconds 3;
mclt 3600;
split 255;
}
root@maas- srv-peer- 30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
secondary;
address 10.30.200.3;
peer address 10.30.200.2;
max-
max-
load balance max seconds 3;
}
Disable/Re-enable DHCP with HA (switch the order of servers for testing purposes):
root@maas- srv-30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
secondary;
address 10.30.200.2;
peer address 10.30.200.3;
max-
max-
load balance max seconds 3;
}
root@maas- srv-peer- 30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
primary;
address 10.30.200.3;
peer address 10.30.200.2;
max-
max-
load balance max seconds 3;
mclt 3600;
split 255;
}
Disable/Re-enable DHCP with HA (switch the order of servers for testing purposes):
root@maas- srv-30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
primary;
address 10.30.200.2;
peer address 10.30.200.3;
max-
max-
load balance max seconds 3;
mclt 3600;
split 255;
}
root@maas- srv-peer- 30snap: ~# sudo cat /var/snap/ maas/common/ maas/dhcpd. conf | sed -n '/^failover peer/,/^}/p' vlan-5001" { response- delay 60; unacked- updates 10;
failover peer "failover-
secondary;
address 10.30.200.3;
peer address 10.30.200.2;
max-
max-
load balance max seconds 3;
}