Devices API: claim-sticky-ip-address should return an error when it fails

Bug #1470930 reported by Michael Foord
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Won't Fix
High
Unassigned

Bug Description

Using the device api with claim-sticky-ip-address I get a success response, but no new ip address on the device:

$ maas maas device claim-sticky-ip-address node-01b8aa28-1a8b-11e5-bb31-5254007aefcf
Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-01b8aa28-1a8b-11e5-bb31-5254007aefcf/macs/00%3Aa0%3Ac9%3A14%3Ac8%3A31/",
            "mac_address": "00:a0:c9:14:c8:31"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": null,
    "ip_addresses": [],
    "hostname": "leading-pollution.maas",
    "tag_names": [],
    "owner": "maas-admin",
    "system_id": "node-01b8aa28-1a8b-11e5-bb31-5254007aefcf",
    "resource_uri": "/MAAS/api/1.0/devices/node-01b8aa28-1a8b-11e5-bb31-5254007aefcf/"
}

Subsequently reading the device also shows an empty ip_addresses.

Using dailybuilds:

$ dpkg -l '*maas*'|cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============================-================================================-============-======================================
ii maas 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server all-in-one metapackage
ii maas-cli 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS command line API tool
ii maas-cluster-controller 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server cluster controller
ii maas-common 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server common files
ii maas-dhcp 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS DHCP server
ii maas-dns 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS DNS server
ii maas-proxy 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS Caching Proxy
ii maas-region-controller 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server complete region controller
ii maas-region-controller-min 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS Server minimum region controller
ii python-django-maas 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server Django web framework
ii python-maas-client 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS python API client
ii python-maas-provisioningserver 1.9.0~alpha1+bzr4013+4056+408~ppa0~ubuntu15.04.1 all MAAS server provisioning libraries

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Michael,

Can you confirm this issue appear sin 1.8 and*not* in 1.9? 1.9 has not been officially released and this side of hte code is being worked on. This means that I'll makr this invalid until confirmed it is actually affecting 1.8 and not 1.9.

Changed in maas:
status: New → Invalid
Revision history for this message
Michael Foord (mfoord) wrote :

I'll install 1.8 on a machine and try it.

Revision history for this message
Michael Foord (mfoord) wrote :
Download full text (3.2 KiB)

With maas 1.8 from the stable PPA (on the server - maas 1.9 client I'm afraid) I see the same result (no ip addresses added after I call claim-sticky-ip-addresses):

$ maas maas devices new hostname=foo mac_addresses=52:54:00:9a:17:24
Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-921c9e0e-216a-11e5-a4e8-5254009e0724/macs/52%3A54%3A00%3A9a%3A17%3A24/",
            "mac_address": "52:54:00:9a:17:24"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": null,
    "ip_addresses": [],
    "hostname": "foo.maas",
    "tag_names": [],
    "owner": "maas-admin",
    "system_id": "node-921c9e0e-216a-11e5-a4e8-5254009e0724",
    "resource_uri": "/MAAS/api/1.0/devices/node-921c9e0e-216a-11e5-a4e8-5254009e0724/"
}
michael@UbuntuBox:~$ maas maas device claim-sticky-ip-address node-921c9e0e-216a-11e5-a4e8-5254009e0724
Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-921c9e0e-216a-11e5-a4e8-5254009e0724/macs/52%3A54%3A00%3A9a%3A17%3A24/",
            "mac_address": "52:54:00:9a:17:24"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": null,
    "ip_addresses": [],
    "hostname": "foo.maas",
    "tag_names": [],
    "owner": "maas-admin",
    "system_id": "node-921c9e0e-216a-11e5-a4e8-5254009e0724",
    "resource_uri": "/MAAS/api/1.0/devices/node-921c9e0e-216a-11e5-a4e8-5254009e0724/"
}
michael@UbuntuBox:~$ maas maas device claim-sticky-ip-address node-921c9e0e-216a-11e5-a4e8-5254009e0724
Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-921c9e0e-216a-11e5-a4e8-5254009e0724/macs/52%3A54%3A00%3A9a%3A17%3A24/",
            "mac_address": "52:54:00:9a:17:24"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": null,
    "ip_addresses": [],
    "hostname": "foo.maas",
    "tag_names": [],
    "owner": "maas-admin",
    "system_id": "node-921c9e0e-216a-11e5-a4e8-5254009e0724",
    "resource_uri": "/MAAS/api/1.0/devices/node-921c9e0e-216a-11e5-a4e8-5254009e0724/"
}
michael@UbuntuBox:~$ maas maas device read node-921c9e0e-216a-11e5-a4e8-5254009e0724Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-921c9e0e-216a-11e5-a4e8-5254009e0724/macs/52%3A54%3A00%3A9a%3A17%3A24/",
            "mac_address": "52:54:00:9a:17:24"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": null,
    "ip_addresses": [],
    "hostname": "foo.maas",
    "tag_names": [],
    "owner": "maas-admin",
    "system_id": "node-921c9e0e-216a-11e5-a4e8-5254009e0724",
    "resource_uri": "/MAAS/api/1.0/de...

Read more...

Michael Foord (mfoord)
Changed in maas:
status: Invalid → New
Revision history for this message
Raphaël Badin (rvb) wrote :

I need to investigate further but I think I know what this is: if MAAS doesn't know from which IP pool to get an IP from (because there is no parent and no directly connected cluster interface), MAAS will happily return 200 OK to the claim-sticky-ip-address call. So this is a real bug: you should get an error.

Changed in maas:
milestone: none → 1.8.4
status: New → Triaged
Changed in maas:
importance: Undecided → High
milestone: 1.8.4 → next
summary: - Devices API: claim-sticky-ip-address appears not to work
+ Devices API: claim-sticky-ip-address should return an error when it
+ fails
Changed in maas:
milestone: next → 1.9.3
milestone: 1.9.3 → none
no longer affects: maas/1.8
no longer affects: maas/1.9
Changed in maas:
milestone: none → 1.9.2
Changed in maas:
milestone: 1.9.2 → 1.9.3
Changed in maas:
milestone: 1.9.3 → 1.9.4
Changed in maas:
milestone: 1.9.4 → 1.9.5
Revision history for this message
Andres Rodriguez (andreserl) wrote :

We believe this is no longer an issue in the latest releases of MAAS. Please upgrade to the latest version of MAAS, and If you believe this issue is still present, please re-open this bug report or file a new one.

Changed in maas:
status: Triaged → Won't Fix
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.