dhcp snippet create fail when dhcp subnet is relayed

Bug #1809939 reported by Alexander
30
This bug affects 8 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Erlon R. Cruz

Bug Description

We have 2 subnets under MaaS control:
1. 10.70.1.0/24 where rackd is installed
2. 10.80.1.0/24 with dhcp-relay throw 10.70.1.0/24
and I am trying to add dhcp snippet to this subnets.

a) I don't have any problem with 10.70.1.0/24.
ubuntu@maas1:~$ maas admins dhcpsnippets create name=cli_snippet_test value="authoritative;" description="" subnet="10.70.1.0/24"
Success.
Machine-readable output follows:
{
    "name": "cli_snippet_test",
    "description": "",
    "enabled": true,
    "node": null,
    "subnet": {
        "name": "10.70.1.0/24",
        "vlan": {
            "vid": 1101,
            "mtu": 1500,
            "dhcp_on": true,
            "external_dhcp": null,
            "relay_vlan": null,
            "name": "VPC Infrastructure Cloud1",
            "fabric": "XPT_Cloud1",
            "secondary_rack": "8mawdr",
            "space": "INFRA",
            "primary_rack": "7a7ggh",
            "id": 5020,
            "fabric_id": 0,
            "resource_uri": "/MAAS/api/2.0/vlans/5020/"
        },
        "cidr": "10.70.1.0/24",
        "rdns_mode": 2,
        "gateway_ip": "10.70.1.254",
        "dns_servers": [
            "10.70.1.81"
        ],
        "allow_proxy": true,
        "active_discovery": false,
        "managed": true,
        "space": "INFRA",
        "id": 14,
        "resource_uri": "/MAAS/api/2.0/subnets/14/"
    },
    "value": "authoritative;",
    "history": [
        {
            "id": 50,
            "value": "authoritative;",
            "created": "Fri, 28 Dec 2018 00:12:33 -0000"
        }
    ],
    "global_snippet": false,
    "id": 4,
    "resource_uri": "/MAAS/api/2.0/dhcp-snippets/4/"
}

b) but I got an error, when tryed to add snippet to 10.80.1.0/24 configuration and configuration was not changed:
ubuntu@maas1:~$ maas admins dhcpsnippets create name=cli_snippet_test value="authoritative;" description="" subnet="10.80.1.0/24"
Unable to validate DHCP config, no available rack controller connected.

MAAS version: 2.4.2 (7034-g2f5deb8b8-0ubuntu1)

Related branches

Alexander (abelov)
description: updated
Alexander (abelov)
description: updated
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: New → Invalid
Changed in maas:
assignee: nobody → Erlon R. Cruz (sombrafam)
status: Invalid → Confirmed
Changed in maas:
status: Confirmed → Triaged
importance: Undecided → Medium
Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Patches are ready. Just waiting for launcpad repo to be fixed.

Changed in maas:
status: Triaged → Fix Released
Alberto Donato (ack)
Changed in maas:
status: Fix Released → In Progress
Changed in maas:
milestone: none → 3.0-beta4
status: In Progress → Fix Committed
Alberto Donato (ack)
Changed in maas:
milestone: 3.0.0-beta4 → 3.0.0-beta3
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
Andrey Kirilochkin (andreika-mail) wrote :

I have the same behavior on maas 3.2.3. Fix is not working.
The same net config.

Revision history for this message
Patrick Hampson (patrickhampson) wrote :

Confirmed as well in maas 3.2.4. Many subnets / fabrics relayed to a single rack controller.

Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Hi folks, how are you confirming if it's working or not? The way I do is by checking the MAAS dhcpd.conf file[1] to see if has the snippet's config. For my case I can see the new snippet section listed every snippet I create.

           #
           # Subnet DHCP snippets
           #
           # Name: s1
           max-lease-time 100;
           pool {
              # No DHCP snippets for pool

              range 192.168.100.191 192.168.100.254;
           }

This is how I create it[2].

We might be creating the network and the snippets in different ways. If possible, can you
post the output of the following commands (properly adapted to your environment):

PROFILE=admin
MAAS=http://10.10.20.2:5240/MAAS/

maas login $PROFILE $MAAS `cat ~/maas-apikey.txt`

maas $PROFILE networks read
maas $PROFILE dhcpsnippets read
maas $PROFILE fabrics read
maas $PROFILE ipranges read
maas $PROFILE rack-controllers read
maas $PROFILE subnets read
for i in `maas $PROFILE fabrics read | jq ".[]|.id"`; do maas $PROFILE vlans read $i; done

[1] /var/snap/maas/common/maas/dhcpd.conf
[2] https://i.imgur.com/eoICuaO.png

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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