MaaS API ignores osystem and distro parameters

Bug #1923315 reported by Tom Kivlin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Stamatis Katsaounis

Bug Description

I am trying to call the MAAS API to deploy an OS to a system, but regardless of what I use as the "osystem" and "distro" params, the server appears to ignore them and report that the selected deployment OS is Ubuntu, which of course doesn't support VMFS6.

The API POST request is:

http://{{maas-url}}/MAAS/api/2.0/machines/{{system_id}}/?op=deploy&osystem=esxi&distro=7.0&user_data={{user_data}}

The response body is:
{"storage": ["Mount the root '/' filesystem to be able to deploy this node.", "This node cannot be deployed because the selected deployment OS, ubuntu, does not support VMFS6."]}

If I do a GET on api/2.0/boot-resources/ the response includes the following item:
{
  "id": 29,
  "type": "Uploaded",
  "name": "esxi/7.0",
  "architecture": "amd64/generic",
  "resource_uri": "/MAAS/api/2.0/boot-resources/29/",
  "subarches": "generic",
  "title": "ESXi 7.0"
}

Other POST requests like op=release have worked fine.

MAAS version: 2.9.2 (9165-g.c3e7848d1)

Tags: api

Related branches

Revision history for this message
Tom Kivlin (tomkivlin) wrote :

I have tried with another non-Ubuntu OS and get the same result.

http://{{maas-url}}/MAAS/api/2.0/machines/8qtcnf/?op=deploy&osystem=centos&distro=centos70

returns the following (noting that it refers to ubuntu as the selected deployment OS):

{
  "storage": [
    "Mount the root '/' filesystem to be able to deploy this node.",
    "This node cannot be deployed because the selected deployment OS, ubuntu, does not support VMFS6."
  ]
}

If I use a flat storage layout on that machine instead of VMFS6, the deploy call works, but deploys Ubuntu...

Revision history for this message
Tom Kivlin (tomkivlin) wrote :

OK, couple of things have changed since I opened this.

Firstly, I re-read the main API docs and realised that I needed to pass the parameters as multipart/form-data. I did that but still had the same problem.

Secondly, I noticed that the "distro" parameter needed to be "distro_series". Not sure if I just missed that when I looked before or it changed, or I was looking at an old version of the doc but whatever.

So using http://{{maas-url}}/MAAS/api/2.0/machines/8qtcnf/?op=deploy as the URL for the POST request, with the following form-data worked fine.

|KEY |VALUE|
|osystem |esxi |
|distro_series|7.0 |

Revision history for this message
Alberto Donato (ack) wrote :

Can you please confirm this bug can be closed, or are you still seeing an issue?

tags: added: doc
tags: removed: doc
Changed in maas:
status: New → Incomplete
Revision history for this message
Tom Kivlin (tomkivlin) wrote :

Hi Alberto - this can be closed now. Thanks.

Revision history for this message
Alberto Donato (ack) wrote :

Thanks.

Changed in maas:
status: Incomplete → Invalid
Changed in maas:
status: Invalid → Triaged
assignee: nobody → Stamatis Katsaounis (skatsaounis)
Revision history for this message
Stamatis Katsaounis (skatsaounis) wrote :

I am reopening this old bug since I was able to reproduce it. The problem is that param osystem is completely ignored plus distro param should be distro_series. While the later is a wrong call towards the latest MAAS API as OP found out, the former is a MAAS bug as it should not presenting it as a valid param to users.

Regarding the successful second try, that happened because distro_series was set to a release version which was already present for esxi. But what would happen if for example centos/7.0 was also present? The current implementation of MAAS code might match centos and as a surprise to the user, since osystem is ignored, the machine could be deployed with CentOS.

Changed in maas:
status: Triaged → In Progress
Changed in maas:
importance: Undecided → Medium
milestone: none → 3.5.0
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.5.0 → 3.5.0-beta1
status: Fix Committed → Fix Released
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.