3 =======================================================
4 ceph-volume -- Ceph OSD deployment and inspection tool
5 =======================================================
7 .. program:: ceph-volume
12 **ceph-volume** [-h] [--cluster CLUSTER] [--log-level LOG_LEVEL]
15 **ceph-volume** **inventory**
17 **ceph-volume** **lvm** [ *trigger* | *create* | *activate* | *prepare*
18 | *zap* | *list* | *batch* | *new-wal* | *new-db* | *migrate* ]
20 **ceph-volume** **simple** [ *trigger* | *scan* | *activate* ]
26 :program:`ceph-volume` is a single purpose command line tool to deploy logical
27 volumes as OSDs, trying to maintain a similar API to ``ceph-disk`` when
28 preparing, activating, and creating OSDs.
30 It deviates from ``ceph-disk`` by not interacting or relying on the udev rules
31 that come installed for Ceph. These rules allow automatic detection of
32 previously setup devices that are in turn fed into ``ceph-disk`` to activate
42 .. program:: ceph-volume inventory
44 This subcommand provides information about a host's physical disc inventory and
45 reports metadata about these discs. Among this metadata one can find disc
46 specific data items (like model, size, rotational or solid state) as well as
47 data items specific to ceph using a device, such as if it is available for
48 use with ceph or if logical volumes are present.
53 ceph-volume inventory /dev/sda
54 ceph-volume inventory --format json-pretty
58 .. option:: -h, --help
60 show the help message and exit
64 report format, valid values are ``plain`` (default),
65 ``json`` and ``json-pretty``
70 .. program:: ceph-volume lvm
72 By making use of LVM tags, the ``lvm`` sub-command is able to store and later
73 re-discover and query devices associated with OSDs so that they can later
81 .. program:: ceph-volume lvm batch
83 Creates OSDs from a list of devices using a ``filestore``
84 or ``bluestore`` (default) setup. It will create all necessary volume groups
85 and logical volumes required to have a working OSD.
87 Example usage with three devices::
89 ceph-volume lvm batch --bluestore /dev/sda /dev/sdb /dev/sdc
93 .. option:: -h, --help
95 show the help message and exit
97 .. option:: --bluestore
99 Use the bluestore objectstore (default)
101 .. option:: --filestore
103 Use the filestore objectstore
107 Skip the report and prompt to continue provisioning
109 .. option:: --prepare
111 Only prepare OSDs, do not activate
113 .. option:: --dmcrypt
115 Enable encryption for the underlying OSD devices
117 .. option:: --crush-device-class
119 Define a CRUSH device class to assign the OSD to
121 .. option:: --no-systemd
123 Do not enable or create any systemd units
125 .. option:: --osds-per-device
127 Provision more than 1 (the default) OSD per device
131 Report what the potential outcome would be for the current input (requires devices
136 Output format when reporting (used along with --report), can be one of 'pretty'
139 .. option:: --block-db-size
141 Set (or override) the "bluestore_block_db_size" value, in bytes
143 .. option:: --journal-size
145 Override the "osd_journal_size" value, in megabytes
147 Required positional arguments:
149 .. describe:: <DEVICE>
151 Full path to a raw device, like ``/dev/sda``. Multiple
152 ``<DEVICE>`` paths can be passed in.
157 .. program:: ceph-volume lvm activate
159 Enables a systemd unit that persists the OSD ID and its UUID (also called
160 ``fsid`` in Ceph CLI tools), so that at boot time it can understand what OSD is
161 enabled and needs to be mounted.
165 ceph-volume lvm activate --bluestore <osd id> <osd fsid>
169 .. option:: -h, --help
171 show the help message and exit
173 .. option:: --auto-detect-objectstore
175 Automatically detect the objectstore by inspecting
178 .. option:: --bluestore
180 bluestore objectstore (default)
182 .. option:: --filestore
184 filestore objectstore
188 Activate all OSDs found in the system
190 .. option:: --no-systemd
192 Skip creating and enabling systemd units and starting of OSD
195 Multiple OSDs can be activated at once by using the (idempotent) ``--all`` flag::
197 ceph-volume lvm activate --all
203 .. program:: ceph-volume lvm prepare
205 Prepares a logical volume to be used as an OSD and journal using a ``filestore``
206 or ``bluestore`` (default) setup. It will not create or modify the logical volumes
207 except for adding extra metadata.
211 ceph-volume lvm prepare --filestore --data <data lv> --journal <journal device>
215 .. option:: -h, --help
217 show the help message and exit
219 .. option:: --journal JOURNAL
221 logical group name, path to a logical volume, or path to a device
223 .. option:: --bluestore
225 Use the bluestore objectstore (default)
227 .. option:: --block.wal
229 Path to a bluestore block.wal logical volume or partition
231 .. option:: --block.db
233 Path to a bluestore block.db logical volume or partition
235 .. option:: --filestore
237 Use the filestore objectstore
239 .. option:: --dmcrypt
241 Enable encryption for the underlying OSD devices
243 .. option:: --osd-id OSD_ID
245 Reuse an existing OSD id
247 .. option:: --osd-fsid OSD_FSID
249 Reuse an existing OSD fsid
251 .. option:: --crush-device-class
253 Define a CRUSH device class to assign the OSD to
259 A logical group name or a path to a logical volume
261 For encrypting an OSD, the ``--dmcrypt`` flag must be added when preparing
262 (also supported in the ``create`` sub-command).
268 Wraps the two-step process to provision a new osd (calling ``prepare`` first
269 and then ``activate``) into a single one. The reason to prefer ``prepare`` and
270 then ``activate`` is to gradually introduce new OSDs into a cluster, and
271 avoiding large amounts of data being rebalanced.
273 The single-call process unifies exactly what ``prepare`` and ``activate`` do,
274 with the convenience of doing it all at once. Flags and general usage are
275 equivalent to those of the ``prepare`` and ``activate`` subcommand.
280 This subcommand is not meant to be used directly, and it is used by systemd so
281 that it proxies input to ``ceph-volume lvm activate`` by parsing the
282 input from systemd, detecting the UUID and ID associated with an OSD.
286 ceph-volume lvm trigger <SYSTEMD-DATA>
288 The systemd "data" is expected to be in the format of::
292 The lvs associated with the OSD need to have been prepared previously,
293 so that all needed tags and metadata exist.
295 Positional arguments:
297 .. describe:: <SYSTEMD_DATA>
299 Data from a systemd unit containing ID and UUID of the OSD.
304 List devices or logical volumes associated with Ceph. An association is
305 determined if a device has information relating to an OSD. This is
306 verified by querying LVM's metadata and correlating it with devices.
308 The lvs associated with the OSD need to have been prepared previously by
309 ceph-volume so that all needed tags and metadata exist.
315 List a particular device, reporting all metadata about it::
317 ceph-volume lvm list /dev/sda1
319 List a logical volume, along with all its metadata (vg is a volume
320 group, and lv the logical volume name)::
322 ceph-volume lvm list {vg/lv}
324 Positional arguments:
326 .. describe:: <DEVICE>
328 Either in the form of ``vg/lv`` for logical volumes,
329 ``/path/to/sda1`` or ``/path/to/sda`` for regular devices.
335 Zaps the given logical volume or partition. If given a path to a logical
336 volume it must be in the format of vg/lv. Any file systems present
337 on the given lv or partition will be removed and all data will be purged.
339 However, the lv or partition will be kept intact.
341 Usage, for logical volumes::
343 ceph-volume lvm zap {vg/lv}
345 Usage, for logical partitions::
347 ceph-volume lvm zap /dev/sdc1
349 For full removal of the device use the ``--destroy`` flag (allowed for all
352 ceph-volume lvm zap --destroy /dev/sdc1
354 Multiple devices can be removed by specifying the OSD ID and/or the OSD FSID::
356 ceph-volume lvm zap --destroy --osd-id 1
357 ceph-volume lvm zap --destroy --osd-id 1 --osd-fsid C9605912-8395-4D76-AFC0-7DFDAC315D59
360 Positional arguments:
362 .. describe:: <DEVICE>
364 Either in the form of ``vg/lv`` for logical volumes,
365 ``/path/to/sda1`` or ``/path/to/sda`` for regular devices.
371 .. program:: ceph-volume lvm new-wal
373 Attaches the given logical volume to OSD as a WAL. Logical volume
374 name format is vg/lv. Fails if OSD has already got attached WAL.
378 ceph-volume lvm new-wal --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv>
382 .. option:: -h, --help
384 show the help message and exit
386 .. option:: --no-systemd
388 Skip checking OSD systemd unit
394 logical volume name to attach as WAL
399 .. program:: ceph-volume lvm new-db
401 Attaches the given logical volume to OSD as a DB. Logical volume
402 name format is vg/lv. Fails if OSD has already got attached DB.
406 ceph-volume lvm new-db --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv>
410 .. option:: -h, --help
412 show the help message and exit
414 .. option:: --no-systemd
416 Skip checking OSD systemd unit
422 logical volume name to attach as DB
427 .. program:: ceph-volume lvm migrate
429 Moves BlueFS data from source volume(s) to the target one, source volumes
430 (except the main, i.e. data or block one) are removed on success. LVM volumes
431 are permitted for Target only, both already attached or new one. In the latter
432 case it is attached to the OSD replacing one of the source devices. Following
433 replacement rules apply (in the order of precedence, stop on the first match):
435 - if source list has DB volume - target device replaces it.
436 - if source list has WAL volume - target device replace it.
437 - if source list has slow volume only - operation is not permitted,
438 requires explicit allocation via new-db/new-wal command.
442 ceph-volume lvm migrate --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv> --from {data|db|wal} [{data|db|wal} ...]
446 .. option:: -h, --help
448 show the help message and exit
450 .. option:: --no-systemd
452 Skip checking OSD systemd unit
458 list of source device type names
462 logical volume to move data to
467 Scan legacy OSD directories or data devices that may have been created by
468 ceph-disk, or manually.
475 .. program:: ceph-volume simple activate
477 Enables a systemd unit that persists the OSD ID and its UUID (also called
478 ``fsid`` in Ceph CLI tools), so that at boot time it can understand what OSD is
479 enabled and needs to be mounted, while reading information that was previously
480 created and persisted at ``/etc/ceph/osd/`` in JSON format.
484 ceph-volume simple activate --bluestore <osd id> <osd fsid>
488 .. option:: -h, --help
490 show the help message and exit
492 .. option:: --bluestore
494 bluestore objectstore (default)
496 .. option:: --filestore
498 filestore objectstore
502 It requires a matching JSON file with the following format::
504 /etc/ceph/osd/<osd id>-<osd fsid>.json
510 .. program:: ceph-volume simple scan
512 Scan a running OSD or data device for an OSD for metadata that can later be
513 used to activate and manage the OSD with ceph-volume. The scan method will
514 create a JSON file with the required information plus anything found in the OSD
517 Optionally, the JSON blob can be sent to stdout for further inspection.
519 Usage on all running OSDs::
521 ceph-volume simple scan
523 Usage on data devices::
525 ceph-volume simple scan <data device>
527 Running OSD directories::
529 ceph-volume simple scan <path to osd dir>
534 .. option:: -h, --help
536 show the help message and exit
540 Send the JSON blob to stdout
544 If the JSON file exists at destination, overwrite it
546 Optional Positional arguments:
548 .. describe:: <DATA DEVICE or OSD DIR>
550 Actual data partition or a path to the running OSD
555 This subcommand is not meant to be used directly, and it is used by systemd so
556 that it proxies input to ``ceph-volume simple activate`` by parsing the
557 input from systemd, detecting the UUID and ID associated with an OSD.
561 ceph-volume simple trigger <SYSTEMD-DATA>
563 The systemd "data" is expected to be in the format of::
567 The JSON file associated with the OSD need to have been persisted previously by
568 a scan (or manually), so that all needed metadata can be used.
570 Positional arguments:
572 .. describe:: <SYSTEMD_DATA>
574 Data from a systemd unit containing ID and UUID of the OSD.
580 :program:`ceph-volume` is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to
581 the documentation at http://docs.ceph.com/ for more information.
587 :doc:`ceph-osd <ceph-osd>`\(8),