The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.

1.5.2 Configuring a Block Device on a Ceph Client

Note

Ensure that the Storage Cluster is active and healthy before configuring a block device.

To configure a Block Device on a Ceph Client:

  1. Create a storage pool for the block device within the OSD using the following command on the Ceph Client system:

    # ceph osd pool create datastore 150 150
  2. Use the rbd command to create a Block Device image in the pool, for example:

    # rbd create --size 4096 --pool datastore vol01

    This example creates a 4096 MB volume named vol01 in the datastore pool.

    Note

    If you do not specify a storage pool, rbd uses the default rbd pool:

    # rbd create --size 4096 vol01
  3. Use the rbd command to map the image to a Block Device, for example:

    # rbd map vol01 --pool datastore

    Ceph creates the Block Device under /dev/rbd/pool/volume.

    Note that the rbd kernel module is not loaded until you run this command. You can check that it is loaded after running the command by doing the following:

    # lsmod|grep rbd
     rbd      73304   1
     libceph  235751  2  rbd,ceph

    The rbd ls command lists the images that you have mapped for a storage pool, for example:

    # rbd ls -p datastore
    vol01
  4. You can make a file system on the Block Device and mount this file system on a suitable mount point on the Ceph Client node, for example:

    # mkfs.ext4 -m0 /dev/rbd/datastore/vol01
    # mkdir /var/vol01
    # mount /dev/rbd/datastore/vol01 /var/vol01

1.5.2.1 Removing a Block Device and its Storage Pool

To remove a Block Device and the Storage Pool where it is hosted:

  1. Unmount any file system that is using the Block Device, for example:

    # umount /var/vol01
  2. Unmap the Block Device from its image, for example:

    # rbd unmap /dev/rbd/datastore/vol01
  3. Remove the Block Device image, for example:

    # rbd rm vol01 -p datastore
  4. Remove the Storage Pool, for example:

    # ceph osd pool delete datastore datastore --yes-i-really-really-mean-it