DNS entries for MAAS servers change to secondary IPs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
Medium
|
Unassigned | ||
3.1 |
Fix Committed
|
Undecided
|
Unassigned | ||
3.2 |
Fix Committed
|
Undecided
|
Unassigned | ||
3.3 |
New
|
Undecided
|
Unassigned | ||
3.4 |
Fix Committed
|
High
|
Alberto Donato |
Bug Description
There is an issue with MAAS that, when you have multiple IP addresses on the same interface, the DNS name for the FQDN of the host can change.
In the scenario were you have MAAS + postgres + HA, you can have 2 IP addresses that are controlled via corosync, and based on where the IP address is, MAAS will automatically create DNS entries, we can see the host resolution[1] and he PTR records [2] as shown. Now the VIPs for maas and postgres are 192.168.210.2 and 192.168.210.3, and hence the FQDN shouldn't really be used for these IP addresses, as ultimately they are secondary.
In a juju deployed environment, in some scenarios we have LMA cross model relations, and the 3 MAAS servers also host telegraf, and then direct their data towards prometheus. This then grabs the IP address of the host as per the relational data (primary interface IP), and grabs the DNS record. In this particular scenario, rather than giving infra1.maas, it will give broam.infra1.maas., which is not the required result.
For a simple reproducer, all you need is a simple MAAS server with single IP address. Then add IP address to the same machine in the same network, and we will see the DNS name of the server fluctuate, below is some output of my reproduced issue on a single MAAS server, noting that each time I am expecting 192.168.1.22 to be my MAAS FQDN
ip a a 192.168.1.8/24 dev eth0
log message in regiond.log
2022-12-15 19:18:05 maasserver.
~~~
root@maas:~# cat /var/snap/
<SNIP>
8 30 IN PTR maas.maas.
<SNIP>
22 30 IN PTR eth0.maas.maas.
~~~
ip a a 192.168.1.7/24 dev eth0
~~~
root@maas:~# cat /var/snap/
<SNIP>
22 30 IN PTR maas.maas.
<SNIP>
7 30 IN PTR eth0.maas.maas.
8 30 IN PTR eth0.maas.maas.
~~~
ip a a 192.168.1.6/24 dev eth0
~~~
root@maas:~# cat /var/snap/
<SNIP
8 30 IN PTR maas.maas.
<SNIP
6 30 IN PTR eth0.maas.maas.
22 30 IN PTR eth0.maas.maas.
7 30 IN PTR eth0.maas.maas.
~~~
As we can see from the above output, we can see the undesired output.
My expectation is that .22 is always maas.maas. in my scenario, as that should be consistent, no matter what the secondary IP address is set
This has been tested in 2.9.2, as well as my lab with 3.2.6
[1] https:/
[2] https:/
### ADDED
As this patch https:/
e.g
assume there is one nic which has 172.16.116.131 as a primary IP.
after adding one more ip to the same nic, zone file refer to secondary IP instead of primary IP.
{<Domain: name=maas>: defaultdict(<class 'maasserver.
I printed info from code, xtrusia.maas had 172.16.116.131 in the beginning, but after I added 172.16.116.254, it is changed to later.
Related branches
- MAAS Lander: Needs Fixing
- Alberto Donato: Approve
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
- MAAS Lander: Approve
- MAAS Maintainers: Pending requested
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
- MAAS Lander: Approve
- MAAS Maintainers: Pending requested
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
- MAAS Lander: Approve
- Support Engineering Sponsors: Pending requested
- MAAS Maintainers: Pending requested
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
- MAAS Lander: Approve
- MAAS Maintainers: Pending requested
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
- Jack Lloyd-Walters: Approve
- MAAS Lander: Approve
- Christian Grabowski: Approve
-
Diff: 54 lines (+31/-1)2 files modifiedsrc/maasserver/models/staticipaddress.py (+2/-1)
src/maasserver/models/tests/test_staticipaddress.py (+29/-0)
Changed in maas: | |
status: | Confirmed → New |
Changed in maas: | |
importance: | Undecided → Medium |
milestone: | none → 3.4.0 |
status: | New → Triaged |
tags: | added: dns |
tags: | added: bug-council |
Changed in maas: | |
milestone: | 3.4.0 → 3.4.x |
Changed in maas: | |
status: | Triaged → Fix Committed |
tags: | removed: bug-council |
Does the boot interface for the host change at any time?