Detect root size limit exceded

Hi all,
My environment:
incux 6.0.1
Storage: btrfs
Debian bookworm

I have been testing to limit root size on containers.
First create a root disk with:

incus config device add <container_name> root disk pool=default path=/

And the limit with:

incus config device set <container_name> root size 3GB

I can view the limit with:

incus config device get <container_name> root size

If I then create dummy files in container to fill disk up, it works all fine and when you run out of disk you get the message:
Disk quota exceeded
If more disk is needed after running out of disk, just update the size of the disk:

incus config device set <container_name> root size 10GB

and disk can be filled again with more data.

This is all fine and work as expected.

My idea though is to limit disks on containers and monitor that the disk limit is not exceeded and if possible increase size of disk, to keep usage under control.
If limit is set to 3GB and if I look at the size of disk with:

incus info <container_name>
...
  Disk usage:
    root: 2.45GiB
...

The size of the root disk is: 2.45GiB

So my question is, how can I detect that disk has reached the limit with incus client tool without entering the container?

Many thanks in advance!!

Hi!

Incus keeps track of metrics, including disk metrics. Have a look in case you find something relevant or something that can help you deduce that the disk is filling up.

As far as I know, if you hit the disk quota, this information comes from the filesystem and not from Incus.

Relevant discussion, How can I see available quota for an instance in the Incus Metrics?

Thanks @simos for pointing me in the right direction.
When using btrfs I found the following solution working great for us:

btrfs qgroup show -reF /var/lib/incus/storage-pools/<storage-pool-name>/containers/<container-name>
1 Like