Prevent users from composing a VM if we know it will fail due to missing image

Bug #1989985 reported by Adam Vest
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned

Bug Description

In the MAAS web UI, if you do not have a commissioning release image available (this can happen if you cancel the image import on first login, skip the setup process, and disable automatic image syncing), it will let you compose an orphan VM on a virsh KVM host.

In the interface under such conditions, if you navigate to your virsh host and compose a machine using whatever resource allocations you wish, once you click Compose, you will see on the virsh host that the VM is created using whatever name you provided (or the random name that MAAS had chosen) in a powered-off stated. However, after this process, the MAAS interface will complain:

Error:
Pod unable to compose machine: ['Ephemeral operating system ubuntu focal is unavailable.']

The MAAS interface will cancel the process and not display any new VM's on the dashboard, yet there is now an orphaned VM that is created on the virsh host (orphaned in the sense that it does not show on the MAAS dashboard, so the user may not have any immediate knowledge that the machine was actually created anyway). You can click the Compose button as many times as you'd like here as well, and it will continue to create new orphaned VM's on the virsh host. Of course, once/if you download a compatible commissioning image and click Take Action->Refresh, then all of those VM's will pop into the dashboard.

I believe this function should be blocked from working at all if there is no available commissioning image to prevent this from happening.

Tested against the latest snap version of MAAS on Ubuntu Jammy:
root # snap list
Name Version Rev Tracking Publisher Notes
core18 20220831 2566 latest/stable canonical✓ base
core20 20220318 1405 latest/stable canonical✓ base
lxd 5.0.0-b0287c1 22923 5.0/stable/… canonical✓ -
maas 3.2.5-12014-g.da4969479 23696 3.2/stable canonical✓ -
maas-cli 0.6.8 79 latest/stable canonical✓ -
maas-test-db 12.4-24-g.8add233 105 3.2/stable canonical✓ -
snapd 2.55.3 15534 latest/stable canonical✓ snapd

root # cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Changed in maas:
status: New → Triaged
summary: - MAAS race condition when composing VM for virsh
+ Prevent users from composing a VM if we know it will fail due to missing
+ image
Changed in maas:
importance: Undecided → Low
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
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.