* RBD image usage with librbd (rbd du)
@ 2016-02-06 7:57 Wido den Hollander
2016-02-08 13:44 ` Jason Dillaman
0 siblings, 1 reply; 3+ messages in thread
From: Wido den Hollander @ 2016-02-06 7:57 UTC (permalink / raw)
To: ceph-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RBD image usage with librbd (rbd du)
2016-02-06 7:57 RBD image usage with librbd (rbd du) Wido den Hollander
@ 2016-02-08 13:44 ` Jason Dillaman
2016-02-09 15:10 ` Wido den Hollander
0 siblings, 1 reply; 3+ messages in thread
From: Jason Dillaman @ 2016-02-08 13:44 UTC (permalink / raw)
To: Wido den Hollander; +Cc: ceph-devel
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@42on.com>
> To: "ceph-devel" <ceph-devel@vger.kernel.org>
> 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RBD image usage with librbd (rbd du)
2016-02-08 13:44 ` Jason Dillaman
@ 2016-02-09 15:10 ` Wido den Hollander
0 siblings, 0 replies; 3+ messages in thread
From: Wido den Hollander @ 2016-02-09 15:10 UTC (permalink / raw)
To: Jason Dillaman; +Cc: ceph-devel
> Op 8 februari 2016 om 14:44 schreef Jason Dillaman <dillaman@redhat.com>:
>
>
> 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.
>
Thanks! How does this look:
https://github.com/wido/libvirt/commit/16817a46b6948bd97968712d4865299da54b4fff
If all good I'll send it to libvirt upstream.
Wido
> [1]
> https://github.com/ceph/ceph/blob/master/src/tools/rbd/action/DiskUsage.cc#L58
>
> --
>
> Jason Dillaman
>
>
> ----- Original Message -----
> > From: "Wido den Hollander" <wido@42on.com>
> > To: "ceph-devel" <ceph-devel@vger.kernel.org>
> > 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@vger.kernel.org
> > 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-09 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-06 7:57 RBD image usage with librbd (rbd du) Wido den Hollander
2016-02-08 13:44 ` Jason Dillaman
2016-02-09 15:10 ` Wido den Hollander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.