Comment 8 for bug 2036405

Revision history for this message
Robert Varjasi (robert.varjasi) wrote (last edit ):

As you can see the ID 5699 is hidden:

HQ-A root@maas-hq-a:/home/ubuntu# maas admin interface unlink-subnet yyb3ck 556 id=1
{"id": ["'1' is not a valid id. It should be one of: '5699', '5700'."]}
HQ-A root@maas-hq-a:/home/ubuntu# maas admin interface read yyb3ck 556|jq '.links[].id'
5700

And If I try to unlink 5700 as a normal API client (Terraform for example) would do, Its failed:

HQ-A root@maas-hq-a:/home/ubuntu# maas admin interface unlink-subnet yyb3ck 556 id=5700
Success.
Machine-readable output follows:
{
    "tags": [],
    "firmware_version": null,
    "link_speed": 0,
    "sriov_max_vf": 0,
    "id": 556,
    "effective_mtu": 1500,
    "name": "ens4",
    "links": [
        {
            "id": 5705,
            "mode": "link_up",
            "subnet": {
                "name": "oam",
                "description": "",
                "vlan": {
                    "vid": 0,
                    "mtu": 1500,
                    "dhcp_on": true,
                    "external_dhcp": null,
                    "relay_vlan": null,
                    "fabric_id": 0,
                    "id": 5001,
                    "secondary_rack": null,
                    "name": "untagged",
                    "fabric": "fabric-0",
                    "primary_rack": "qxr7ms",
                    "space": "undefined",
                    "resource_uri": "/MAAS/api/2.0/vlans/5001/"
                },
                "cidr": "192.168.104.0/24",
                "rdns_mode": 2,
                "gateway_ip": "192.168.104.254",
                "dns_servers": [
                    "192.168.104.11",
                    "192.168.104.12",
                    "192.168.104.7"
                ],
                "allow_dns": true,
                "allow_proxy": true,
                "active_discovery": false,
                "managed": true,
                "disabled_boot_architectures": [],
                "id": 1,
                "space": "undefined",
                "resource_uri": "/MAAS/api/2.0/subnets/1/"
            }
        }
    ],
    "parents": [],
    "link_connected": true,
    "vendor": "Red Hat, Inc.",
    "type": "physical",
    "discovered": [
        {
            "subnet": {
                "name": "oam",
                "description": "",
                "vlan": {
                    "vid": 0,
                    "mtu": 1500,
                    "dhcp_on": true,
                    "external_dhcp": null,
                    "relay_vlan": null,
                    "fabric_id": 0,
                    "id": 5001,
                    "secondary_rack": null,
                    "name": "untagged",
                    "fabric": "fabric-0",
                    "primary_rack": "qxr7ms",
                    "space": "undefined",
                    "resource_uri": "/MAAS/api/2.0/vlans/5001/"
                },
                "cidr": "192.168.104.0/24",
                "rdns_mode": 2,
                "gateway_ip": "192.168.104.254",
                "dns_servers": [
                    "192.168.104.11",
                    "192.168.104.12",
                    "192.168.104.7"
                ],
                "allow_dns": true,
                "allow_proxy": true,
                "active_discovery": false,
                "managed": true,
                "disabled_boot_architectures": [],
                "id": 1,
                "space": "undefined",
                "resource_uri": "/MAAS/api/2.0/subnets/1/"
            },
            "ip_address": "192.168.104.201"
        }
    ],
    "vlan": {
        "vid": 0,
        "mtu": 1500,
        "dhcp_on": true,
        "external_dhcp": null,
        "relay_vlan": null,
        "fabric_id": 0,
        "id": 5001,
        "secondary_rack": null,
        "name": "untagged",
        "fabric": "fabric-0",
        "primary_rack": "qxr7ms",
        "space": "undefined",
        "resource_uri": "/MAAS/api/2.0/vlans/5001/"
    },
    "interface_speed": 0,
    "system_id": "yyb3ck",
    "product": null,
    "enabled": true,
    "mac_address": "52:54:00:49:64:b1",
    "params": {},
    "numa_node": 0,
    "children": [],
    "resource_uri": "/MAAS/api/2.0/nodes/yyb3ck/interfaces/556/"
}

HQ-A root@maas-hq-a:/home/ubuntu# maas admin interface read yyb3ck 556|jq '.links[].id'
5705

What is ID 5705? And who created and why after I unlinked 5700? That is why it hurts. I cannot properly execute an unlink command because of the hidden ID 5699.