Is it possible to create replication rule that uses two osd classes and uses them in equal manner?

miro-zamiro

New Member
Aug 18, 2025
16
0
1
Hi!
I'm a sysadmin hobbist. I have a cluster of three ceph nodes with 10 osds. As I consider it as my hobby I have limited resources. Is it possible to set a replication rule with two classes (ssd and hdd) that would treat these classes equally?
I know about this option:
Code:
rule mixed_replicated_rule {
  id 11
  type replicated
  step take default class ssd
  step chooseleaf firstn 1 type host
  step emit
  step take default class hdd
  step chooseleaf firstn 0 type host
  step emit
}
But it always defaults to ssd class in the first step.
Is it possible to accomplish?
Best,
Miro
 
Last edited:
Thank you for your answers. How to create such a rule using commandline?:
Code:
rule my-rule {
  id 11
  type replicated
  step take default class ssd
  step chooseleaf firstn 1 type host
  step emit
  step take default class hdd
  step chooseleaf firstn 0 type host
  step emit
}
 
Last edited:
Depends on the rule. For a custom rule you have to get the CRUSH map, decompile it to get it as text file, make your changes like adding rules, compile it again and set is as active CRUSH map.
This is described more detailed the documentation of Ceph: https://docs.ceph.com/en/reef/rados/operations/crush-map-edits/
 
Last edited: