Link subnet on new machine

Bug #1990383 reported by Alexander Birkner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Björn Tillenius

Bug Description

I am using MAAS 3.2 at the moment and I am trying to add existing (already provisioned) machines to migrate to MAAS step by step.

I am adding existing machines with using "deployed: true" and "comission: false" via the API. So far so good. Next time I wanna re-install that specific machine I will do this task by using MAAS instead of using our old provisioning system.

So a will release that machine, the machine goes into the state "New" after this, which is fine. Since the machine wasn't commissioned via MAAS until that point I will now add the subnet to the primary interface.

In the UI that works fine during the state "New" but doing the same task via API I receive the error "409 Conflict (Cannot link subnet interface because the machine is not Ready, Allocated, or Broken.)".

I found the specific line on https://github.com/maas/maas/blob/a9e9029d0153a938e5a73b9d1de5b59252e64c6a/src/maasserver/api/interfaces.py#L879, it seems there should be the state "New" added to extra_states for allowing this.

Does the UI not using the same API endpoints or why is it working?

Regards
Alexander

Related branches

Revision history for this message
Alexander Birkner (tyrola) wrote :

Tested that patch on my instance, "works on my machine".

Revision history for this message
Christian Grabowski (cgrabowski) wrote :

To make sure I understand the state of the machine at that time, it is New, and hasn't been commissioned by MAAS at all yet? If that's the case, it's actually the UI's behavior that is erroneous.

The UI uses the websocket handlers found in src/maasserver/websockets/handlers/ while the API uses the REST API handlers found in src/api, so yes behavior may differ, some times deliberately, but that is not the case here.

Changed in maas:
status: New → Incomplete
Revision history for this message
Alexander Birkner (tyrola) wrote :

Correct, the reason is, we have a self-made provisioning system for our end customer servers. This should be replaced with MAAS, but for sure we can't just reboot and commission our existing hardware machines.

The idea is to add them to MAAS in the state "deployed", as soon the user wants to re-install his machine, I will trigger the release operation via API - which does nothing for now.

Since the machine has never been commissioned via MAAS the machine then enters the "New" state instead of "Ready" after releasing it. And now I am able to finally commission the system but before I can trigger this via API the network interface needs a subnet assigned. But since the state is "New" I can't assign an subnet via API, on the UI it's working fine (and the commissioning works too after this).

Revision history for this message
Alexsander de Souza (alexsander-souza) wrote :

the UI allows the user to configure a network interface on a selected node if:

- node permissions include edit
- it isn't locked
- node has a status new/ready/failed testing/allocated/broken

The REST API should allow this operation in the same conditions

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
tags: added: bug-council
Changed in maas:
milestone: none → 3.3.0
tags: removed: bug-council
Changed in maas:
assignee: nobody → Björn Tillenius (bjornt)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.3.0 → 3.3.0-beta3
Changed in maas:
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.