]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mon/MonCommands.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2013 Inktank Storage, Inc.
7 * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
9 * Author: Loic Dachary <loic@dachary.org>
11 * This is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License version 2.1, as published by the Free Software
14 * Foundation. See file COPYING.
18 /* no guard; may be included multiple times */
21 * Define commands that are reported by the monitor's
22 * "get_command_descriptions" command, and parsed by the Python
23 * frontend 'ceph' (and perhaps by other frontends, such as a RESTful
24 * server). The format is:
26 * COMMAND(signature, helpstring, modulename, req perms, availability)
28 * signature: describes the command and its parameters (more below)
29 * helpstring: displays in CLI help, API help (nice if it refers to
30 * parameter names from signature, 40-a few hundred chars)
31 * modulename: the monitor module or daemon this applies to:
32 * mds, osd, pg (osd), mon, auth, log, config-key, mgr
33 * req perms: required permission in that modulename space to execute command
34 * this also controls what type of REST command is accepted
36 * The commands describe themselves completely enough for the separate
37 * frontend(s) to be able to accept user input and validate it against
38 * the command descriptions, and generate a JSON object that contains
39 * key:value mappings of parameter names to validated parameter values.
41 * 'signature' is a space-separated list of individual command descriptors;
42 * each descriptor is either a literal string, which can contain no spaces or
43 * '=' signs (for instance, in "pg stat", both "pg" and "stat" are literal
44 * strings representing one descriptor each), or a list of key=val[,key=val...]
45 * which also includes no spaces.
47 * The key=val form describes a non-literal parameter. Each will have at
48 * least a name= and type=, and each type can have its own type-specific
49 * parameters. The parser is the arbiter of these types and their
50 * interpretation. A few more non-type-specific key=val pairs exist:
52 * req=false marks an optional parameter (default for req is 'true')
53 * n=<n> is a repeat count for how many of this argument must be supplied.
55 * n=N is a special case that means "1 or more".
57 * A perhaps-incomplete list of types:
59 * CephInt: Optional: range=min[|max]
60 * CephFloat: Optional range
61 * CephString: optional badchars
62 * CephSocketpath: validation involves "is it S_ISSOCK"
63 * CephIPAddr: v4 or v6 addr with optional port, syntax validated
64 * CephEntityAddr: CephIPAddr + optional '/nonce'
65 * CephPoolname: Plainold string
66 * CephObjectname: Another plainold string
67 * CephPgid: n.xxx where n is an int > 0, xxx is a hex number > 0
68 * CephName: daemon name, '*' or '<type>.<id>' (id must be int for type osd)
69 * CephOsdName: osd name, '*' or '<id> or 'osd.<id>' (id must be int)
70 * CephChoices: strings="foo|bar" means this param can be either
71 * CephFilepath: openable file
72 * CephFragment: cephfs 'fragID': val/bits, val in hex 0xnnn, bits in dec
73 * CephUUID: uuid in text matching Python uuid.UUID()
74 * CephPrefix: special type assigned to literals
79 * "name=entity,type=CephString "
80 * "name=caps,type=CephString,n=N,req=false",
81 * "add auth info for <name> from input file, or random key "
82 * "if no input given, and/or any caps specified in the command")
84 * defines a command "auth add" that takes a required argument "entity"
85 * of type "CephString", and from 1 to N arguments named "caps" of type
86 * CephString, at least one of which is required. The front end will
87 * validate user input against this description. Let's say the user
88 * enters auth add client.admin 'mon rwx' 'osd *'. The result will be a
89 * JSON object like {"prefix":"auth add", "entity":"client.admin",
90 * "caps":["mon rwx", "osd *"]}.
92 * - string literals are accumulated into 'prefix'
93 * - n=1 descriptors are given normal string or int object values
94 * - n=N descriptors are given array values
96 * NOTE: be careful with spaces. Each descriptor must be separated by
97 * one space, no other characters, so if you split lines as above, be
98 * sure to close and reopen the quotes, and be careful to include the '
99 * separating spaces in the quoted string.
101 * The monitor marshals this JSON into a std::map<string, cmd_vartype>
102 * where cmd_vartype is a boost::variant type-enforcing discriminated
103 * type, so the monitor is expected to know the type of each argument.
104 * See cmdparse.cc/h for more details.
106 * The flag parameter for COMMAND_WITH_FLAGS macro must be passed using
107 * FLAG(f), where 'f' may be one of the following:
109 * NONE - no flag assigned
110 * NOFORWARD - command may not be forwarded
111 * OBSOLETE - command is considered obsolete
112 * DEPRECATED - command is considered deprecated
113 * MGR - command goes to ceph-mgr (for luminous+)
114 * POLL - command is intended to be called periodically by the
115 * client (see iostat)
116 * HIDDEN - command is hidden (no reported by help etc)
117 * TELL - tell/asok command. it's an alias of (NOFORWARD | HIDDEN)
119 * A command should always be first considered DEPRECATED before being
120 * considered OBSOLETE, giving due consideration to users and conforming
121 * to any guidelines regarding deprecating commands.
124 COMMAND ( "pg map name=pgid,type=CephPgid" , "show mapping of pg to osds" , \
126 COMMAND ( "pg repeer name=pgid,type=CephPgid" , "force a PG to repeer" ,
128 COMMAND ( "osd last-stat-seq name=id,type=CephOsdName" , \
129 "get the last pg stats sequence number reported for this osd" , \
133 * auth commands AuthMonitor.cc
136 COMMAND ( "auth export name=entity,type=CephString,req=false" , \
137 "write keyring for requested entity, or master keyring if none given" , \
139 COMMAND ( "auth get name=entity,type=CephString" , \
140 "write keyring file with requested key" , "auth" , "rx" )
141 COMMAND ( "auth get-key name=entity,type=CephString" , "display requested key" , \
143 COMMAND ( "auth print-key name=entity,type=CephString" , "display requested key" , \
145 COMMAND ( "auth print_key name=entity,type=CephString" , "display requested key" , \
147 COMMAND_WITH_FLAG ( "auth list" , "list authentication state" , "auth" , "rx" ,
149 COMMAND ( "auth ls" , "list authentication state" , "auth" , "rx" )
150 COMMAND ( "auth import" , "auth import: read keyring file from -i <file>" ,
153 "name=entity,type=CephString "
154 "name=caps,type=CephString,n=N,req=false" ,
155 "add auth info for <entity> from input file, or random key if no "
156 "input is given, and/or any caps specified in the command" ,
158 COMMAND ( "auth get-or-create-key "
159 "name=entity,type=CephString "
160 "name=caps,type=CephString,n=N,req=false" ,
161 "get, or add, key for <name> from system/caps pairs specified in the command. If key already exists, any given caps must match the existing caps for that key." ,
163 COMMAND ( "auth get-or-create "
164 "name=entity,type=CephString "
165 "name=caps,type=CephString,n=N,req=false" ,
166 "add auth info for <entity> from input file, or random key if no input given, and/or any caps specified in the command" ,
168 COMMAND ( "fs authorize "
169 "name=filesystem,type=CephString "
170 "name=entity,type=CephString "
171 "name=caps,type=CephString,n=N" ,
172 "add auth for <entity> to access file system <filesystem> based on following directory and permissions pairs" ,
175 "name=entity,type=CephString "
176 "name=caps,type=CephString,n=N" ,
177 "update caps for <name> from caps specified in the command" ,
179 COMMAND_WITH_FLAG ( "auth del "
180 "name=entity,type=CephString" ,
181 "delete all caps for <name>" ,
185 "name=entity,type=CephString" ,
186 "remove all caps for <name>" ,
190 * Monitor commands (Monitor.cc)
192 COMMAND_WITH_FLAG ( "compact" , "cause compaction of monitor's leveldb/rocksdb storage" ,
195 COMMAND_WITH_FLAG ( "scrub" , "scrub the monitor stores" ,
198 COMMAND ( "fsid" , "show cluster FSID/UUID" , "mon" , "r" )
199 COMMAND ( "log name=logtext,type=CephString,n=N" ,
200 "log supplied text to the monitor log" , "mon" , "rw" )
202 "name=num,type=CephInt,range=1,req=false "
203 "name=level,type=CephChoices,strings=debug|info|sec|warn|error,req=false "
204 "name=channel,type=CephChoices,strings=*|cluster|audit|cephadm,req=false" ,
205 "print last few lines of the cluster log" ,
208 COMMAND ( "status" , "show cluster status" , "mon" , "r" )
209 COMMAND ( "health name=detail,type=CephChoices,strings=detail,req=false" ,
210 "show cluster health" , "mon" , "r" )
211 COMMAND ( "health mute " \
212 "name=code,type=CephString "
213 "name=ttl,type=CephString,req=false "
214 "name=sticky,type=CephBool,req=false" ,
215 "mute health alert" , "mon" , "w" )
216 COMMAND ( "health unmute " \
217 "name=code,type=CephString,req=false" ,
218 "unmute existing health alert mute(s)" , "mon" , "w" )
219 COMMAND ( "time-sync-status" , "show time sync status" , "mon" , "r" )
220 COMMAND ( "df name=detail,type=CephChoices,strings=detail,req=false" ,
221 "show cluster free space stats" , "mon" , "r" )
222 COMMAND ( "report name=tags,type=CephString,n=N,req=false" ,
223 "report full status of cluster, optional title tag strings" ,
225 COMMAND ( "features" , "report of connected features" ,
227 COMMAND ( "quorum_status" , "report status of monitor quorum" ,
229 COMMAND ( "mon ok-to-stop "
230 "name=ids,type=CephString,n=N" ,
231 "check whether mon(s) can be safely stopped without reducing immediate "
234 COMMAND ( "mon ok-to-add-offline" ,
235 "check whether adding a mon and not starting it would break quorum" ,
237 COMMAND ( "mon ok-to-rm "
238 "name=id,type=CephString" ,
239 "check whether removing the specified mon would break quorum" ,
243 "name=target,type=CephName "
244 "name=args,type=CephString,n=N" ,
245 "send a command to a specific daemon" , "mon" , "rw" )
246 COMMAND_WITH_FLAG ( "version" , "show mon daemon version" , "mon" , "r" ,
250 "name=type,type=CephChoices,strings=all|osd|mon|mds|mgr,req=false" ,
251 "list all nodes in cluster [type]" , "mon" , "r" )
253 * Monitor-specific commands under module 'mon'
255 COMMAND_WITH_FLAG ( "mon scrub" ,
256 "scrub the monitor stores" ,
259 COMMAND ( "mon metadata name=id,type=CephString,req=false" ,
260 "fetch metadata for mon <id>" ,
262 COMMAND ( "mon count-metadata name=property,type=CephString" ,
263 "count mons by metadata field property" ,
265 COMMAND ( "mon versions" ,
266 "check running versions of monitors" ,
269 "check running versions of ceph daemons" ,
275 * MDS commands (MDSMonitor.cc)
278 COMMAND_WITH_FLAG ( "mds stat" , "show MDS status" , "mds" , "r" , FLAG ( HIDDEN
))
279 COMMAND_WITH_FLAG ( "mds dump "
280 "name=epoch,type=CephInt,req=false,range=0" ,
281 "dump legacy MDS cluster info, optionally from epoch" ,
282 "mds" , "r" , FLAG ( OBSOLETE
))
284 "name=epoch,type=CephInt,req=false,range=0" ,
285 "dump all CephFS status, optionally from epoch" , "mds" , "r" )
286 COMMAND_WITH_FLAG ( "mds getmap "
287 "name=epoch,type=CephInt,req=false,range=0" ,
288 "get MDS map, optionally from epoch" , "mds" , "r" , FLAG ( OBSOLETE
))
289 COMMAND ( "mds metadata name=who,type=CephString,req=false" ,
290 "fetch metadata for mds <role>" ,
292 COMMAND ( "mds count-metadata name=property,type=CephString" ,
293 "count MDSs by metadata field property" ,
295 COMMAND ( "mds versions" ,
296 "check running versions of MDSs" ,
298 COMMAND_WITH_FLAG ( "mds tell "
299 "name=who,type=CephString "
300 "name=args,type=CephString,n=N" ,
301 "send command to particular mds" , "mds" , "rw" , FLAG ( OBSOLETE
))
302 COMMAND_WITH_FLAG ( "mds stop name=role,type=CephString" , "stop mds" ,
303 "mds" , "rw" , FLAG ( OBSOLETE
))
304 COMMAND_WITH_FLAG ( "mds deactivate name=role,type=CephString" ,
305 "clean up specified MDS rank (use with `set max_mds` to shrink cluster)" ,
306 "mds" , "rw" , FLAG ( OBSOLETE
))
307 COMMAND ( "mds ok-to-stop name=ids,type=CephString,n=N" ,
308 "check whether stopping the specified MDS would reduce immediate availability" ,
310 COMMAND_WITH_FLAG ( "mds set_max_mds "
311 "name=maxmds,type=CephInt,range=0" ,
312 "set max MDS index" , "mds" , "rw" , FLAG ( OBSOLETE
))
313 COMMAND_WITH_FLAG ( "mds set "
314 "name=var,type=CephChoices,strings=max_mds|max_file_size|inline_data|"
315 "allow_new_snaps|allow_multimds|allow_multimds_snaps|allow_dirfrags "
316 "name=val,type=CephString "
317 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
318 "set mds parameter <var> to <val>" , "mds" , "rw" , FLAG ( OBSOLETE
))
319 COMMAND_WITH_FLAG ( "mds freeze name=role_or_gid,type=CephString"
320 " name=val,type=CephString" ,
321 "freeze MDS yes/no" , "mds" , "rw" , FLAG ( HIDDEN
))
322 // arbitrary limit 0-20 below; worth standing on head to make it
323 // relate to actual state definitions?
324 // #include "include/ceph_fs.h"
325 COMMAND_WITH_FLAG ( "mds set_state "
326 "name=gid,type=CephInt,range=0 "
327 "name=state,type=CephInt,range=0|20" ,
328 "set mds state of <gid> to <numeric-state>" , "mds" , "rw" , FLAG ( HIDDEN
))
329 COMMAND ( "mds fail name=role_or_gid,type=CephString" ,
330 "Mark MDS failed: trigger a failover if a standby is available" ,
332 COMMAND ( "mds repaired name=role,type=CephString" ,
333 "mark a damaged MDS rank as no longer damaged" , "mds" , "rw" )
335 "name=gid,type=CephInt,range=0" ,
336 "remove nonactive mds" , "mds" , "rw" )
337 COMMAND_WITH_FLAG ( "mds rmfailed name=role,type=CephString "
338 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
339 "remove failed rank" , "mds" , "rw" , FLAG ( HIDDEN
))
340 COMMAND_WITH_FLAG ( "mds cluster_down" , "take MDS cluster down" , "mds" , "rw" , FLAG ( OBSOLETE
))
341 COMMAND_WITH_FLAG ( "mds cluster_up" , "bring MDS cluster up" , "mds" , "rw" , FLAG ( OBSOLETE
))
342 COMMAND_WITH_FLAG ( "mds compat show" , "show mds compatibility settings" ,
343 "mds" , "r" , FLAG ( DEPRECATED
))
344 COMMAND ( "fs compat show "
345 "name=fs_name,type=CephString " ,
346 "show fs compatibility settings" ,
348 COMMAND_WITH_FLAG ( "mds compat rm_compat "
349 "name=feature,type=CephInt,range=0" ,
350 "remove compatible feature" , "mds" , "rw" , FLAG ( DEPRECATED
))
351 COMMAND_WITH_FLAG ( "mds compat rm_incompat "
352 "name=feature,type=CephInt,range=0" ,
353 "remove incompatible feature" , "mds" , "rw" , FLAG ( DEPRECATED
))
354 COMMAND_WITH_FLAG ( "mds add_data_pool "
355 "name=pool,type=CephString" ,
356 "add data pool <pool>" , "mds" , "rw" , FLAG ( OBSOLETE
))
357 COMMAND_WITH_FLAG ( "mds rm_data_pool "
358 "name=pool,type=CephString" ,
359 "remove data pool <pool>" , "mds" , "rw" , FLAG ( OBSOLETE
))
360 COMMAND_WITH_FLAG ( "mds remove_data_pool "
361 "name=pool,type=CephString" ,
362 "remove data pool <pool>" , "mds" , "rw" , FLAG ( OBSOLETE
))
363 COMMAND_WITH_FLAG ( "mds newfs "
364 "name=metadata,type=CephInt,range=0 "
365 "name=data,type=CephInt,range=0 "
366 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
367 "make new filesystem using pools <metadata> and <data>" ,
368 "mds" , "rw" , FLAG ( OBSOLETE
))
370 "name=fs_name,type=CephString,goodchars=[A-Za-z0-9-_.] "
371 "name=metadata,type=CephString "
372 "name=data,type=CephString "
373 "name=force,type=CephBool,req=false "
374 "name=allow_dangerous_metadata_overlay,type=CephBool,req=false "
375 "name=fscid,type=CephInt,range=0,req=false" ,
376 "make new filesystem using named pools <metadata> and <data>" ,
379 "name=fs_name,type=CephString " ,
380 "bring the file system down and all of its ranks" ,
383 "name=fs_name,type=CephString "
384 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
385 "disable the named filesystem" ,
388 "name=fs_name,type=CephString "
389 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
390 "disaster recovery only: reset to a single-MDS map" ,
395 COMMAND ( "fs get name=fs_name,type=CephString" ,
396 "get info about one filesystem" ,
399 "name=fs_name,type=CephString "
400 "name=var,type=CephChoices,strings=max_mds|max_file_size"
401 "|allow_new_snaps|inline_data|cluster_down|allow_dirfrags|balancer"
402 "|standby_count_wanted|session_timeout|session_autoclose"
403 "|allow_standby_replay|down|joinable|min_compat_client "
404 "name=val,type=CephString "
405 "name=yes_i_really_mean_it,type=CephBool,req=false "
406 "name=yes_i_really_really_mean_it,type=CephBool,req=false" ,
407 "set fs parameter <var> to <val>" , "mds" , "rw" )
408 COMMAND ( "fs flag set name=flag_name,type=CephChoices,strings=enable_multiple "
409 "name=val,type=CephString "
410 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
411 "Set a global CephFS flag" ,
414 COMMAND ( "fs feature ls" ,
415 "list available cephfs features to be set/unset" ,
419 "name=fs_name,type=CephString "
420 "name=subop,type=CephChoices,strings=rm_compat|rm_incompat|add_compat|add_incompat "
421 "name=feature,type=CephInt "
422 "name=feature_str,type=CephString,req=false " ,
423 "manipulate compat settings" , "fs" , "rw" )
425 COMMAND ( "fs required_client_features "
426 "name=fs_name,type=CephString "
427 "name=subop,type=CephChoices,strings=add|rm "
428 "name=val,type=CephString " ,
429 "add/remove required features of clients" , "mds" , "rw" )
431 COMMAND ( "fs add_data_pool name=fs_name,type=CephString "
432 "name=pool,type=CephString" ,
433 "add data pool <pool>" , "mds" , "rw" )
434 COMMAND ( "fs rm_data_pool name=fs_name,type=CephString "
435 "name=pool,type=CephString" ,
436 "remove data pool <pool>" , "mds" , "rw" )
437 COMMAND_WITH_FLAG ( "fs set_default name=fs_name,type=CephString" ,
438 "set the default to the named filesystem" ,
441 COMMAND ( "fs set-default name=fs_name,type=CephString" ,
442 "set the default to the named filesystem" ,
444 COMMAND ( "fs mirror enable "
445 "name=fs_name,type=CephString " ,
446 "enable mirroring for a ceph filesystem" , "mds" , "rw" )
447 COMMAND ( "fs mirror disable "
448 "name=fs_name,type=CephString " ,
449 "disable mirroring for a ceph filesystem" , "mds" , "rw" )
450 COMMAND ( "fs mirror peer_add "
451 "name=fs_name,type=CephString "
452 "name=uuid,type=CephString "
453 "name=remote_cluster_spec,type=CephString "
454 "name=remote_fs_name,type=CephString" ,
455 "add a mirror peer for a ceph filesystem" , "mds" , "rw" )
456 COMMAND ( "fs mirror peer_remove "
457 "name=fs_name,type=CephString "
458 "name=uuid,type=CephString " ,
459 "remove a mirror peer for a ceph filesystem" , "mds" , "rw" )
465 "name=epoch,type=CephInt,range=0,req=false" ,
466 "dump formatted monmap (optionally from epoch)" ,
468 COMMAND ( "mon stat" , "summarize monitor status" , "mon" , "r" )
469 COMMAND ( "mon getmap "
470 "name=epoch,type=CephInt,range=0,req=false" ,
471 "get monmap" , "mon" , "r" )
473 "name=name,type=CephString "
474 "name=addr,type=CephIPAddr "
475 "name=location,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=],req=false" ,
476 "add new monitor named <name> at <addr>, possibly with CRUSH location <location>" , "mon" , "rw" )
478 "name=name,type=CephString" ,
479 "remove monitor named <name>" , "mon" , "rw" )
480 COMMAND_WITH_FLAG ( "mon remove "
481 "name=name,type=CephString" ,
482 "remove monitor named <name>" , "mon" , "rw" ,
484 COMMAND ( "mon feature ls "
485 "name=with_value,type=CephChoices,strings=--with-value,req=false" ,
486 "list available mon map features to be set/unset" ,
488 COMMAND ( "mon feature set "
489 "name=feature_name,type=CephString "
490 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
491 "set provided feature on mon map" ,
493 COMMAND ( "mon set-rank "
494 "name=name,type=CephString "
495 "name=rank,type=CephInt" ,
496 "set the rank for the specified mon" ,
498 COMMAND ( "mon set-addrs "
499 "name=name,type=CephString "
500 "name=addrs,type=CephString" ,
501 "set the addrs (IPs and ports) a specific monitor binds to" ,
503 COMMAND ( "mon set-weight "
504 "name=name,type=CephString "
505 "name=weight,type=CephInt,range=0|65535" ,
506 "set the weight for the specified mon" ,
508 COMMAND ( "mon enable-msgr2" ,
509 "enable the msgr2 protocol on port 3300" ,
511 COMMAND ( "mon set election_strategy " \
512 "name=strategy,type=CephString" , \
513 "set the election strategy to use; choices classic, disallow, connectivity" , \
515 COMMAND ( "mon add disallowed_leader " \
516 "name=name,type=CephString" , \
517 "prevent the named mon from being a leader" , \
519 COMMAND ( "mon rm disallowed_leader " \
520 "name=name,type=CephString" , \
521 "allow the named mon to be a leader again" , \
523 COMMAND ( "mon set_location " \
524 "name=name,type=CephString "
525 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
526 "specify location <args> for the monitor <name>, using CRUSH bucket names" , \
528 COMMAND ( "mon enable_stretch_mode " \
529 "name=tiebreaker_mon,type=CephString, "
530 "name=new_crush_rule,type=CephString, "
531 "name=dividing_bucket,type=CephString, " ,
532 "enable stretch mode, changing the peering rules and "
533 "failure handling on all pools with <tiebreaker_mon> "
534 "as the tiebreaker and setting <dividing_bucket> locations "
535 "as the units for stretching across" ,
537 COMMAND ( "mon set_new_tiebreaker " \
538 "name=name,type=CephString "
539 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
540 "switch the stretch tiebreaker to be the named mon" , \
546 COMMAND ( "osd stat" , "print summary of OSD map" , "osd" , "r" )
548 "name=epoch,type=CephInt,range=0,req=false" ,
549 "print summary of OSD map" , "osd" , "r" )
551 "name=id,type=CephOsdName,req=false" ,
552 "print osd's {id} information (instead of all osds from map)" ,
555 "name=epoch,type=CephInt,range=0,req=false "
556 "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false" ,
557 "print OSD tree" , "osd" , "r" )
558 COMMAND ( "osd tree-from "
559 "name=epoch,type=CephInt,range=0,req=false "
560 "name=bucket,type=CephString "
561 "name=states,type=CephChoices,strings=up|down|in|out|destroyed,n=N,req=false" ,
562 "print OSD tree in bucket" , "osd" , "r" )
564 "name=epoch,type=CephInt,range=0,req=false" ,
565 "show all OSD ids" , "osd" , "r" )
566 COMMAND ( "osd getmap "
567 "name=epoch,type=CephInt,range=0,req=false" ,
568 "get OSD map" , "osd" , "r" )
569 COMMAND ( "osd getcrushmap "
570 "name=epoch,type=CephInt,range=0,req=false" ,
571 "get CRUSH map" , "osd" , "r" )
572 COMMAND ( "osd getmaxosd" , "show largest OSD id" , "osd" , "r" )
573 COMMAND ( "osd ls-tree "
574 "name=epoch,type=CephInt,range=0,req=false "
575 "name=name,type=CephString,req=true" ,
576 "show OSD ids under bucket <name> in the CRUSH map" ,
579 "name=id,type=CephOsdName" ,
580 "find osd <id> in the CRUSH map and show its location" ,
582 COMMAND ( "osd metadata "
583 "name=id,type=CephOsdName,req=false" ,
584 "fetch metadata for osd {id} (default all)" ,
586 COMMAND ( "osd count-metadata name=property,type=CephString" ,
587 "count OSDs by metadata field property" ,
589 COMMAND ( "osd versions" ,
590 "check running versions of OSDs" ,
592 COMMAND ( "osd numa-status" ,
593 "show NUMA status of OSDs" ,
596 "name=pool,type=CephPoolname "
597 "name=object,type=CephObjectname "
598 "name=nspace,type=CephString,req=false" ,
599 "find pg for <object> in <pool> with [namespace]" , "osd" , "r" )
600 COMMAND_WITH_FLAG ( "osd lspools" ,
601 "list pools" , "osd" , "r" , FLAG ( DEPRECATED
))
602 COMMAND_WITH_FLAG ( "osd crush rule list" , "list crush rules" , "osd" , "r" ,
604 COMMAND ( "osd crush rule ls" , "list crush rules" , "osd" , "r" )
605 COMMAND ( "osd crush rule ls-by-class "
606 "name=class,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
607 "list all crush rules that reference the same <class>" ,
609 COMMAND ( "osd crush rule dump "
610 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false" ,
611 "dump crush rule <name> (default all)" ,
613 COMMAND ( "osd crush dump" ,
616 COMMAND ( "osd setcrushmap name=prior_version,type=CephInt,req=false" ,
617 "set crush map from input file" ,
619 COMMAND ( "osd crush set name=prior_version,type=CephInt,req=false" ,
620 "set crush map from input file" ,
622 COMMAND ( "osd crush add-bucket "
623 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
624 "name=type,type=CephString "
625 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=],req=false" ,
626 "add no-parent (probably root) crush bucket <name> of type <type> "
627 "to location <args>" ,
629 COMMAND ( "osd crush rename-bucket "
630 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] "
631 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
632 "rename bucket <srcname> to <dstname>" ,
634 COMMAND ( "osd crush set "
635 "name=id,type=CephOsdName "
636 "name=weight,type=CephFloat,range=0.0 "
637 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
638 "update crushmap position and weight for <name> to <weight> with location <args>" ,
640 COMMAND ( "osd crush add "
641 "name=id,type=CephOsdName "
642 "name=weight,type=CephFloat,range=0.0 "
643 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
644 "add or update crushmap position and weight for <name> with <weight> and location <args>" ,
646 COMMAND ( "osd crush set-all-straw-buckets-to-straw2" ,
647 "convert all CRUSH current straw buckets to use the straw2 algorithm" ,
649 COMMAND ( "osd crush class create "
650 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]" ,
651 "create crush device class <class>" ,
653 COMMAND ( "osd crush class rm "
654 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]" ,
655 "remove crush device class <class>" ,
657 COMMAND ( "osd crush set-device-class "
658 "name=class,type=CephString "
659 "name=ids,type=CephString,n=N" ,
660 "set the <class> of the osd(s) <id> [<id>...],"
661 "or use <all|any> to set all." ,
663 COMMAND ( "osd crush rm-device-class "
664 "name=ids,type=CephString,n=N" ,
665 "remove class of the osd(s) <id> [<id>...],"
666 "or use <all|any> to remove all." ,
668 COMMAND ( "osd crush class rename "
669 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_] "
670 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_]" ,
671 "rename crush device class <srcname> to <dstname>" ,
673 COMMAND ( "osd crush create-or-move "
674 "name=id,type=CephOsdName "
675 "name=weight,type=CephFloat,range=0.0 "
676 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
677 "create entry or move existing entry for <name> <weight> at/to location <args>" ,
679 COMMAND ( "osd crush move "
680 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
681 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
682 "move existing entry for <name> to location <args>" ,
684 COMMAND ( "osd crush swap-bucket "
685 "name=source,type=CephString,goodchars=[A-Za-z0-9-_.] "
686 "name=dest,type=CephString,goodchars=[A-Za-z0-9-_.] "
687 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
688 "swap existing bucket contents from (orphan) bucket <source> and <target>" ,
690 COMMAND ( "osd crush link "
691 "name=name,type=CephString "
692 "name=args,type=CephString,n=N,goodchars=[A-Za-z0-9-_.=]" ,
693 "link existing entry for <name> under location <args>" ,
695 COMMAND ( "osd crush rm "
696 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
697 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]" ,
698 "remove <name> from crush map (everywhere, or just at <ancestor>)" , \
700 COMMAND_WITH_FLAG ( "osd crush remove "
701 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
702 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]" ,
703 "remove <name> from crush map (everywhere, or just at <ancestor>)" ,
706 COMMAND ( "osd crush unlink "
707 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
708 "name=ancestor,type=CephString,req=false,goodchars=[A-Za-z0-9-_.]" ,
709 "unlink <name> from crush map (everywhere, or just at <ancestor>)" ,
711 COMMAND ( "osd crush reweight-all" ,
712 "recalculate the weights for the tree to ensure they sum correctly" ,
714 COMMAND ( "osd crush reweight "
715 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
716 "name=weight,type=CephFloat,range=0.0" ,
717 "change <name>'s weight to <weight> in crush map" ,
719 COMMAND ( "osd crush reweight-subtree "
720 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
721 "name=weight,type=CephFloat,range=0.0" ,
722 "change all leaf items beneath <name> to <weight> in crush map" ,
724 COMMAND ( "osd crush tunables "
725 "name=profile,type=CephChoices,strings=legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default" ,
726 "set crush tunables values to <profile>" , "osd" , "rw" )
727 COMMAND ( "osd crush set-tunable "
728 "name=tunable,type=CephChoices,strings=straw_calc_version "
729 "name=value,type=CephInt" ,
730 "set crush tunable <tunable> to <value>" ,
732 COMMAND ( "osd crush get-tunable "
733 "name=tunable,type=CephChoices,strings=straw_calc_version" ,
734 "get crush tunable <tunable>" ,
736 COMMAND ( "osd crush show-tunables" ,
737 "show current crush tunables" , "osd" , "r" )
738 COMMAND ( "osd crush rule create-simple "
739 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
740 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] "
741 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] "
742 "name=mode,type=CephChoices,strings=firstn|indep,req=false" ,
743 "create crush rule <name> to start from <root>, replicate across buckets of type <type>, using a choose mode of <firstn|indep> (default firstn; indep best for erasure pools)" ,
745 COMMAND ( "osd crush rule create-replicated "
746 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
747 "name=root,type=CephString,goodchars=[A-Za-z0-9-_.] "
748 "name=type,type=CephString,goodchars=[A-Za-z0-9-_.] "
749 "name=class,type=CephString,goodchars=[A-Za-z0-9-_.],req=false" ,
750 "create crush rule <name> for replicated pool to start from <root>, replicate across buckets of type <type>, use devices of type <class> (ssd or hdd)" ,
752 COMMAND ( "osd crush rule create-erasure "
753 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
754 "name=profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.=]" ,
755 "create crush rule <name> for erasure coded pool created with <profile> (default default)" ,
757 COMMAND ( "osd crush rule rm "
758 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] " ,
759 "remove crush rule <name>" , "osd" , "rw" )
760 COMMAND ( "osd crush rule rename "
761 "name=srcname,type=CephString,goodchars=[A-Za-z0-9-_.] "
762 "name=dstname,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
763 "rename crush rule <srcname> to <dstname>" ,
765 COMMAND ( "osd crush tree "
766 "name=shadow,type=CephChoices,strings=--show-shadow,req=false" ,
767 "dump crush buckets and items in a tree view" ,
769 COMMAND ( "osd crush ls name=node,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
770 "list items beneath a node in the CRUSH tree" ,
772 COMMAND ( "osd crush class ls" ,
773 "list all crush device classes" ,
775 COMMAND ( "osd crush class ls-osd "
776 "name=class,type=CephString,goodchars=[A-Za-z0-9-_]" ,
777 "list all osds belonging to the specific <class>" ,
779 COMMAND ( "osd crush get-device-class "
780 "name=ids,type=CephString,n=N" ,
781 "get classes of specified osd(s) <id> [<id>...]" ,
783 COMMAND ( "osd crush weight-set ls" ,
784 "list crush weight sets" ,
786 COMMAND ( "osd crush weight-set dump" ,
787 "dump crush weight sets" ,
789 COMMAND ( "osd crush weight-set create-compat" ,
790 "create a default backward-compatible weight-set" ,
792 COMMAND ( "osd crush weight-set create "
793 "name=pool,type=CephPoolname " \
794 "name=mode,type=CephChoices,strings=flat|positional" ,
795 "create a weight-set for a given pool" ,
797 COMMAND ( "osd crush weight-set rm name=pool,type=CephPoolname" ,
798 "remove the weight-set for a given pool" ,
800 COMMAND ( "osd crush weight-set rm-compat" ,
801 "remove the backward-compatible weight-set" ,
803 COMMAND ( "osd crush weight-set reweight "
804 "name=pool,type=CephPoolname "
805 "name=item,type=CephString "
806 "name=weight,type=CephFloat,range=0.0,n=N" ,
807 "set weight for an item (bucket or osd) in a pool's weight-set" ,
809 COMMAND ( "osd crush weight-set reweight-compat "
810 "name=item,type=CephString "
811 "name=weight,type=CephFloat,range=0.0,n=N" ,
812 "set weight for an item (bucket or osd) in the backward-compatible weight-set" ,
814 COMMAND ( "osd setmaxosd "
815 "name=newmax,type=CephInt,range=0" ,
816 "set new maximum osd value" , "osd" , "rw" )
817 COMMAND ( "osd set-full-ratio "
818 "name=ratio,type=CephFloat,range=0.0|1.0" ,
819 "set usage ratio at which OSDs are marked full" ,
821 COMMAND ( "osd set-backfillfull-ratio "
822 "name=ratio,type=CephFloat,range=0.0|1.0" ,
823 "set usage ratio at which OSDs are marked too full to backfill" ,
825 COMMAND ( "osd set-nearfull-ratio "
826 "name=ratio,type=CephFloat,range=0.0|1.0" ,
827 "set usage ratio at which OSDs are marked near-full" ,
829 COMMAND ( "osd get-require-min-compat-client" ,
830 "get the minimum client version we will maintain compatibility with" ,
832 COMMAND ( "osd set-require-min-compat-client "
833 "name=version,type=CephString "
834 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
835 "set the minimum client version we will maintain compatibility with" ,
837 COMMAND ( "osd pause" , "pause osd" , "osd" , "rw" )
838 COMMAND ( "osd unpause" , "unpause osd" , "osd" , "rw" )
839 COMMAND ( "osd erasure-code-profile set "
840 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.] "
841 "name=profile,type=CephString,n=N,req=false "
842 "name=force,type=CephBool,req=false" ,
843 "create erasure code profile <name> with [<key[=value]> ...] pairs. Add a --force at the end to override an existing profile (VERY DANGEROUS)" ,
845 COMMAND ( "osd erasure-code-profile get "
846 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
847 "get erasure code profile <name>" ,
849 COMMAND ( "osd erasure-code-profile rm "
850 "name=name,type=CephString,goodchars=[A-Za-z0-9-_.]" ,
851 "remove erasure code profile <name>" ,
853 COMMAND ( "osd erasure-code-profile ls" ,
854 "list all erasure code profiles" ,
857 "name=key,type=CephChoices,strings=full|pause|noup|nodown|"
858 "noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|"
859 "notieragent|nosnaptrim|pglog_hardlimit "
860 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
861 "set <key>" , "osd" , "rw" )
863 "name=key,type=CephChoices,strings=full|pause|noup|nodown|" \
864 "noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|"
865 "notieragent|nosnaptrim" ,
866 "unset <key>" , "osd" , "rw" )
867 COMMAND ( "osd require-osd-release " \
868 "name=release,type=CephChoices,strings=luminous|mimic|nautilus|octopus|pacific "
869 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
870 "set the minimum allowed OSD release to participate in the cluster" ,
873 "name=ids,type=CephString,n=N "
874 "name=definitely_dead,type=CephBool,req=false" ,
875 "set osd(s) <id> [<id>...] down, "
876 "or use <any|all> to set all osds down" ,
879 "type=CephString,name=ids,n=N" ,
880 "stop the corresponding osd daemons and mark them as down" ,
883 "name=ids,type=CephString,n=N" ,
884 "set osd(s) <id> [<id>...] out, "
885 "or use <any|all> to set all osds out" ,
888 "name=ids,type=CephString,n=N" ,
889 "set osd(s) <id> [<id>...] in, "
890 "can use <any|all> to automatically set all previously out osds in" ,
892 COMMAND_WITH_FLAG ( "osd rm "
893 "name=ids,type=CephString,n=N" ,
894 "remove osd(s) <id> [<id>...], "
895 "or use <any|all> to remove all osds" ,
898 COMMAND_WITH_FLAG ( "osd add-noup "
899 "name=ids,type=CephString,n=N" ,
900 "mark osd(s) <id> [<id>...] as noup, "
901 "or use <all|any> to mark all osds as noup" ,
904 COMMAND_WITH_FLAG ( "osd add-nodown "
905 "name=ids,type=CephString,n=N" ,
906 "mark osd(s) <id> [<id>...] as nodown, "
907 "or use <all|any> to mark all osds as nodown" ,
910 COMMAND_WITH_FLAG ( "osd add-noin "
911 "name=ids,type=CephString,n=N" ,
912 "mark osd(s) <id> [<id>...] as noin, "
913 "or use <all|any> to mark all osds as noin" ,
916 COMMAND_WITH_FLAG ( "osd add-noout "
917 "name=ids,type=CephString,n=N" ,
918 "mark osd(s) <id> [<id>...] as noout, "
919 "or use <all|any> to mark all osds as noout" ,
922 COMMAND_WITH_FLAG ( "osd rm-noup "
923 "name=ids,type=CephString,n=N" ,
924 "allow osd(s) <id> [<id>...] to be marked up "
925 "(if they are currently marked as noup), "
926 "can use <all|any> to automatically filter out all noup osds" ,
929 COMMAND_WITH_FLAG ( "osd rm-nodown "
930 "name=ids,type=CephString,n=N" ,
931 "allow osd(s) <id> [<id>...] to be marked down "
932 "(if they are currently marked as nodown), "
933 "can use <all|any> to automatically filter out all nodown osds" ,
936 COMMAND_WITH_FLAG ( "osd rm-noin "
937 "name=ids,type=CephString,n=N" ,
938 "allow osd(s) <id> [<id>...] to be marked in "
939 "(if they are currently marked as noin), "
940 "can use <all|any> to automatically filter out all noin osds" ,
943 COMMAND_WITH_FLAG ( "osd rm-noout "
944 "name=ids,type=CephString,n=N" ,
945 "allow osd(s) <id> [<id>...] to be marked out "
946 "(if they are currently marked as noout), "
947 "can use <all|any> to automatically filter out all noout osds" ,
950 COMMAND ( "osd set-group "
951 "name=flags,type=CephString "
952 "name=who,type=CephString,n=N" ,
953 "set <flags> for batch osds or crush nodes, "
954 "<flags> must be a comma-separated subset of {noup,nodown,noin,noout}" ,
956 COMMAND ( "osd unset-group "
957 "name=flags,type=CephString "
958 "name=who,type=CephString,n=N" ,
959 "unset <flags> for batch osds or crush nodes, "
960 "<flags> must be a comma-separated subset of {noup,nodown,noin,noout}" ,
962 COMMAND ( "osd reweight "
963 "name=id,type=CephOsdName "
964 "type=CephFloat,name=weight,range=0.0|1.0" ,
965 "reweight osd to 0.0 < <weight> < 1.0" , "osd" , "rw" )
966 COMMAND ( "osd reweightn "
967 "name=weights,type=CephString" ,
968 "reweight osds with {<id>: <weight>,...}" ,
970 COMMAND ( "osd force-create-pg "
971 "name=pgid,type=CephPgid " \
972 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
973 "force creation of pg <pgid>" ,
975 COMMAND ( "osd pg-temp "
976 "name=pgid,type=CephPgid "
977 "name=id,type=CephOsdName,n=N,req=false" ,
978 "set pg_temp mapping pgid:[<id> [<id>...]] (developers only)" ,
980 COMMAND ( "osd pg-upmap "
981 "name=pgid,type=CephPgid "
982 "name=id,type=CephOsdName,n=N" ,
983 "set pg_upmap mapping <pgid>:[<id> [<id>...]] (developers only)" ,
985 COMMAND ( "osd rm-pg-upmap "
986 "name=pgid,type=CephPgid" ,
987 "clear pg_upmap mapping for <pgid> (developers only)" ,
989 COMMAND ( "osd pg-upmap-items "
990 "name=pgid,type=CephPgid "
991 "name=id,type=CephOsdName,n=N" ,
992 "set pg_upmap_items mapping <pgid>:{<id> to <id>, [...]} (developers only)" ,
994 COMMAND ( "osd rm-pg-upmap-items "
995 "name=pgid,type=CephPgid" ,
996 "clear pg_upmap_items mapping for <pgid> (developers only)" ,
998 COMMAND ( "osd primary-temp "
999 "name=pgid,type=CephPgid "
1000 "name=id,type=CephOsdName" ,
1001 "set primary_temp mapping pgid:<id>|-1 (developers only)" ,
1003 COMMAND ( "osd primary-affinity "
1004 "name=id,type=CephOsdName "
1005 "type=CephFloat,name=weight,range=0.0|1.0" ,
1006 "adjust osd primary-affinity from 0.0 <= <weight> <= 1.0" ,
1008 COMMAND_WITH_FLAG ( "osd destroy-actual "
1009 "name=id,type=CephOsdName "
1010 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1011 "mark osd as being destroyed. Keeps the ID intact (allowing reuse), "
1012 "but removes cephx keys, config-key data and lockbox keys, " \
1013 "rendering data permanently unreadable." ,
1014 "osd" , "rw" , FLAG ( HIDDEN
))
1015 COMMAND ( "osd purge-new "
1016 "name=id,type=CephOsdName "
1017 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1018 "purge all traces of an OSD that was partially created but never "
1021 COMMAND_WITH_FLAG ( "osd purge-actual "
1022 "name=id,type=CephOsdName "
1023 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1024 "purge all osd data from the monitors. Combines `osd destroy`, "
1025 "`osd rm`, and `osd crush rm`." ,
1026 "osd" , "rw" , FLAG ( HIDDEN
))
1028 "name=id,type=CephOsdName "
1029 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1030 "mark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL" ,
1032 COMMAND_WITH_FLAG ( "osd create "
1033 "name=uuid,type=CephUUID,req=false "
1034 "name=id,type=CephOsdName,req=false" ,
1035 "create new osd (with optional UUID and ID)" , "osd" , "rw" ,
1038 "name=uuid,type=CephUUID,req=true "
1039 "name=id,type=CephOsdName,req=false" ,
1040 "Create a new OSD. If supplied, the `id` to be replaced needs to "
1041 "exist and have been previously destroyed. "
1042 "Reads secrets from JSON file via `-i <file>` (see man page)." ,
1044 COMMAND ( "osd blocklist "
1045 "name=blocklistop,type=CephChoices,strings=add|rm "
1046 "name=addr,type=CephEntityAddr "
1047 "name=expire,type=CephFloat,range=0.0,req=false" ,
1048 "add (optionally until <expire> seconds from now) or remove <addr> from blocklist" ,
1050 COMMAND ( "osd blocklist ls" , "show blocklisted clients" , "osd" , "r" )
1051 COMMAND ( "osd blocklist clear" , "clear all blocklisted clients" , "osd" , "rw" )
1053 COMMAND_WITH_FLAG ( "osd blacklist "
1054 "name=blacklistop,type=CephChoices,strings=add|rm "
1055 "name=addr,type=CephEntityAddr "
1056 "name=expire,type=CephFloat,range=0.0,req=false" ,
1057 "add (optionally until <expire> seconds from now) or remove <addr> from blacklist" ,
1060 COMMAND_WITH_FLAG ( "osd blacklist ls" , "show blacklisted clients" , "osd" , "r" ,
1062 COMMAND_WITH_FLAG ( "osd blacklist clear" , "clear all blacklisted clients" , "osd" , "rw" ,
1065 COMMAND ( "osd pool mksnap "
1066 "name=pool,type=CephPoolname "
1067 "name=snap,type=CephString" ,
1068 "make snapshot <snap> in <pool>" , "osd" , "rw" )
1069 COMMAND ( "osd pool rmsnap "
1070 "name=pool,type=CephPoolname "
1071 "name=snap,type=CephString" ,
1072 "remove snapshot <snap> from <pool>" , "osd" , "rw" )
1073 COMMAND ( "osd pool ls "
1074 "name=detail,type=CephChoices,strings=detail,req=false" ,
1075 "list pools" , "osd" , "r" )
1076 COMMAND ( "osd pool create "
1077 "name=pool,type=CephPoolname "
1078 "name=pg_num,type=CephInt,range=0,req=false "
1079 "name=pgp_num,type=CephInt,range=0,req=false "
1080 "name=pool_type,type=CephChoices,strings=replicated|erasure,req=false "
1081 "name=erasure_code_profile,type=CephString,req=false,goodchars=[A-Za-z0-9-_.] "
1082 "name=rule,type=CephString,req=false "
1083 "name=expected_num_objects,type=CephInt,range=0,req=false "
1084 "name=size,type=CephInt,range=0,req=false "
1085 "name=pg_num_min,type=CephInt,range=0,req=false "
1086 "name=autoscale_mode,type=CephChoices,strings=on|off|warn,req=false "
1087 "name=target_size_bytes,type=CephInt,range=0,req=false "
1088 "name=target_size_ratio,type=CephFloat,range=0|1,req=false" , \
1089 "create pool" , "osd" , "rw" )
1090 COMMAND_WITH_FLAG ( "osd pool delete "
1091 "name=pool,type=CephPoolname "
1092 "name=pool2,type=CephPoolname,req=false "
1093 "name=yes_i_really_really_mean_it,type=CephBool,req=false "
1094 "name=yes_i_really_really_mean_it_not_faking,type=CephBool,req=false " ,
1098 COMMAND ( "osd pool rm "
1099 "name=pool,type=CephPoolname "
1100 "name=pool2,type=CephPoolname,req=false "
1101 "name=yes_i_really_really_mean_it,type=CephBool,req=false "
1102 "name=yes_i_really_really_mean_it_not_faking,type=CephBool,req=false " ,
1105 COMMAND ( "osd pool rename "
1106 "name=srcpool,type=CephPoolname "
1107 "name=destpool,type=CephPoolname" ,
1108 "rename <srcpool> to <destpool>" , "osd" , "rw" )
1109 COMMAND ( "osd pool get "
1110 "name=pool,type=CephPoolname "
1111 "name=var,type=CephChoices,strings=size|min_size|pg_num|pgp_num|crush_rule|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|target_max_objects|target_max_bytes|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|erasure_code_profile|min_read_recency_for_promote|all|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|allow_ec_overwrites|fingerprint_algorithm|pg_autoscale_mode|pg_autoscale_bias|pg_num_min|target_size_bytes|target_size_ratio|dedup_tier|dedup_chunk_algorithm|dedup_cdc_chunk_size" ,
1112 "get pool parameter <var>" , "osd" , "r" )
1113 COMMAND ( "osd pool set "
1114 "name=pool,type=CephPoolname "
1115 "name=var,type=CephChoices,strings=size|min_size|pg_num|pgp_num|pgp_num_actual|crush_rule|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|allow_ec_overwrites|fingerprint_algorithm|pg_autoscale_mode|pg_autoscale_bias|pg_num_min|target_size_bytes|target_size_ratio|dedup_tier|dedup_chunk_algorithm|dedup_cdc_chunk_size "
1116 "name=val,type=CephString "
1117 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1118 "set pool parameter <var> to <val>" , "osd" , "rw" )
1119 // 'val' is a CephString because it can include a unit. Perhaps
1120 // there should be a Python type for validation/conversion of strings
1122 COMMAND ( "osd pool set-quota "
1123 "name=pool,type=CephPoolname "
1124 "name=field,type=CephChoices,strings=max_objects|max_bytes "
1125 "name=val,type=CephString" ,
1126 "set object or byte limit on pool" , "osd" , "rw" )
1127 COMMAND ( "osd pool get-quota "
1128 "name=pool,type=CephPoolname " ,
1129 "obtain object or byte limits for pool" ,
1131 COMMAND ( "osd pool application enable "
1132 "name=pool,type=CephPoolname "
1133 "name=app,type=CephString,goodchars=[A-Za-z0-9-_.] "
1134 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1135 "enable use of an application <app> [cephfs,rbd,rgw] on pool <poolname>" ,
1137 COMMAND ( "osd pool application disable "
1138 "name=pool,type=CephPoolname "
1139 "name=app,type=CephString "
1140 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1141 "disables use of an application <app> on pool <poolname>" ,
1143 COMMAND ( "osd pool application set "
1144 "name=pool,type=CephPoolname "
1145 "name=app,type=CephString "
1146 "name=key,type=CephString,goodchars=[A-Za-z0-9-_.] "
1147 "name=value,type=CephString,goodchars=[A-Za-z0-9-_.=]" ,
1148 "sets application <app> metadata key <key> to <value> on pool <poolname>" ,
1150 COMMAND ( "osd pool application rm "
1151 "name=pool,type=CephPoolname "
1152 "name=app,type=CephString "
1153 "name=key,type=CephString" ,
1154 "removes application <app> metadata key <key> on pool <poolname>" ,
1156 COMMAND ( "osd pool application get "
1157 "name=pool,type=CephPoolname,req=fasle "
1158 "name=app,type=CephString,req=false "
1159 "name=key,type=CephString,req=false" ,
1160 "get value of key <key> of application <app> on pool <poolname>" ,
1162 COMMAND ( "osd utilization" ,
1163 "get basic pg distribution stats" ,
1165 COMMAND ( "osd force_healthy_stretch_mode " \
1166 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1167 "force a healthy stretch mode, requiring the full number of CRUSH buckets "
1168 "to peer and letting all non-tiebreaker monitors be elected leader " ,
1170 COMMAND ( "osd force_recovery_stretch_mode " \
1171 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1172 "try and force a recovery stretch mode, increasing the "
1173 "pool size to its non-failure value if currently degraded and "
1174 "all monitor buckets are up" ,
1179 COMMAND ( "osd tier add "
1180 "name=pool,type=CephPoolname "
1181 "name=tierpool,type=CephPoolname "
1182 "name=force_nonempty,type=CephChoices,strings=--force-nonempty,req=false" ,
1183 "add the tier <tierpool> (the second one) to base pool <pool> (the first one)" ,
1185 COMMAND ( "osd tier rm "
1186 "name=pool,type=CephPoolname "
1187 "name=tierpool,type=CephPoolname" ,
1188 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)" ,
1190 COMMAND_WITH_FLAG ( "osd tier remove "
1191 "name=pool,type=CephPoolname "
1192 "name=tierpool,type=CephPoolname" ,
1193 "remove the tier <tierpool> (the second one) from base pool <pool> (the first one)" ,
1196 COMMAND ( "osd tier cache-mode "
1197 "name=pool,type=CephPoolname "
1198 "name=mode,type=CephChoices,strings=writeback|readproxy|readonly|none "
1199 "name=yes_i_really_mean_it,type=CephBool,req=false" ,
1200 "specify the caching mode for cache tier <pool>" , "osd" , "rw" )
1201 COMMAND ( "osd tier set-overlay "
1202 "name=pool,type=CephPoolname "
1203 "name=overlaypool,type=CephPoolname" ,
1204 "set the overlay pool for base pool <pool> to be <overlaypool>" , "osd" , "rw" )
1205 COMMAND ( "osd tier rm-overlay "
1206 "name=pool,type=CephPoolname " ,
1207 "remove the overlay pool for base pool <pool>" , "osd" , "rw" )
1208 COMMAND_WITH_FLAG ( "osd tier remove-overlay "
1209 "name=pool,type=CephPoolname " ,
1210 "remove the overlay pool for base pool <pool>" , "osd" , "rw" ,
1213 COMMAND ( "osd tier add-cache "
1214 "name=pool,type=CephPoolname "
1215 "name=tierpool,type=CephPoolname "
1216 "name=size,type=CephInt,range=0" ,
1217 "add a cache <tierpool> (the second one) of size <size> to existing pool <pool> (the first one)" ,
1224 COMMAND ( "config-key get "
1225 "name=key,type=CephString" ,
1226 "get <key>" , "config-key" , "r" )
1227 COMMAND ( "config-key set "
1228 "name=key,type=CephString "
1229 "name=val,type=CephString,req=false" ,
1230 "set <key> to value <val>" , "config-key" , "rw" )
1231 COMMAND_WITH_FLAG ( "config-key put "
1232 "name=key,type=CephString "
1233 "name=val,type=CephString,req=false" ,
1234 "put <key>, value <val>" , "config-key" , "rw" ,
1236 COMMAND_WITH_FLAG ( "config-key del "
1237 "name=key,type=CephString" ,
1238 "delete <key>" , "config-key" , "rw" ,
1240 COMMAND ( "config-key rm "
1241 "name=key,type=CephString" ,
1242 "rm <key>" , "config-key" , "rw" )
1243 COMMAND ( "config-key exists "
1244 "name=key,type=CephString" ,
1245 "check for <key>'s existence" , "config-key" , "r" )
1246 COMMAND_WITH_FLAG ( "config-key list " , "list keys" , "config-key" , "r" ,
1248 COMMAND ( "config-key ls " , "list keys" , "config-key" , "r" )
1249 COMMAND ( "config-key dump "
1250 "name=key,type=CephString,req=false" , "dump keys and values (with optional prefix)" , "config-key" , "r" )
1257 "dump basic info about the mgr cluster state" ,
1260 "name=epoch,type=CephInt,range=0,req=false" ,
1261 "dump the latest MgrMap" ,
1263 COMMAND ( "mgr fail name=who,type=CephString,req=false" ,
1264 "treat the named manager daemon as failed" , "mgr" , "rw" )
1265 COMMAND ( "mgr module ls" ,
1266 "list active mgr modules" , "mgr" , "r" )
1267 COMMAND ( "mgr services" ,
1268 "list service endpoints provided by mgr modules" ,
1270 COMMAND ( "mgr module enable "
1271 "name=module,type=CephString "
1272 "name=force,type=CephChoices,strings=--force,req=false" ,
1273 "enable mgr module" , "mgr" , "rw" )
1274 COMMAND ( "mgr module disable "
1275 "name=module,type=CephString" ,
1276 "disable mgr module" , "mgr" , "rw" )
1277 COMMAND ( "mgr metadata name=who,type=CephString,req=false" ,
1278 "dump metadata for all daemons or a specific daemon" ,
1280 COMMAND ( "mgr count-metadata name=property,type=CephString" ,
1281 "count ceph-mgr daemons by metadata field property" ,
1283 COMMAND ( "mgr versions" ,
1284 "check running versions of ceph-mgr daemons" ,
1288 COMMAND ( "config set"
1289 " name=who,type=CephString"
1290 " name=name,type=CephString"
1291 " name=value,type=CephString"
1292 " name=force,type=CephBool,req=false" ,
1293 "Set a configuration option for one or more entities" ,
1296 " name=who,type=CephString"
1297 " name=name,type=CephString" ,
1298 "Clear a configuration option for one or more entities" ,
1300 COMMAND ( "config get "
1301 "name=who,type=CephString "
1302 "name=key,type=CephString,req=False" ,
1303 "Show configuration option(s) for an entity" ,
1305 COMMAND ( "config dump" ,
1306 "Show all configuration option(s)" ,
1308 COMMAND ( "config help "
1309 "name=key,type=CephString" ,
1310 "Describe a configuration option" ,
1312 COMMAND ( "config ls" ,
1313 "List available configuration options" ,
1315 COMMAND ( "config assimilate-conf" ,
1316 "Assimilate options from a conf, and return a new, minimal conf file" ,
1318 COMMAND ( "config log name=num,type=CephInt,req=False" ,
1319 "Show recent history of config changes" ,
1321 COMMAND ( "config reset "
1322 "name=num,type=CephInt,range=0" ,
1323 "Revert configuration to a historical version specified by <num>" ,
1325 COMMAND ( "config generate-minimal-conf" ,
1326 "Generate a minimal ceph.conf file" ,
1332 // these are tell commands that were implemented as CLI commands in
1333 // the broken pre-octopus way that we want to allow to work when a
1334 // monitor has upgraded to octopus+ but the monmap min_mon_release is
1335 // still < octopus. we exclude things that weren't well supported
1336 // before and that aren't implemented by the octopus mon anymore.
1338 // the command set below matches the kludge in Monitor::handle_command
1339 // that shunts these off to the asok machinery.
1341 COMMAND_WITH_FLAG ( "injectargs "
1342 "name=injected_args,type=CephString,n=N" ,
1343 "inject config arguments into monitor" , "mon" , "rw" ,
1345 COMMAND_WITH_FLAG ( "smart name=devid,type=CephString,req=false" ,
1346 "Query health metrics for underlying device" ,
1349 COMMAND_WITH_FLAG ( "mon_status" ,
1350 "report status of monitors" ,
1353 COMMAND_WITH_FLAG ( "heap "
1354 "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats "
1355 "name=value,type=CephString,req=false" ,
1356 "show heap usage info (available only if compiled with tcmalloc)" ,
1359 COMMAND_WITH_FLAG ( "connection scores dump" ,
1360 "show the scores used in connectivity-based elections" ,
1363 COMMAND_WITH_FLAG ( "connection scores reset" ,
1364 "reset the scores used in connectivity-based elections" ,
1367 COMMAND_WITH_FLAG ( "sync_force "
1368 "name=validate,type=CephChoices,strings=--yes-i-really-mean-it,req=false" ,
1369 "force sync of and clear monitor store" ,
1372 COMMAND_WITH_FLAG ( "add_bootstrap_peer_hint "
1373 "name=addr,type=CephIPAddr" ,
1374 "add peer address as potential bootstrap "
1375 "peer for cluster bringup" ,
1378 COMMAND_WITH_FLAG ( "add_bootstrap_peer_hintv "
1379 "name=addrv,type=CephString" ,
1380 "add peer address vector as potential bootstrap "
1381 "peer for cluster bringup" ,
1384 COMMAND_WITH_FLAG ( "quorum enter " ,
1385 "force monitor back into quorum" ,
1388 COMMAND_WITH_FLAG ( "quorum exit" ,
1389 "force monitor out of the quorum" ,
1392 COMMAND_WITH_FLAG ( "ops" ,
1393 "show the ops currently in flight" ,
1396 COMMAND_WITH_FLAG ( "sessions" ,
1397 "list existing sessions" ,
1400 COMMAND_WITH_FLAG ( "dump_historic_ops" ,
1401 "dump_historic_ops" ,