5 =======================================
6 crushdiff -- ceph crush map test tool
7 =======================================
14 | **crushdiff** [ --osdmap *osdmap* ] [ --pg-dump *pg-dump* ]
15 [ --compiled ] [ --verbose ] *command* *crushmap*
21 **crushdiff** is a utility that lets you test the effect of a crushmap
22 change: number of pgs, objects, bytes moved. This is a wrapper around
23 :doc:`osdmaptool <osdmaptool>`\(8), relying on its **--test-map-pgs-dump**
24 option to get the list of changed pgs. Additionally it uses pg stats
25 to calculate the numbers of objects and bytes moved.
27 By default, **crushdiff** will use the cluster current osdmap and pg
28 stats, which requires access to the cluster. Though one can use the
29 **--osdmap** and **--pg-dump** options to test against previously
35 .. option:: --compiled
37 The input/output crushmap is compiled. If the options is not
38 specified the expected/returned crushmap is in txt (decompiled)
41 .. option:: --pg-dump <pg-dump>
43 JSON output of **ceph pg dump**. If not specified **crushdiff**
44 will try to get data running the command itself.
46 .. option:: --osdmap <osdmap>
48 The cluster osdmap, obtained with **ceph osd getmap** command. If
49 not specified **crushdiff** will try to get data running the
54 Produce diagnostic output.
59 :command:`compare` *crushmap*
60 Compare the crushmap from *crushmap* file with the crushmap from
61 the cluster osdmap. The output will show the expected number of pgs,
62 objects, bytes moved when the new crushmap is installed.
64 :command:`export` *crushmap*
65 Export crushmap to *crushmap* file from the cluster osdmap.
67 :command:`import` *crushmap*
68 Import crushmap from *crushmap* file to the cluster osdmap.
73 Get the current crushmap::
75 crushdiff export cm.txt
83 crushdiff compare cm.txt
85 79/416 (18.99%) pgs affected
86 281/1392 (20.19%) objects affected
87 80/1248 (6.41%) pg shards to move
88 281/4176 (6.73%) pg object shards to move
89 730.52Mi/10.55Gi (6.76%) bytes to move
91 When running with **--verbose** option the output will also contain
92 detailed information about the affected pgs, like below::
94 4.3 [0, 2, 1] -> [1, 4, 2]
95 4.b [0, 1, 3] -> [2, 1, 3]
96 4.c [4, 0, 1] -> [4, 1, 2]
98 i.e. a pg number, and its old and the new osd active sets.
100 If the result is satisfactory install the updated map::
102 crushdiff import cm.txt
108 **crushdiff** is part of Ceph, a massively scalable, open-source, distributed storage system. Please
109 refer to the Ceph documentation at https://docs.ceph.com for more
116 :doc:`ceph <ceph>`\(8),
117 :doc:`crushtool <crushtool>`\(8),
118 :doc:`osdmaptool <osdmaptool>`\(8),