0

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.

Volodymyr Melnyk
  • 537
  • 5
  • 18
  • 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? – eblock Feb 18 '22 at 13:59
  • 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. – Volodymyr Melnyk Feb 18 '22 at 17:57
  • 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. – eblock Feb 18 '22 at 21:34

0 Answers0