zabbly / incus

Incus package repository
176 stars 14 forks source link

`incus top` doesn't properly report disk usage on BTRFS backends #47

Closed phol closed 3 weeks ago

phol commented 3 weeks ago

I'm using Incus with a BTRFS backend. When I run the new incus top command on Incus 6.0.1. LTS, disk usage for all containers is reported to be the same, except for my Docker container, which uses a separate storage pool. Having this report properly would be very useful, especially given the fact that du isn't reliable with BTRFS.

Screenshot 2024-07-01 at 10 36 07

Additionally, but that would be more of a feature request rather than a bug report, it would be nice to have both a 'physical size' as well as `uncompressed / deduplicated size' column.

stgraber commented 3 weeks ago

What does incus list -cnD show you?

phol commented 3 weeks ago
incus list -cnD
+--------+------------+
|  NAME  | DISK USAGE |
+--------+------------+
| av     |            |
+--------+------------+
| dns    |            |
+--------+------------+
| docker |            |
+--------+------------+
| hbp    |            |
+--------+------------+
| mdb    |            |
+--------+------------+
| pg     |            |
+--------+------------+
| runner |            |
+--------+------------+
| turn   |            |
+--------+------------+
phol commented 3 weeks ago

BTW, I just realised I opened this issue in zabbly/incus instead of lxc/incus. If this is the wrong location, I'll gladly reopen it over there.

stgraber commented 3 weeks ago

It's the wrong location but that's not really a problem, I look at both :)

Okay, so Incus has no idea what the disk usage is. Does df -h / show you the container-specific usage inside the container?

If not, then there's nothing we can do. incus top hits every single instance every 5s so we definitely can't run something heavy weight like du :)

stgraber commented 3 weeks ago

What we should do though is not show a usage value when we can't figure it out.

stgraber commented 3 weeks ago

Ah but that's because we can't quite figure it out as all we're told by the kernel is:

So it's not something we can do from the incus top side of things. But we may be able to make incus just not return the metric at all in environments where there is no such thing as a container-specific value.