LXD containers on Ubuntu 22 with larger file systems

I recently upgraded to Ubuntu 22 ( from Ubuntu 18 ) I noticed that LXD storage / file systems are different in Ubuntu 22. The storage is default limited to 6GB. On Ubuntu 18 it was unlimited I think, limited only by space on LXD host.

I want to create somewhat larger LXD nodes that are larger than 6GB in total. Is that still possible? Using lxc storage edit default I increased the 6GB limit there to 60GB. This however does not seem to anything. The storage available for my containers is still limited to 6GB in total.

How can I increase filesystem for my containers?

[:ansible-dev]└2 master(+4/-2)* 1 ± lxc storage show default
config:
  size: 60GB
  source: /var/snap/lxd/common/lxd/disks/default.img
  zfs.pool_name: default
description: ""
name: default
driver: zfs
used_by:
- /1.0/images/1bf47fe84cbbe3643ded769a0f0150852d08611097db938c9a4a919bdb17db64
- /1.0/images/8f4ec500d42e9231bec377874ad84cbee77078d75ec8ca3e5083c3ec39aef145
- /1.0/images/b42790404df512ba82875b667da900225c86fcd3e76ed21cfecc5135ebf7b79d
- /1.0/instances/c2d-ks1
- /1.0/instances/c2d-ks2
- /1.0/instances/c2d-rproxy1
- /1.0/profiles/default
status: Created
locations:
- none

Editing the config does not increase the available size. Some more steps are needed.

This section of the docs describes the mandatory extra steps: https://linuxcontainers.org/lxd/docs/stable-5.0/howto/storage_pools/index.html#resize-a-storage-pool

1 Like

I installed zfsutils-linux to be able to execute zpool command and than ran following commands.

sudo truncate -s +55G /var/snap/lxd/common/lxd/disks/default.img
sudo zpool set autoexpand=on default
sudo zpool status -vg
sudo zpool online -e default 3387991467943462034
sudo zpool set autoexpand=off default

After running the commands, I performed reboot, destroyed my nodes and recreated them. The problem persists. The disk storage is limited to 6GB and this limit is shared.

Is it possible to switch to Ubuntu 18 type storage for LXD. That was just working and suitable for my purpose which is development / research.

As a workaround I switched back to dir storage used on default by Ubuntu 18.

lxc storage create mydirpool dir
lxc profile edit default  # change pool to mydirpool

This is fine for now, but the open question remains how to increase disk storage when using defauls zfs storage.