Getting disk usage information about RBD containers

I’ve been trying to figure out why my disk information about container state was always empty but after looking through the code it seems there is nothing implemented yet to get the disk usage from an RBD image. However looking at df that information is available to the filesystem.

Is there a way to get this information through the API, and if not is there a way to add this in a sane way?

We’re currently re-implementing all the storage backends, there’s a pretty good chance that we’ll effectively fix that one as part of this effort as the new internal storage API makes returning resource usage quite a bit easier.

Thanks for the quick reply. Is there somewhere to see the progress on this effort or perhaps even contribute some code?

You can watch the very many pull requests arriving in

Right now, we’re trying to fully implement the dir backend, porting cephfs in parallel, then we’ll be taking on btrfs, zfs, lvm and likely ceph last. But I expect that once we have dir sorted, landing the others will go pretty quick as that’s largely copy/pasting the backend specific logic for each, testing that everything makes sense and passes test and move on to the next one.

@tomp and @monstermunchkin are working on this now, I’m at a conference this week and so mostly do reviews on those PRs to have them all land quickly.

Awesome, I will keep an eye out. Thanks for the updates.

An other questions regarding this popped up today. It seems I can’t resize Ceph rbd images through LXD. Is this something you might add support for with the new storage backend or is that not related to this at all?

That normally works but requires a container restart I thought.
So effectively modifying the size property on the root disk device, then restart the container to have it grow.

That did the trick! Thanks.