I’m using automation to manage VMs in a small LXD cluster. The cluster comprises 3 hosts running Ubuntu 24.04 and running LXD 5.21/stable.
With the latest update (5.21.5-f2a1a0e), I can no longer launch multiple VMs at once. I’m not certain anything else really changed.
This is using the Ceph backend. Reading through https://github.com/canonical/lxd/issues/15315, I realized that as long as I “pre-create” the image, everything else is ok. And that was true for 5.21.4. Under 5.21.5, this no longer works.
In my automation, I get the following errors:
Failed creating instance from image: Error inserting volume "35e2a917321479d8e7eeac7beeb656a640b6ea387d9aae6c484bc7e707c4e422" for project "default" in pool "remote" of type "images" into database "UNIQUE constraint failed: index 'storage_volumes_unique_storage_pool_id_node_id_project_id_name_type'
Failed creating instance from image: Failed to run: rbd --id admin --cluster ceph --image-feature layering --image-feature striping --image-feature exclusive-lock --image-feature object-map --image-feature fast-diff --image-feature deep-flatten clone lxd_remote/image_35e2a917321479d8e7eeac7beeb656a640b6ea387d9aae6c484bc7e707c4e422_ext4.block@readonly lxd_remote/virtual-machine_hydradev_vm-ccee85c0-c1d5-4ad6-52f9-011bd9b62963.block: exit status 2 (rbd: clone error: (2) No such file or directory)
In this particular instance, 15 VMs are being created. 7 fail and 8 succeed. The VMs that succeeded are across all 3 hosts.
Trying to recreate from the command-line, if I create a VM (to be certain the image is ready), and then create 3 VMs concurrently, I get the following:
$ lxc init ubuntu:26.04 --vm v1 --target hydra1 & lxc init ubuntu:26.04 --vm v2 --target hydra2 & lxc init ubuntu:26.04 --vm v3 --target hydra3 &
[1] 1833750
[2] 1833751
[3] 1833752
Creating v3
Creating v1
Creating v2
Retrieving image: Unpacking image: 7%Error: Failed instance creation: Failed creating instance from image: Failed to run: rbd --id admin --cluster ceph --pool lxd_remote rm image_4ba007f1a43e46b5dfa3d315911f4b96b3caeb77bcb2fbef77748e28d31103b0_ext4.block: exit status 16 (2026-07-05T23:26:59.406+0000 7310e09ea6c0 -1 librbd::image::PreRemoveRequest: 0x5652a21606b0 check_image_watchers: image has watchers - not removing
Removing image: 0% complete...failed.
rbd: error: image still has watchers
This means the image is still open or the client using it crashed. Try again after closing/unmapping it or waiting 30s for the crashed client to timeout.)
Error: Failed instance creation: Failed creating instance from image: Failed to run: rbd --id admin --cluster ceph --pool lxd_remote rm image_4ba007f1a43e46b5dfa3d315911f4b96b3caeb77bcb2fbef77748e28d31103b0_ext4.block: exit status 16 (2026-07-05T23:26:59.618+0000 71f90affd6c0 -1 librbd::image::PreRemoveRequest: 0x6188873c85d0 check_image_watchers: image has watchers - not removing
Removing image: 0% complete...failed.
rbd: error: image still has watchers
This means the image is still open or the client using it crashed. Try again after closing/unmapping it or waiting 30s for the crashed client to timeout.)
[1] Exit 1 lxc init ubuntu:26.04 --vm v1 --target hydra1
[2]- Exit 1 lxc init ubuntu:26.04 --vm v2 --target hydra2
[3]+ Done lxc init ubuntu:26.04 --vm v3 --target hydra3
$ lxc list
+------+---------+------+------+-----------------+-----------+----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+------+---------+------+------+-----------------+-----------+----------+
| v3 | STOPPED | | | VIRTUAL-MACHINE | 0 | hydra3 |
+------+---------+------+------+-----------------+-----------+----------+
(I used the same strategy as the ticket linked above in assigning each VM to a different host to make certain it is distributed.)
Thoughts? Can I safely “downgrade” or am I locked in (aka is there a database upgrade involved here)?
Thanks!