Understanding relation of ~/default.img vs ~/storage-pool/default

lxd host runs on: hetzner cx11 cloud server with 20 GB storage
lxd host: ubuntu 18.04
lxd version: 3.0.3 (installed via apt)

:~$ lxc storage list
+---------+-------------+--------+--------------------------------+---------+
|  NAME   | DESCRIPTION | DRIVER |             SOURCE             | USED BY |
+---------+-------------+--------+--------------------------------+---------+
| default |             | btrfs  | /var/lib/lxd/disks/default.img | 6       |
+---------+-------------+--------+--------------------------------+---------+

I have allocated 12GB to that storage pool

now it seems as the database in the only container I am using is growing I am getting closer to reaching storage limits. Now I want to understand how the mechanics work in order to adjust my system as needed.

for the basic understanding is it correct that …

  • everything I see inside the directory /var/lib/lxd/storage-pools/default
  • actually lives in the disk image /var/lib/lxd/disks/default.img

… and likewise is limited by the size of that image (which you have defined in the lxd init operation)?

I guess in order to make more room for my container I need to grow the size of that image/storage pool? Only growing the capacity of the lxd host would not change anything by itself. Is that understanding correct?

Yeah, that’s right. You’ll need to make more room on your host, then grow default.img itself, then grow the filesystem (btrfs) that’s stored in it.

thnks, much clearer now

are there any lxc/lxd commands (like lxc storage ... or so) available for these 2 operations or do I have to look into which standard linux commands apply for this?

Hetzner supports block devices, therefore you can get one and set it up as a second storage pool.
Then, using lxc move, you can move some containers to the new storage pool. lxc move has an option to specify the destination storage pool.
You may decide whether to move all containers to the new pool, therefore make the new pool as your default pool, or just move some containers to the new pool.

Note that with the new block device you can use directly btrfs instead of having a loop file (default.img). Such a thing has some nice benefits in terms of performance.

There are instructions for this in our documentation:
https://linuxcontainers.org/lxd/docs/master/storage

thx for the pointers, I’ll dig into that.

yes I have seen that, but couldn’t make much from it on first sight. Will give it a more thourrow inspection,

thnks both of you. I guess I can figure it out from here with those pointers.