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 150
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 thedatastore
pool.NoteIf you do not specify a storage pool, rbd uses the default
rbd
pool:#
rbd create --size 4096 vol01
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
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
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/vol01
Unmap the Block Device from its image, for example:
#
rbd unmap /dev/rbd/datastore/vol01
Remove the Block Device image, for example:
#
rbd rm vol01 -p datastore
Remove the Storage Pool, for example:
#
ceph osd pool delete datastore datastore --yes-i-really-really-mean-it