VM Discovery fails, resulting in " Error: An architecture is required." when composing a LXD VM

Bug #1988543 reported by Peter Jose De Sousa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Alberto Donato

Bug Description

Hello,

When adding LXD as a backend in MAAS it will scan all projects (even if one is selected), resulting in a failure. This failure ultimately results in an error when composing machines "Error: An architecture is required.".

 Machine: win10: {
  "iso": {
    "boot.priority": "10",
    "source": "/home/pjds/Downloads/Win10_20H2_v2_EnglishInternational_x64-distrobuilder.iso",
    "type": "disk"
  },
  "root": {
    "path": "/",
    "pool": "default",
    "size": "40GiB",
    "type": "disk"
  }
}

The issue is caused by this line in the LXD driver:

            if source:
                pool = client.storage_pools.get(device["pool"])
                volume = pool.volumes.get("custom", source)

This check will run on the ISO object, failing with a key error, bubbling up to a failure to discover the LXD backend.

Please find the rackd logs here: https://private-fileshare.canonical.com/~pjds/maas-rackd-lxd-issue.log

[To Reproduce]

1. Create a VM with an ISO mounted, as configured above
2. Install, setup MAAS
3. Setup the LXD backend
4. Attempt to compose a VM and observe the error "Error: An architecture is required."

[Workaround]

Scan machines in your LXD cluster with something like

for project in "charmcraft" "default" "demos" "infra" "sandbox" "sandboxing" "ws-sandbox"; do for machine in $(lxc list -f csv --project $project -c n); do echo "Machine: $machine: $(lxc config show --project $project $machine | yq .devices)"; done; done;

and dismount the ISO, remove, and re-add the LXD backend, this should resolve the issue.

Thanks,
Peter

Related branches

description: updated
summary: VM Discovery fails, resulting in " Error: An architecture is required."
- when adding LXD host
+ when composing a LXD VM
Alberto Donato (ack)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 3.3.0
assignee: nobody → Alberto Donato (ack)
Alberto Donato (ack)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.3.0 → 3.3.0-beta1
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.