Images being stored in local filesystem instead of storage

I set up my cluster with a 30GB local filesystem partition and the remainder of the disk on another partition to be used by lxd (using btrfs). Last week I got lxd errors indicating the disk was full. When I checked, I noticed the local filesystem was full because of lxd images contained in /var/snap/lxd/common/lxd/images. Aren’t images supposed to be stored in the lxd storage and not in the local filesystem? What is going on?

1 Like

Hi, can you please show the output of lxc storage show <name> for each of your storage pools?

When images are downloaded they are stored in /var/snap/lxd/common/lxd/images by default.

This can be changed by:

  1. Creating a custom volume in a storage pool.
  2. Specifying LXD use that for image storage by setting storage.images_volume to <pool name>/<volume name> see https://documentation.ubuntu.com/lxd/en/latest/server/#server-miscellaneous:storage.images_volume

@masnax @mionaalex do you think MicroCloud should be opinionated about this and set it up automatically? One question would be what size should the images volume be defaulted to.

1 Like

I’ve set this. Is content_type: filesystem without a size limit ok for it?

How can I delete the images in /var/snap/lxd/common/lxd/images? Should I try to find them in lxd and delete them or is it fine to delete them directly from the filesystem?

Yes a filesystem type custom volume is correct.

When you set storage.images_volume the existing image files should be moved there.

I believe you will need to set this on each cluster member though using the --target flag on lxc config set.