How to map persistent volumes in Openshift 4 to Ceph RBD images in OCS 4
Updated
-
The
ocs-storagecluster-ceph-rbdstorage class will be used by an OCP application deployment to create RWO (ReadWriteOnce) persistent storage. -
The persistent storage will be a Ceph RBD (RADOS Block Device) volume (object) in the Ceph pool
ocs-storagecluster-cephblockpool. -
Many-a-times during the investigation of an issue, it may be required to map a persistent volume to the backing Ceph RBD image.
-
Run the following command to get a list of
Pod Name,PV Name,Storage ClassandVolume Handle.$ oc get pv -o 'custom-columns=NAME:.spec.claimRef.name,PVNAME:.metadata.name,STORAGECLASS:.spec.storageClassName,VOLUMEHANDLE:.spec.csi.volumeHandle' -
In the output of the above command, the second half of the
Volume Handlecolumn matches what your RBD image is named inside of Ceph, withcsi-vol-appended to the front. -
To get the full name of the RBD image in one command, run the following :
$ oc get pv <PV_NAME> -o jsonpath='{.spec.csi.volumeHandle}' | cut -d '-' -f 6- | awk '{print "csi-vol-"$1}' Replace <PV_NAME> with the persistent volume name.
Product(s)
Category
Article Type