.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CRUSHDIFF" "8" "Oct 24, 2023" "dev" "Ceph" .SH NAME crushdiff \- ceph crush map test tool .SH SYNOPSIS .nf \fBcrushdiff\fP [ \-\-osdmap \fIosdmap\fP ] [ \-\-pg\-dump \fIpg\-dump\fP ] [ \-\-compiled ] [ \-\-verbose ] \fIcommand\fP \fIcrushmap\fP .fi .sp .SH DESCRIPTION .sp \fBcrushdiff\fP is a utility that lets you test the effect of a crushmap change: number of pgs, objects, bytes moved. This is a wrapper around \fI\%osdmaptool\fP(8), relying on its \fB\-\-test\-map\-pgs\-dump\fP option to get the list of changed pgs. Additionally it uses pg stats to calculate the numbers of objects and bytes moved. .sp By default, \fBcrushdiff\fP will use the cluster current osdmap and pg stats, which requires access to the cluster. Though one can use the \fB\-\-osdmap\fP and \fB\-\-pg\-dump\fP options to test against previously obtained data. .SH OPTIONS .INDENT 0.0 .TP .B \-\-compiled The input/output crushmap is compiled. If the options is not specified the expected/returned crushmap is in txt (decompiled) format. .UNINDENT .INDENT 0.0 .TP .B \-\-pg\-dump JSON output of \fBceph pg dump\fP\&. If not specified \fBcrushdiff\fP will try to get data running the command itself. .UNINDENT .INDENT 0.0 .TP .B \-\-osdmap The cluster osdmap, obtained with \fBceph osd getmap\fP command. If not specified \fBcrushdiff\fP will try to get data running the command itself. .UNINDENT .INDENT 0.0 .TP .B \-\-verbose Produce diagnostic output. .UNINDENT .SH COMMANDS .INDENT 0.0 .TP \fBcompare\fP \fIcrushmap\fP Compare the crushmap from \fIcrushmap\fP file with the crushmap from the cluster osdmap. The output will show the expected number of pgs, objects, bytes moved when the new crushmap is installed. .TP \fBexport\fP \fIcrushmap\fP Export crushmap to \fIcrushmap\fP file from the cluster osdmap. .TP \fBimport\fP \fIcrushmap\fP Import crushmap from \fIcrushmap\fP file to the cluster osdmap. .UNINDENT .SH EXAMPLE .sp Get the current crushmap: .INDENT 0.0 .INDENT 3.5 .sp .EX crushdiff export cm.txt .EE .UNINDENT .UNINDENT .sp Edit the map: .INDENT 0.0 .INDENT 3.5 .sp .EX $EDITOR cm.txt .EE .UNINDENT .UNINDENT .sp Check the result: .INDENT 0.0 .INDENT 3.5 .sp .EX crushdiff compare cm.txt 79/416 (18.99%) pgs affected 281/1392 (20.19%) objects affected 80/1248 (6.41%) pg shards to move 281/4176 (6.73%) pg object shards to move 730.52Mi/10.55Gi (6.76%) bytes to move .EE .UNINDENT .UNINDENT .sp When running with \fB\-\-verbose\fP option the output will also contain detailed information about the affected pgs, like below: .INDENT 0.0 .INDENT 3.5 .sp .EX 4.3 [0, 2, 1] \-> [1, 4, 2] 4.b [0, 1, 3] \-> [2, 1, 3] 4.c [4, 0, 1] \-> [4, 1, 2] .EE .UNINDENT .UNINDENT .sp i.e. a pg number, and its old and the new osd active sets. .sp If the result is satisfactory install the updated map: .INDENT 0.0 .INDENT 3.5 .sp .EX crushdiff import cm.txt .EE .UNINDENT .UNINDENT .SH AVAILABILITY .sp \fBcrushdiff\fP is part of Ceph, a massively scalable, open\-source, distributed storage system. Please refer to the Ceph documentation at \fI\%https://docs.ceph.com\fP for more information. .SH SEE ALSO .sp \fI\%ceph\fP(8), \fI\%crushtool\fP(8), \fI\%osdmaptool\fP(8), .SH COPYRIGHT 2010-2023, Inktank Storage, Inc. and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0) .\" Generated by docutils manpage writer. .