dhcp snippet create fails when dhcp subnet is relayed regression

Bug #1988229 reported by Patrick Hampson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Björn Tillenius

Bug Description

Behavior is similar to LP:1809939

If a DHCP subnet is relayed maas validation does not allow a node DHCP snippet to be created

"Unable to validate DHCP config, no available rack controller connected."

Contrary to original bug report, creating a DHCP snippet for the subnet works:
root@mtlctrl1pit1:/home/phampson# maas admin dhcpsnippets create name=cli_snippet_test value="authoritative;" description="" subnet="R402_A_V4"
Success.
Machine-readable output follows:
{
    "name": "cli_snippet_test",
    "description": "",
    "enabled": true,
    "node": null,
    "subnet": {
        "name": "R402_A_V4",
        "description": "",
        "vlan": {
            "vid": 0,
            "mtu": 1500,
            "dhcp_on": false,
            "external_dhcp": null,
            "relay_vlan": {
                "vid": 0,
                "mtu": 1500,
                "dhcp_on": true,
                "external_dhcp": null,
                "relay_vlan": null,
                "secondary_rack": null,
                "fabric_id": 0,
                "space": "undefined",
                "id": 5001,
                "name": "untagged",
                "fabric": "r211pit1",
                "primary_rack": "kqhmgc",
                "resource_uri": "/MAAS/api/2.0/vlans/5001/"
            },
            "secondary_rack": null,
            "fabric_id": 65,
            "space": "undefined",
            "id": 5067,
            "name": "untagged",
            "fabric": "R402_A",
            "primary_rack": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5067/"
        },
        "cidr": "141.98.219.128/27",
        "rdns_mode": 2,
        "gateway_ip": "141.98.219.129",
        "dns_servers": [
            "1.1.1.1",
            "8.8.8.8"
        ],
        "allow_dns": false,
        "allow_proxy": false,
        "active_discovery": false,
        "managed": true,
        "disabled_boot_architectures": [],
        "id": 55,
        "space": "undefined",
        "resource_uri": "/MAAS/api/2.0/subnets/55/"
    },
    "value": "authoritative;",
    "global_snippet": false,
    "id": 1,
    "history": [
        {
            "id": 40,
            "value": "authoritative;",
            "created": "Thu, 01 Sep 2022 03:53:08 -0000"
        }
    ],
    "resource_uri": "/MAAS/api/2.0/dhcp-snippets/1/"
}

Creating a DHCP snippet for a machine fails
root@mtlctrl1pit1:/home/phampson# maas admin dhcpsnippets create name=cli_snippet_test value="authoritative;" description="" node="mtl2915"
Unable to validate DHCP config, no available rack controller connected.

This was tested on multiple versions of maas:
v3.0.0, v3.2.4

Related branches

Alberto Donato (ack)
description: updated
Revision history for this message
Alberto Donato (ack) wrote :

Could you please paste the output of `maas $profile subnet read $subnet_id` for the relevant subnets?

Changed in maas:
status: New → Incomplete
Revision history for this message
Patrick Hampson (patrickhampson) wrote :

Added additional details to the description. Creating a DHCP snippet attached to a subnet is successful but fails when attaching to a machine. Full output attached.

description: updated
Revision history for this message
Alberto Donato (ack) wrote :

Thanks, could you please also attach the output from

 maas $profile machine read $machine_id

for the node you're trying to attach the snippet to

and from the following query:

 select boot_cluster_ip from maasserver_node where hostname = 'mtl2915'

Changed in maas:
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Patrick Hampson (patrickhampson) wrote :

See attached. It looks like the get_boot_rack_controller method (https://git.launchpad.net/maas/tree/src/maasserver/models/node.py#n5351) is not aware of relay_vlan's for detecting the primary_rack.

Revision history for this message
Björn Tillenius (bjornt) wrote :

That seems to be the case, yes. I'm working on reproducing the issue now.

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → 3.3.0
assignee: nobody → Björn Tillenius (bjornt)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.3.0 → 3.3.0-beta3
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.