On Tue, Jul 09, 2019 at 09:42:14PM -0400, Jason Dillaman wrote: > On Tue, Jul 9, 2019 at 11:32 AM Max Reitz <mre...@redhat.com> wrote: > > On 09.07.19 15:09, Stefano Garzarella wrote: > > > > > > Max, Jason, thanks for the details! > > > > > > If you agree, I'll try to implement something similar, iterating on all > > > snapshots. > > > > Yes, that should work. > > > > > What about metadata? > > > I saw some APIs (e.g. rbd_metadata_list()) that allow us to get the > > > metadata. > > > An idea could be to iterate over them and sum the keys-values size > > > returned, > > > but I'm not sure they are returned in the same format as they are stored. > > > > I wouldn’t mind ignoring metadata too much. If you can get something to > > work, even better, but I don’t consider that too important. > > I don't think it's a good idea to attempt to estimate it. If there is > enough desire, we can always add a supported "disk-usage" API method > that takes into account things like the image metadata, object-map, > journaling, etc overhead. However, I wouldn't expect it to be anywhere > near the actual block usage (unless something has gone terribly wrong > w/ journaling and it fails to trim your log).
Okay, so for now, I'll skip the metadata and if you think can be useful to add "disk-usage" API in RBD, I'll use it later. Thanks, Stefano