ceph-disk is a utility that can prepare and activate a disk, partition or directory as a Ceph OSD. It is run directly or triggered by ceph-deploy or udev. It can also be triggered by other deployment utilities like Chef, Juju, Puppet etc.
It actually automates the multiple steps involved in manual creation and start of an OSD into two steps of preparing and activating the OSD by using the subcommands prepare and activate.
Prepare a directory, disk or drive for a Ceph OSD. It creates a GPT partition, marks the partition with Ceph type uuid, creates a file system, marks the file system as ready for Ceph consumption, uses entire partition and adds a new partition to the journal disk. It is run directly or triggered by ceph-deploy.
Usage:
ceph-disk prepare --cluster [cluster-name] --cluster-uuid [uuid] --fs-type
[ext4|xfs|btrfs] [data-path] [journal-path]
Other options like --osd-uuid, --journal-uuid, --zap-disk, --data-dir, --data-dev, --journal-file, --journal-dev, --dmcrypt and --dmcrypt-key-dir can also be used with the subcommand.
Activate the Ceph OSD. It mounts the volume in a temporary location, allocates an OSD id (if needed), remounts in the correct location /var/lib/ceph/osd/$cluster-$id and starts ceph-osd. It is triggered by udev when it sees the OSD GPT partition type or on ceph service start with ceph disk activate-all. It is also run directly or triggered by ceph-deploy.
Usage:
ceph-disk activate [PATH]
Here, [PATH] is path to a block device or a directory.
An additional option --activate-key has to be used with this subcommand when a copy of /var/lib/ceph/bootstrap-osd/{cluster}.keyring isn’t present in the OSD node.
Usage:
ceph-disk activate [PATH] [--activate-key PATH]
Another option --mark-init can also be used with this subcommand. --mark-init provides init system to manage the OSD directory. It defaults to auto which detects the init system suitable for ceph (either sysvinit, systemd or upstart). The argument can be used to override the init system. It may be convenient when an operating system supports multiple init systems, such as Debian GNU/Linux jessie with systemd and sysvinit. If the argument is none, the OSD is not marked with any init system and ceph-disk activate needs to be called explicitely after each reboot.
Usage:
ceph-disk activate [PATH] [--mark-init *sysvinit|upstart|systemd|auto|none*]
If the option --no-start-daemon is given, the activation steps are performed but the OSD daemon is not started.
Activate an OSD via it’s journal device. udev triggers ceph-disk activate-journal <dev> based on the partition type.
Usage:
ceph-disk activate-journal [DEV]
Here, [DEV] is the path to a journal block device.
Others options like --activate-key and --mark-init can also be used with this subcommand.
--mark-init provides init system to manage the OSD directory.
Usage:
ceph-disk activate-journal [--activate-key PATH] [--mark-init INITSYSTEM] [DEV]
Activate all tagged OSD partitions. activate-all relies on /dev/disk/by-parttype-uuid/$typeuuid.$uuid to find all partitions. Special udev rules are installed to create these links. It is triggered on ceph service start or run directly.
Usage:
ceph-disk activate-all
Others options like --activate-key and --mark-init can also be used with this subcommand.
--mark-init provides init system to manage the OSD directory.
Usage:
ceph-disk activate-all [--activate-key PATH] [--mark-init INITSYSTEM]
List disk partitions and Ceph OSDs. It is run directly or triggered by ceph-deploy.
Usage:
ceph-disk list
Suppress activate on a device (prefix). Mark devices that you don’t want to activate with a file like /var/lib/ceph/tmp/suppress-activate.sdb where the last bit is the sanitized device name (/dev/X without the /dev/ prefix). A function is_suppressed() checks for and matches a prefix (/dev/). It means suppressing sdb will stop activate on sdb1, sdb2, etc.
Usage:
ceph-disk suppress-activate [PATH]
Here, [PATH] is path to a block device or a directory.
Stop suppressing activate on a device (prefix). It is used to activate a device that was earlier kept deactivated using suppress-activate.
Usage:
ceph-disk unsuppress-activate [PATH]
Here, [PATH] is path to a block device or a directory.
Zap/erase/destroy a device’s partition table and contents. It actually uses sgdisk and it’s option --zap-all to destroy both GPT and MBR data structures so that the disk becomes suitable for repartitioning. sgdisk then uses --mbrtogpt to convert the MBR or BSD disklabel disk to a GPT disk. The prepare subcommand can now be executed which will create a new GPT partition. It is also run directly or triggered by ceph-deploy.
Usage:
ceph-disk zap [DEV]
Here, [DEV] is path to a block device.
Prepend PATH to $PATH for backward compatibility (default /usr/bin).
Directory in which ceph configuration is preserved (default /usr/lib/ceph).
Directory in which ceph configuration files are found (default /etc/ceph).
Provide name of the ceph cluster in which the OSD is being prepared.
Provide uuid of the ceph cluster in which the OSD is being prepared.
Provide the filesytem type for the OSD. e.g. xfs/ext4/btrfs.
Unique OSD uuid to assign to the disk.
Unique uuid to assign to the journal.
Destroy the partition table and content of a disk.
Verify that [data-path] is of a directory.
Verify that [data-path] is of a block device.
Verify that journal is a file.
Verify that journal is a block device.
Encrypt [data-path] and/or journal devices with dm-crypt.
Directory where dm-crypt keys are stored.
Use when a copy of /var/lib/ceph/bootstrap-osd/{cluster}.keyring isn’t present in the OSD node. Suffix the option by the path to the keyring.
Provide init system to manage the OSD directory.
ceph-disk is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to the Ceph documentation at http://ceph.com/docs for more information.
ceph-osd(8), ceph-deploy(8)