Enhancement #76401
closedAdd an option to ceph osd pool ls detail to show logical crush rule names instead of a numeric ID
0%
Description
```bash-4.4$ ceph osd pool ls detail | grep buckets.data
pool 12 'jp.rgw.buckets.data' erasure profile jp.rgw.buckets.data_ecprofile size 3 min_size 2 crush_rule 15 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 120751 lfor 0/0/70573 flags hashpspool,ec_overwrites stripe_width 8192 application rgw```
What's crush_rule 15? Sure one can go look it up, but one can't even "ceph osd crush rule dump 15", unless I'm missing someone one has to "ceph osd crush rule dump" and search, or play with JSON and jq. Not great usability.
I humbly request the addition of a `--crush-rule--by-name` switch to display the rule name instead of the ID. We shouldn't change the default, much as I'd like to, because that could break scripts and automation.
This should be pretty easy to do. Include an update to the docs and the command syntax help.
LS Updated by Lumir Sliva 7 months ago
- Assignee set to Lumir Sliva
Taking this one.
LS Updated by Lumir Sliva 7 months ago
- Pull request ID set to 68886
LS Updated by Lumir Sliva 7 months ago
Thanks for the report. Posted PR https://github.com/ceph/ceph/pull/68886.
Added `--show-rule-names` (used the more general name rather than `--crush-rule-by-name`, happy to rename if you'd prefer). With `detail`:
- text output renders the CRUSH rule by name in place of the id
- JSON output keeps `crush_rule` as an int (so balancer / pg_autoscaler stay happy) and adds a sibling `crush_rule_name` string
- if the rule has been deleted, text falls back to the numeric id and JSON omits `crush_rule_name` so nothing is ever misleading
Default output is unchanged on both paths.
$ ceph osd pool ls detail pool 3 'pool_named' replicated size 3 min_size 1 crush_rule 1 object_hash rjenkins ... $ ceph osd pool ls detail --show-rule-names pool 3 'pool_named' replicated size 3 min_size 1 crush_rule replica_hdd object_hash rjenkins ... $ ceph osd pool ls detail --show-rule-names --format json ... "crush_rule": 1, "crush_rule_name": "replica_hdd", ...
AD Updated by Anthony D'Atri 7 months ago
Implementation is the most sincere form of flattery. You are my new best friend !
UB Updated by Upkeep Bot 3 months ago
- Status changed from New to Resolved
- Merge Commit set to d7acfc002d897339fd327a688490e896b80769e1
- Fixed In set to v21.3.0-2899-gd7acfc002d
- Upkeep Timestamp set to 2026-09-04T00:28:55+00:00