Preparing OSDs

The prepare subcommand prepares an OSD back-end object store and consumes logical volumes (LV) for both the OSD data and journal. It does not modify the logical volumes, except for adding some extra metadata tags using LVM. These tags make volumes easier to discover, and they also identify the volumes as part of the Ceph Storage Cluster and the roles of those volumes in the storage cluster.

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • Root-level access to the OSD nodes.
  • Optionally, create logical volumes. If you provide a path to a physical device, the subcommand turns the device into a logical volume. This approach is simpler, but you cannot configure or change the way the logical volume is created.

About this task

The BlueStore OSD backend supports the following configurations:
  • A block device, a block.wal device, and a block.db device
  • A block device and a block.wal device
  • A block device and a block.db device
  • A single block device

The prepare subcommand accepts a whole device or partition, or a logical volume for block.

For more information, see:

Procedure

  1. Extract the Ceph keyring.
    ceph auth get client.ID -o ceph.client.ID.keyring
    For example,
    [ceph: root@host01 /]# ceph auth get client.bootstrap-osd -o /var/lib/ceph/bootstrap-osd/ceph.keyring
  2. Prepare the LVM volumes.
    ceph-volume lvm prepare --bluestore --data VOLUME_GROUP/LOGICAL_VOLUME
    For example,
    [ceph: root@host01 /]# ceph-volume lvm prepare --bluestore --data example_vg/data_lv
    1. Optional: To use a separate device for RocksDB, specify the --block.db and --block.wal options.
      ceph-volume lvm prepare --bluestore --block.db --block.wal --data VOLUME_GROUP/LOGICAL_VOLUME
      For example,
      ceph: root@host01 /]# ceph-volume lvm prepare --bluestore --block.db --block.wal --data example_vg/data_lv
    2. To encrypt data, use the --dmcrypt flag.
      ceph-volume lvm prepare --bluestore --dmcrypt --data VOLUME_GROUP/LOGICAL_VOLUME
      For example,
      [ceph: root@host01 /]# ceph-volume lvm prepare --bluestore --dmcrypt --data example_vg/data_lv