Score:0

Usage stats of CephFS subvolumes

au flag

Is there a way to gather and show the disk usage stats of CephFS subvolumes?

Is there anything similar to rbd du for CephFS subvolumes?

The only idea I have is something really ugly:

filesystem="ceph-filesystem"
group_name="csi"
for subvolume in $(ceph fs subvolume ls "${filesystem}" --group-name "${group_name}" | jq -cr '.[].name?'); do
    subvolume_info=$(ceph fs subvolume info "${filesystem}" "${subvolume}" "${group_name}")
    bytes_quota="$(echo "${subvolume_info}" | jq '.bytes_quota')"
    bytes_used=$(echo "${subvolume_info}" | jq '.bytes_used')
    echo "${subvolume} ${bytes_quota} ${bytes_used}"
done

I believe, there should be something more elegant.

Thanks in advance.

us flag
I'm not aware of anything that would display it like `rbd du`. Maybe they're working on something like that in Quincy, I don't know. But what about the dashboard? Or do you need that via CLI to create reports or something like that?
au flag
Right, what I need is to create reports and then parse them with other program (our own software product). If it could be accomplished with some HTTP-request to some API, it would be a nice solution too.
us flag
Do you use prometheus? Maybe you could query that. I'm not sure if you can query the MGR service which collects the ceph metrics.
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.