Applying storage layout does not always work for Allocated machines

Bug #1928623 reported by Caleb Ellis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Committed
Medium
Peter Makowski
3.4
Fix Committed
Undecided
Peter Makowski
maas-ui
Fix Committed
Medium
Peter Makowski

Bug Description

This is on 3.0.0~rc1 from the UI, calling the machine.apply_storage_layout websocket method.

Applying a storage layout doesn't seem to work properly for "Allocated" machines - the disks are partitioned correctly but the partitions are not formatted or mounted anywhere. The websocket call is successful and there is no error reported. The machine ends up with `detected_storage_layout: "unknown"` instead of whatever was chosen. This doesn't seem to be the case for "Ready" machines, in which the storage layout is changed successfully, and the partitions are mounted properly. This happens for both LXD and virsh machines.

Related branches

Alberto Donato (ack)
Changed in maas:
milestone: none → 3.0.0-rc1
Alberto Donato (ack)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Alberto Donato (ack) wrote :

This affects API as well as UI.

If the machine is acquired, partition filesystems created from the storage layouts are not returned from "maas $profile partitions read"

The reason is the logic in maasserver.utils.storage:get_effective_filesystem(), which has the following comment:

A `BlockDevice` or `Partition` can have up to two `Filesystem` one with
`acquired` set to False and another set to `True`. When the `Node` for
`model` is in an allocated state the acquired `Filesystem` will be used
over the non-acquired `Filesystem`.

Filesystems created by storage layouts are never marked as acquired, so they're never returned if the machine is acquired.
I'm not exactly sure about the logic behind this, and whether this is intentional or a bug.

Alberto Donato (ack)
Changed in maas:
assignee: nobody → Alberto Donato (ack)
status: Triaged → In Progress
Alberto Donato (ack)
Changed in maas:
milestone: 3.0.0-rc1 → 3.0.1
Alberto Donato (ack)
Changed in maas:
status: In Progress → Triaged
milestone: 3.0.1 → none
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

Both the API and the UI should disallow these modifications on Allocated machines.

Changed in maas:
milestone: none → 3.4.0
tags: added: ui
Changed in maas-ui:
importance: Undecided → Unknown
Changed in maas-ui:
milestone: none → 3.4.0
importance: Unknown → Medium
status: New → Triaged
assignee: nobody → Peter Makowski (petermakowski)
Revision history for this message
Thorsten Merten (thorsten-merten) wrote :

This seems to need a back-end change first. Peter, can check if the front-end needs updating once Alberto is done with the back-end?

Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
tags: removed: ui
Revision history for this message
Peter Makowski (petermakowski) wrote (last edit ):

Based on what's been said here already, it seems like the back-end should return null or an empty list as allowable storage layouts for machines with Allocated status. This will allow disabling the dropdown if the list is empty.

There's a related issue that describes this in more detail: https://github.com/canonical/maas-ui/issues/3258

As a temporary fix this action can be manually disallowed in the UI for allocated machines.

Revision history for this message
Peter Makowski (petermakowski) wrote :

Change in the UI has been made in https://github.com/canonical/maas-ui/pull/5136

Revision history for this message
Peter Makowski (petermakowski) wrote :
Changed in maas:
status: Triaged → In Progress
Changed in maas-ui:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Triaged
Changed in maas-ui:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.4.x → 3.5.0
status: Triaged → Fix Committed
assignee: Alberto Donato (ack) → Peter Makowski (petermakowski)
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.