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 ``bluestore`` (default) setup.
84 It will create all necessary volume groups and logical volumes required to have a working OSD.
86 Example usage with three devices::
88 ceph-volume lvm batch --bluestore /dev/sda /dev/sdb /dev/sdc
92 .. option:: -h, --help
94 show the help message and exit
96 .. option:: --bluestore
98 Use the bluestore objectstore (default)
102 Skip the report and prompt to continue provisioning
104 .. option:: --prepare
106 Only prepare OSDs, do not activate
108 .. option:: --dmcrypt
110 Enable encryption for the underlying OSD devices
112 .. option:: --crush-device-class
114 Define a CRUSH device class to assign the OSD to
116 .. option:: --no-systemd
118 Do not enable or create any systemd units
120 .. option:: --osds-per-device
122 Provision more than 1 (the default) OSD per device
126 Report what the potential outcome would be for the current input (requires devices
131 Output format when reporting (used along with --report), can be one of 'pretty'
134 .. option:: --block-db-size
136 Set (or override) the "bluestore_block_db_size" value, in bytes
138 .. option:: --journal-size
140 Override the "osd_journal_size" value, in megabytes
142 Required positional arguments:
144 .. describe:: <DEVICE>
146 Full path to a raw device, like ``/dev/sda``. Multiple
147 ``<DEVICE>`` paths can be passed in.
152 .. program:: ceph-volume lvm activate
154 Enables a systemd unit that persists the OSD ID and its UUID (also called
155 ``fsid`` in Ceph CLI tools), so that at boot time it can understand what OSD is
156 enabled and needs to be mounted.
160 ceph-volume lvm activate --bluestore <osd id> <osd fsid>
164 .. option:: -h, --help
166 show the help message and exit
168 .. option:: --auto-detect-objectstore
170 Automatically detect the objectstore by inspecting
173 .. option:: --bluestore
175 bluestore objectstore (default)
179 Activate all OSDs found in the system
181 .. option:: --no-systemd
183 Skip creating and enabling systemd units and starting of OSD
186 Multiple OSDs can be activated at once by using the (idempotent) ``--all`` flag::
188 ceph-volume lvm activate --all
194 .. program:: ceph-volume lvm prepare
196 Prepares a logical volume to be used as an OSD and journal using a ``bluestore`` (default) setup.
197 It will not create or modify the logical volumes except for adding extra metadata.
201 ceph-volume lvm prepare --bluestore --data <data lv> --journal <journal device>
205 .. option:: -h, --help
207 show the help message and exit
209 .. option:: --journal JOURNAL
211 logical group name, path to a logical volume, or path to a device
213 .. option:: --bluestore
215 Use the bluestore objectstore (default)
217 .. option:: --block.wal
219 Path to a bluestore block.wal logical volume or partition
221 .. option:: --block.db
223 Path to a bluestore block.db logical volume or partition
225 .. option:: --dmcrypt
227 Enable encryption for the underlying OSD devices
229 .. option:: --osd-id OSD_ID
231 Reuse an existing OSD id
233 .. option:: --osd-fsid OSD_FSID
235 Reuse an existing OSD fsid
237 .. option:: --crush-device-class
239 Define a CRUSH device class to assign the OSD to
245 A logical group name or a path to a logical volume
247 For encrypting an OSD, the ``--dmcrypt`` flag must be added when preparing
248 (also supported in the ``create`` sub-command).
254 Wraps the two-step process to provision a new osd (calling ``prepare`` first
255 and then ``activate``) into a single one. The reason to prefer ``prepare`` and
256 then ``activate`` is to gradually introduce new OSDs into a cluster, and
257 avoiding large amounts of data being rebalanced.
259 The single-call process unifies exactly what ``prepare`` and ``activate`` do,
260 with the convenience of doing it all at once. Flags and general usage are
261 equivalent to those of the ``prepare`` and ``activate`` subcommand.
266 This subcommand is not meant to be used directly, and it is used by systemd so
267 that it proxies input to ``ceph-volume lvm activate`` by parsing the
268 input from systemd, detecting the UUID and ID associated with an OSD.
272 ceph-volume lvm trigger <SYSTEMD-DATA>
274 The systemd "data" is expected to be in the format of::
278 The lvs associated with the OSD need to have been prepared previously,
279 so that all needed tags and metadata exist.
281 Positional arguments:
283 .. describe:: <SYSTEMD_DATA>
285 Data from a systemd unit containing ID and UUID of the OSD.
290 List devices or logical volumes associated with Ceph. An association is
291 determined if a device has information relating to an OSD. This is
292 verified by querying LVM's metadata and correlating it with devices.
294 The lvs associated with the OSD need to have been prepared previously by
295 ceph-volume so that all needed tags and metadata exist.
301 List a particular device, reporting all metadata about it::
303 ceph-volume lvm list /dev/sda1
305 List a logical volume, along with all its metadata (vg is a volume
306 group, and lv the logical volume name)::
308 ceph-volume lvm list {vg/lv}
310 Positional arguments:
312 .. describe:: <DEVICE>
314 Either in the form of ``vg/lv`` for logical volumes,
315 ``/path/to/sda1`` or ``/path/to/sda`` for regular devices.
321 Zaps the given logical volume or partition. If given a path to a logical
322 volume it must be in the format of vg/lv. Any file systems present
323 on the given lv or partition will be removed and all data will be purged.
325 However, the lv or partition will be kept intact.
327 Usage, for logical volumes::
329 ceph-volume lvm zap {vg/lv}
331 Usage, for logical partitions::
333 ceph-volume lvm zap /dev/sdc1
335 For full removal of the device use the ``--destroy`` flag (allowed for all
338 ceph-volume lvm zap --destroy /dev/sdc1
340 Multiple devices can be removed by specifying the OSD ID and/or the OSD FSID::
342 ceph-volume lvm zap --destroy --osd-id 1
343 ceph-volume lvm zap --destroy --osd-id 1 --osd-fsid C9605912-8395-4D76-AFC0-7DFDAC315D59
346 Positional arguments:
348 .. describe:: <DEVICE>
350 Either in the form of ``vg/lv`` for logical volumes,
351 ``/path/to/sda1`` or ``/path/to/sda`` for regular devices.
357 .. program:: ceph-volume lvm new-wal
359 Attaches the given logical volume to OSD as a WAL. Logical volume
360 name format is vg/lv. Fails if OSD has already got attached WAL.
364 ceph-volume lvm new-wal --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv>
368 .. option:: -h, --help
370 show the help message and exit
372 .. option:: --no-systemd
374 Skip checking OSD systemd unit
380 logical volume name to attach as WAL
385 .. program:: ceph-volume lvm new-db
387 Attaches the given logical volume to OSD as a DB. Logical volume
388 name format is vg/lv. Fails if OSD has already got attached DB.
392 ceph-volume lvm new-db --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv>
396 .. option:: -h, --help
398 show the help message and exit
400 .. option:: --no-systemd
402 Skip checking OSD systemd unit
408 logical volume name to attach as DB
413 .. program:: ceph-volume lvm migrate
415 Moves BlueFS data from source volume(s) to the target one, source volumes
416 (except the main, i.e. data or block one) are removed on success. LVM volumes
417 are permitted for Target only, both already attached or new one. In the latter
418 case it is attached to the OSD replacing one of the source devices. Following
419 replacement rules apply (in the order of precedence, stop on the first match):
421 - if source list has DB volume - target device replaces it.
422 - if source list has WAL volume - target device replace it.
423 - if source list has slow volume only - operation is not permitted,
424 requires explicit allocation via new-db/new-wal command.
428 ceph-volume lvm migrate --osd-id OSD_ID --osd-fsid OSD_FSID --target <target lv> --from {data|db|wal} [{data|db|wal} ...]
432 .. option:: -h, --help
434 show the help message and exit
436 .. option:: --no-systemd
438 Skip checking OSD systemd unit
444 list of source device type names
448 logical volume to move data to
453 Scan legacy OSD directories or data devices that may have been created by
454 ceph-disk, or manually.
461 .. program:: ceph-volume simple activate
463 Enables a systemd unit that persists the OSD ID and its UUID (also called
464 ``fsid`` in Ceph CLI tools), so that at boot time it can understand what OSD is
465 enabled and needs to be mounted, while reading information that was previously
466 created and persisted at ``/etc/ceph/osd/`` in JSON format.
470 ceph-volume simple activate --bluestore <osd id> <osd fsid>
474 .. option:: -h, --help
476 show the help message and exit
478 .. option:: --bluestore
480 bluestore objectstore (default)
484 It requires a matching JSON file with the following format::
486 /etc/ceph/osd/<osd id>-<osd fsid>.json
492 .. program:: ceph-volume simple scan
494 Scan a running OSD or data device for an OSD for metadata that can later be
495 used to activate and manage the OSD with ceph-volume. The scan method will
496 create a JSON file with the required information plus anything found in the OSD
499 Optionally, the JSON blob can be sent to stdout for further inspection.
501 Usage on all running OSDs::
503 ceph-volume simple scan
505 Usage on data devices::
507 ceph-volume simple scan <data device>
509 Running OSD directories::
511 ceph-volume simple scan <path to osd dir>
516 .. option:: -h, --help
518 show the help message and exit
522 Send the JSON blob to stdout
526 If the JSON file exists at destination, overwrite it
528 Optional Positional arguments:
530 .. describe:: <DATA DEVICE or OSD DIR>
532 Actual data partition or a path to the running OSD
537 This subcommand is not meant to be used directly, and it is used by systemd so
538 that it proxies input to ``ceph-volume simple activate`` by parsing the
539 input from systemd, detecting the UUID and ID associated with an OSD.
543 ceph-volume simple trigger <SYSTEMD-DATA>
545 The systemd "data" is expected to be in the format of::
549 The JSON file associated with the OSD need to have been persisted previously by
550 a scan (or manually), so that all needed metadata can be used.
552 Positional arguments:
554 .. describe:: <SYSTEMD_DATA>
556 Data from a systemd unit containing ID and UUID of the OSD.
562 :program:`ceph-volume` is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to
563 the documentation at http://docs.ceph.com/ for more information.
569 :doc:`ceph-osd <ceph-osd>`\(8),