API 2.0 deploy makes machine lose power information

Bug #1569102 reported by Tim Penhey on 2016-04-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Critical
Blake Rouse

Bug Description

Using gomaasapi I was making calls to allocate and then deploy a machine. Allocate worked fine, but deploy would fail as MAAS wouldn't be able to boot due to unknown power information.

Full api response calls here: http://paste.ubuntu.com/15769382/
Displayed here with relevant information:

2016-04-11 22:23:26 TRACE maas controller.go:738 request 3: GET http://192.168.100.2/MAAS/api/2.0/machines/?hostname=untasted-markita
2016-04-11 22:23:26 TRACE maas controller.go:746 response 3: [
    {
        ....
        "owner": "thumper",
        ....
        "hostname": "untasted-markita",
        "power_state": "off",
        "status_name": "Allocated",
        "system_id": "4y3ha3",
        "status": 10,
        "power_type": "virsh",
        "status_message": "(thumper)",
        "netboot": true,
        "status_action": "acquire",
    }
]
2016-04-11 22:23:26 TRACE maas controller.go:680 request 4: POST http://192.168.100.2/MAAS/api/2.0//MAAS/api/2.0/machines/4y3ha3/?op=deploy, params=distro_series=trusty
2016-04-11 22:23:26 TRACE maas controller.go:687 response 4: {
    ....
    "owner": "thumper",
    "hostname": "untasted-markita",
    "power_state": "off",
    "status_name": "Deploying",
    "system_id": "4y3ha3",
    "status": 9,
    "node_type": 0,
    "power_type": "",
    "status_message": "(thumper)",
    "distro_series": "trusty",
    "netboot": true,
    "status_action": "start",
    "osystem": "ubuntu",
    "ip_addresses": [
        "192.168.100.5"
    ],
}

Notice that the power_type went from "virsh" to "".

From the maas.log:

Apr 12 10:23:05 MAAS2 maas.api: [INFO] Request from user thumper to acquire a machine with constraints <QueryDict: {'name': ['untasted-markita']}>
Apr 12 10:23:06 MAAS2 maas.node: [INFO] untasted-markita: Status transition from READY to ALLOCATED
Apr 12 10:23:06 MAAS2 maas.node: [INFO] untasted-markita: allocated to user thumper
Apr 12 10:23:28 MAAS2 maas.interface: [INFO] Allocated automatic IP address 192.168.100.5 for eth0 (physical) on untasted-markita.
Apr 12 10:23:28 MAAS2 maas.node: [INFO] untasted-markita: Status transition from ALLOCATED to DEPLOYING
Apr 12 10:23:28 MAAS2 maas.node: [WARNING] untasted-markita: Unrecognised power type.

From regiond.log - the deploy api call returns 200 OK.

2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/2016:22:23:27 +0000] "GET /MAAS/api/2.0/version/ HTTP/1.1" 200 152 "-" "Go-http-client/1.1"
2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/2016:22:23:27 +0000] "GET /MAAS/api/2.0/users/?op=whoami HTTP/1.1" 200 89 "-" "Go-http-client/1.1"
2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/2016:22:23:27 +0000] "GET /MAAS/api/2.0/machines/?hostname=untasted-markita HTTP/1.1" 200 1639 "-" "Go-http-client/1.1"
2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/2016:22:23:27 +0000] "POST /MAAS/api/2.0/machines/4y3ha3/?op=deploy HTTP/1.1" 200 1626 "-" "Go-http-client/1.1"

Related branches

Changed in maas:
importance: Undecided → Critical
Blake Rouse (blake-rouse) wrote :

This is because of the AdminMachineForm which is resetting the power_type. That means a standard user does not see this issue only administrator users that are trying to deploy.

Changed in maas:
status: New → In Progress
assignee: nobody → Blake Rouse (blake-rouse)
milestone: none → 2.0.0
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers