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.
Ensure that the Storage Cluster is active and healthy before configuring a block device.
To configure a Block Device on a Ceph Client:
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 150Use the rbd command to create a Block Device image in the pool, for example:
#
rbd create --size 4096 --pool datastore vol01This example creates a 4096 MB volume named
vol01in thedatastorepool.NoteIf you do not specify a storage pool, rbd uses the default
rbdpool:#
rbd create --size 4096 vol01Use the rbd command to map the image to a Block Device, for example:
#
rbd map vol01 --pool datastoreCeph creates the Block Device under
/dev/rbd/.pool/volumeNote 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 rbdrbd 73304 1 libceph 235751 2 rbd,cephThe rbd ls command lists the images that you have mapped for a storage pool, for example:
#
rbd ls -p datastorevol01You 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
To remove a Block Device and the Storage Pool where it is hosted:
Unmount any file system that is using the Block Device, for example:
#
umount /var/vol01Unmap the Block Device from its image, for example:
#
rbd unmap /dev/rbd/datastore/vol01Remove the Block Device image, for example:
#
rbd rm vol01 -p datastoreRemove the Storage Pool, for example:
#
ceph osd pool delete datastore datastore --yes-i-really-really-mean-it

