Cannot select distro_series using API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Lee Trager |
Bug Description
Trying to use deploy API to deploy something other than default distro (esxi 6.7 in this example). No errors reported, but the distro deployed is always the default (bionic). See api.out in attached file.
Using CLI, selecting esxi/6.7 distro results in error message with usage that conflicts with what "maas {PROFILE} boot-resources read" reports as the name.
$ maas admin machine deploy 7rq3a3 distro_
{"distro_series": ["6.7 in distro_series does not match with operating system esxi"]}
$ maas admin boot-resources read|jq -r '.[]|select(
{
"id": 122,
"type": "Uploaded",
"name": "esxi/6.7",
"architecture": "amd64/generic",
"resource_uri": "/MAAS/
"subarches": "generic",
"title": "VMware ESXi 6.7"
Meanwhile, just selecting esxi OR 6.7 works
$ maas admin machine deploy 7rq3a3 distro_series='6.7'
Success.
Machine-readable output follows:
{
"boot_
"params": "",
"vlan": {
...
From Doc:
API URL: POST /MAAS/api/
(from https:/
Example of using deploy API using URL from docs: (note: Have tried multiple iterations of distro_series, e.g. xenial, ubuntu/xenial, 6.7, esxi, etc)
#!/usr/bin/env python
import json
from requests import Request, Session
from requests_oauthlib import OAuth1
auth1 = OAuth1(
headers = {'Accept': 'application/json'}
url = u'http://
body = json.dumps(
headers = {'Content-Type': 'application/json',
s = Session()
req = Request('POST', url, data=body, headers=headers, auth=auth1)
prepped = req.prepare()
resp = s.send(prepped)
print(resp.text)
Related branches
- Newell Jensen (community): Approve
-
Diff: 13 lines (+3/-0)1 file modifiedsrc/maasserver/api/machines.py (+3/-0)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Lee Trager (ltrager) |
tags: | added: api |
Changed in maas: | |
milestone: | none → next |
status: | Triaged → Fix Committed |
Changed in maas: | |
milestone: | next → 2.7.0b1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
MAAS tracks keeps the operating system and distro series as separate variables. So the command should be
$ maas admin machine deploy 7rq3a3 osystem='esxi' distro_series='6.7'
For some reason the osystem parameter wasn't documented, I've added that.