API 2.0 deploy makes machine lose power information
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
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://
Displayed here with relevant information:
2016-04-11 22:23:26 TRACE maas controller.go:738 request 3: GET http://
2016-04-11 22:23:26 TRACE maas controller.go:746 response 3: [
{
....
"owner": "thumper",
....
"hostname": "untasted-markita",
"status": 10,
"netboot": true,
}
]
2016-04-11 22:23:26 TRACE maas controller.go:680 request 4: POST http://
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_
"distro_
"netboot": true,
"status_
"osystem": "ubuntu",
"ip_addresses": [
],
}
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-
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-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/
2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/
2016-04-12 10:23:28 [-] 127.0.0.1 - - [11/Apr/
Related branches
- Andres Rodriguez (community): Approve
-
Diff: 133 lines (+90/-7)3 files modifiedsrc/maasserver/api/tests/test_machine.py (+23/-0)
src/maasserver/forms.py (+21/-6)
src/maasserver/tests/test_forms_machine.py (+46/-1)
Changed in maas: | |
importance: | Undecided → Critical |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
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.