MAAS metadata_url contains a domain name even when DNS resolution is disallowed

Bug #2037420 reported by Ghadi Rahme
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Jacopo Rota

Bug Description

[MAAS Version]
Tested on MAAS snap 3.4/edge (v:3.4.0-14305-g.3c4f0ec35 R:30809)
Ubuntu 22.04

[Description]
Installing MAAS 3.4/edge and enabling DHCP will cause machines to fail commissioning with the following error:

cloudinit.sources.DataSourceNotFoundException() Did not find any data source

After further investigation, it turns out that the metadata URL being shared by MAAS to the machines contained a domain name instead of the MAAS server IP address.

Expected URL (for my setup):
http://192.168.122.243:5248/MAAS/metadata/

Actual (bad) URL:
http://192-168-122-0--24.maas-internal:5248/MAAS/metadata/

The option "Allow DNS resolution" in MAAS is disabled and no DNS servers are specified in MAAS. This means that even when using an external DNS server MAAS will keep sending the URL with the domain name which will fail to resolve and cause the commissioning to fail.

All testing was done in libvirt/KVM VMs

[Work Around]
I was able to work around the issue by adding a DNS entry to my home DNS pointing to the MAAS server and modifying the libvirt network to use that DNS instead.

Related branches

Revision history for this message
Jacopo Rota (r00ta) wrote :

we use domain name if
```
def _subnet_uses_dns(subnet):
    return (
        subnet is not None
        and not subnet.dns_servers
        and (subnet.vlan.dhcp_on or subnet.vlan.relay_vlan_id is not None)
    )
```

and this is why in your case we don't return the rack IP directly. We should add a check on the `allow_dns`. I'll fix this

Changed in maas:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Jacopo Rota (r00ta)
Revision history for this message
Jacopo Rota (r00ta) wrote :
Changed in maas:
status: Triaged → In Progress
milestone: none → 3.5.0
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.5.0 → 3.5.0-beta1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.