On Fri, Sep 28, 2018 at 5:18 AM Victor Denisov <denisovenator@xxxxxxxxx> wrote: > > Hi, > > I have the following problem. I would like to determine the health > status of all PGs that contain objects pertaining to a certain rbd > image. > > What I imagine I can do is: > - Find out the prefix of all objects of my rbd image > - List all objects with this prefix > - Use ceph osd map to find out what PGs my objects are mapped to and > determine the health of all those corresponding OSDs. > > Running ceph osd map for each object is a very costly operation. > My questions are: > > - Does this whole approach make sense at all? If you really need to know the list of PGs, then this works. However, if your image has a number of objects similar to the overall number of PGs in the pool, then you're likely to find that the image has some objects in all PGs, so it may not be very useful to exhaustively calculate the set of PGs in use -- you'll just be listing out all the PGs in the pool. For example, a fully written 1TB image with 4MB chunks will have 250k objects, which is more than the typical PG count on a medium sized Ceph cluster with a few hundred OSDs. > - Can I send a batch request to ceph osd map instead of querying > individual objects. No, but if you know some C++ then making a small tool that does that would be feasible -- the "osd map" operation is a simple local calculation that doesn't have to involve any remote operations, see implementation in OSDMonitor.cc. John > - Is there any other faster way to do it? > > Thanks, > Victor.