Fail to start VM / saving config failed (disk full)

Maybe (not tested and never done) you could create a new/second img file and use btrfs device add to enlarge your btrfs volume

This would mean a split storage from my understanding … I definitivelly simply want to expand my storage capacity and found out to be stuck on such a simple and basic thing.

The documentation How to manage storage pools - LXD documentation does not seem to work as well.

Having a LUKS/LVM/EXTFS/IMG-file/Btrfs FS stack does not seem to help.

Ok, some long hours of deep diving, I got lxc back online …

First I add to resize the LVM and ensure the EXTFS was in sync with the change.

But at that point you will have to go for the following :

Allocate the new maximum file size (here 60GB):
fallocate -l 60G /var/snap/lxd/common/lxd/disks/Medd.img

Fetch the target loop using :
losetup -j /var/snap/lxd/common/lxd/disks/Medd.img

From that loop given (say here loop26) ensure its target is up and resizes :
sudo losetup -c /dev/loop26

Update the device loop target to the max size
sudo btrfs filesystem resize max /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/Medd/

Force the update at the lxc level :
lxc storage set Medd size=60GB

Here are a couple of things that would be nice to improve in lxc

  • Log any file capacity outage in the lxc log
  • Give more details (verbose mode) on the reason it is failing to start a VM
  • Confirm that there is a capacity outage if start is failing
  • Provide a way to directly resize the underlying structure all-in-one. LXC knows where the .img is and its configuration. If such a resize is not possible it should advice the way forward
  • Upgrade the page How to manage storage pools - LXD documentation with this procedure on actual pool resizing in LVM/*fs/img file/loop/btrfs

Thanks @tomp & others for helping on this one.

1 Like

Glad you got it working.

We have an item on our roadmap for this cycle (I think) to support resizing image backed storage pools via the pool’s size setting.

As for improving error messages, I suspect that has already been done, as you’re running a pretty old version of LXD now (the 4.0 LTS series is only supported for security fixes now), and we’ve been moving to using error wrapping a lot more over the last few years to include more information in error messages.

I would strongly recommend you upgrade to the 5.0 LTS series (5.0/stable snap channel).

See Managing the LXD snap