The 'rbd du' utility actually just performs a diff operation on the image [1]. If the image doesn't have the _FAST_DIFF feature enabled, this operation will require scanning all potential objects in the RBD image. [1] https://github.com/ceph/ceph/blob/master/src/tools/rbd/action/DiskUsage.cc#L58 -- Jason Dillaman ----- Original Message ----- > From: "Wido den Hollander" <wido@xxxxxxxx> > To: "ceph-devel" <ceph-devel@xxxxxxxxxxxxxxx> > Sent: Saturday, February 6, 2016 2:57:23 AM > Subject: RBD image usage with librbd (rbd du) > > Hi, > > I'm working on libvirt again and for volumes libvirt has a 'capacity' and > 'allocation'. > > Until recently both were set to the size of the RBD image since it was not > possible to fetch the allocation of a image. > > We now have 'rbd du' and this uses a librbd call to fetch the real usage of a > image. > > What is the best way to fetch the 'allocation' of a RBD image using librbd > (C)? > rbd_stat() won't tell and looking through librbd.h I don't know which > function > to use. > > Thanks, > > Wido > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html