Closed broizter closed 1 year ago
Sadly, disabling quota only fixes the issue if you didn't set the disk size for the container. If you set size
of the disk device (for example, lxc launch -d root,size=512MiB images:debian/bookworm
where root
is disk device), LXD is going to enable btrfs quota on that storage pool and the issue occurs again.
What were the reproducer steps in lxd to get to that state? That is what I'm after.
I managed to reproduce the issue on a fresh Arch install.
lxd init
with all defaults (make sure btrfs is used as the storage backend)As soon as you revert step 3 and also run btrfs quota disable /var/lib/lxd/storage-pools/default
things will go back to working as normal again.
just install lxd on latest Arch system with all default lxd init
except using btrfs as a storage for default storage pool and lxc launch -d root,size=512MiB images:debian/bookworm
just install lxd on latest Arch system with all default
lxd init
except using btrfs as a storage for default pool andlxc launch -d root,size=512MiB images:debian/bookworm
btrfs is the default for me during lxd init
but I'll update my instructions just in case.
look like btrfs-progs
after version 6.0, btrfs qgroup show
added path
column to be display by default, thus increasing fields from 4 to 5.
because https://github.com/lxc/lxd/blob/master/lxd/storage/drivers/driver_btrfs_utils.go#L256 skip line that has more or less than 4 field, it won't find any Qgroupid
.
Ah good spot. Let me try and reproduce.
Thanks I've reproduced this on Ubuntu Lunar Lobster now:
lxc storage create btrfs btrfs
Storage pool btrfs created
lxc launch images:alpine/3.17 c1 -s btrfs
Creating c1
Starting c1
lxc config device set c1 root size=1GiB
Error: Failed to update device "root": Failed to run: btrfs qgroup create 0/257 /var/lib/lxd/storage-pools/btrfs/containers/c1: exit status 1 (ERROR: unable to create quota group: File exists)
Required information
Issue description
Trying to create new containers fails with this message
Error: Failed instance creation: Failed creating instance from image: Failed to run: btrfs qgroup create 0/104960 /var/lib/lxd/storage-pools/default/images/f161c60ebcfe5806986bcfef748df7cf23bf7eb39eb5b7c130d0e5aa5371522f: exit status 1 (ERROR: unable to create quota group: File exists)
. My guess is that it started after upgrading btrfs-progs to 6.0.1. Upgrading to the latest version (6.0.2) did not fix the issue.Steps to reproduce
Information to attach
lxc monitor output https://pastebin.com/g6PxBYcb
Let me know if there's any other information you want me to attach. Same issue as this post I guess although I don't think downgrading btrfs-progs is a good fix. https://discuss.linuxcontainers.org/t/lxd-btrfs-archlinux-failed-instance-creation/15633