How to map an object to its respective Placement Groups and OSD disks, in RHCS?
Environment
-
Red Hat Ceph Storage 1.2.3
-
Red Hat Ceph Storage 1.3
Issue
-
Is it possible to get a listing of the Placement Groups and OSDs, on which a particular object resides?
-
Is it possible to obtain the current status of an object and an updated map of how many PG's are composing it?
-
Are there specific commands to list the chunks of an object, in an Erasure Coded pool?
Resolution
-
There aren't any specific ways to list the chunks of an object in an Erasure Coded pool.
-
The following commands equally apply for both Replicated pools as well as Erasure Coded pools.
-
The idea is to first list the objects in a pool, and then specifically list the mapping of an object in the pool to the underlying placement groups and OSDs.
-
To get the object listing from a pool, use:
# rados -p <pool_name> ls
- List the Placement Groups and OSDs for the object in question, with:
# ceph osd map <pool_name> <object_name/file_name>
- For example, after understanding that the the object 'my-object' exists in the pool 'rbd', to get the PG and OSD information, use:
# ceph osd map rbd my-object
osdmap e7642 pool 'rbd' (2) object 'my-object' -> pg 2.c5034eb8 (2.38) -> up ([5,3], p5) acting ([5,3], p5)
-
The above command output shows that the object named 'my-object' in the 'rbd' pool is on the PG 2.38, and it has the OSDs 5 and 3 in the 'ACTING' set as well as the 'UP' set.
-
This command shows the pool name, the pool number (also available through 'ceph osd lspools'), the file/object name, the PG number, the UP set of OSDs for that PG, and the acting set of OSDs for that PG.
-
This works fine for Erasure Coded pools as well. In case of an Erasure Coded pool, the object being written is cut into chunks and each chunk is sent to the OSDs in the acting set. This means that, in this case the chunks of 'my-object' is sent to the OSDs 5 and 3.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.