Score:0

Ceph determine PG based on rados object name

ie flag

In Ceph, the command rados --pgid <pgid> ls allows you to list all the rados objects that are stored in a specific placement group. My question is: is there a command that does the reverse? So, is it possible, given a specific rados object name, to determine the placement group that object is stored in? I did not find any such command in the rados man page.

Several sources state that the formula is pgid = hash(object_name)%pg_num, so if that is accurate I guess I'm looking for a command line tool that can do that calculation.

I know I could resort to listing the contents of all pgs until I find the object I need, but that is very inefficient and I would like to avoid it if at all possible.

Score:1
us flag

This seems to get the information you're looking for:

host1:~ # ceph osd map <pool> <object>

For example:

host1:~ # ceph osd map cephfs_data 1000000058e.00000002 
osdmap e1683 pool 'cephfs_data' (35) object '1000000058e.00000002' -> pg 35.5c9f6800 (35.0) -> up ([14,15,1], p14) acting ([14,15,1], p14)
roelvanmeer avatar
ie flag
I've updated the question to make it more clear I'm looking for the PG that one specific rados object is in, not any high-level file object or rdb image.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.