CRUSH map and rules

Ceph objects administration

CrushMap

Get CrushMap

   $ ceph osd getcrushmap -o <binary_file>

Convert crushMap

From binary to text

   $ crushtool -d <binary_file> -o <text_file>

From text to binary

   $ crushtool -c <text_file> -o <binary_file>

Set CrushMap

   $ ceph osd setcrushmap -i <binary_file>

Create new bucket

   $ ceph osd crush add-bucket <name> <type>

List of types :

  • osd
  • host
  • chassis
  • rack
  • row
  • pdu
  • pod
  • room
  • datacenter
  • region
  • root

Delete bucket

   $ ceph osd crush remove <bucket>

Move object to new bucket

   $ ceph osd crush move <object> <bucket_type>=<bucket_name>

Create new replicated rule

   $ ceph osd crush rule create-replicated <rule_name> <bucket_location> <bucket_rep> <osd_class>

Example will create a replicated rule limited on datacenter dc1 with SSD :

   $ ceph osd crush rule create-replicated dc1-fast dc1 host ssd

List rules

   $ ceph osd crush rule ls

Dump rules

   $ ceph osd crush rule dump <rule>

Remove rule

   $ ceph osd crush rule rm <rule_name>