Chapter 12. Editing a CRUSH Map
Generally, modifying your CRUSH map at runtime with the Ceph CLI is more convenient than editing the CRUSH map manually. However, there are times when you may choose to edit it, such as changing the default bucket types, or using a bucket algorithm other than straw
.
To edit an existing CRUSH map:
- Get the CRUSH map.
- Decompile the CRUSH map.
- Edit at least one of devices, buckets and rules.
- Recompile the CRUSH map.
- Set the CRUSH map.
To activate CRUSH Map rules for a specific pool, identify the common ruleset number for those rules and specify that ruleset number for the pool. See Set Pool Values for details.
12.1. Get a CRUSH Map
To get the CRUSH map for your cluster, execute the following:
ceph osd getcrushmap -o {compiled-crushmap-filename}
Ceph will output (-o) a compiled CRUSH map to the filename you specified. Since the CRUSH map is in a compiled form, you must decompile it first before you can edit it.
12.2. Decompile a CRUSH Map
To decompile a CRUSH map, execute the following:
crushtool -d {compiled-crushmap-filename} -o {decompiled-crushmap-filename}
Ceph will decompile (-d) the compiled CRUSH map and output (-o) it to the filename you specified.
12.3. Compile a CRUSH Map
To compile a CRUSH map, execute the following:
crushtool -c {decompiled-crush-map-filename} -o {compiled-crush-map-filename}
Ceph will store a compiled CRUSH map to the filename you specified.
12.4. Set a CRUSH Map
To set the CRUSH map for your cluster, execute the following:
ceph osd setcrushmap -i {compiled-crushmap-filename}
Ceph will input the compiled CRUSH map of the filename you specified as the CRUSH map for the cluster.