Enabling metadata on RBD and CephFS volumes

Before you begin

  • Ensure to install ocs_operator and create a storagecluster for the operator.

  • Ensure that the storagecluster is in Ready state.
    oc get storagecluster
    
    NAME                 AGE   PHASE   EXTERNAL   CREATED AT             VERSION
    ocs-storagecluster   57m   Ready              2022-08-30T06:52:58Z   4.12.0

About this task

You can set the persistent volume claim (PVC), persistent volume (PV), and Namespace names in the RADOS block device (RBD) and CephFS volumes for monitoring purposes. This enables you to read the RBD and CephFS metadata to identify the mapping between the OpenShift Container Platform and RBD and CephFS volumes.

To enable RADOS block device (RBD) and CephFS volume metadata feature, you need to set the CSI_ENABLE_METADATA variable in the rook-ceph-operator-configconfigmap. By default, this feature is disabled. If you enable the feature after upgrading from a previous version, the existing PVCs will not contain the metadata. Also, when you enable the metadata feature, the PVCs that were created before enabling will not have the metadata.

Procedure

  1. Edit the rook-ceph operator ConfigMap to mark CSI_ENABLE_METADATA to true.
    oc patch cm rook-ceph-operator-config -n openshift-storage -p $'data:\n "CSI_ENABLE_METADATA":  "true"'
    configmap/rook-ceph-operator-config patched
  2. Wait for the respective CSI CephFS plugin provisioner pods and CSI RBD plugin pods to reach the Running state.
    Note: Ensure that the setmetadata variable is automatically set after the metadata feature is enabled. This variable should not be available when the metadata feature is disabled.
    oc get pods | grep csi
    csi-cephfsplugin-b8d6c                         2/2     Running     0          56m
    csi-cephfsplugin-bnbg9                         2/2     Running     0          56m
    csi-cephfsplugin-kqdw4                         2/2     Running     0          56m
    csi-cephfsplugin-provisioner-7dcd78bb9b-q6dxb  5/5     Running     0          56m
    csi-cephfsplugin-provisioner-7dcd78bb9b-zc4q5  5/5     Running     0          56m
    csi-rbdplugin-776dl                            3/3     Running     0          56m
    csi-rbdplugin-ffl52                            3/3     Running     0          56m
    csi-rbdplugin-jx9mz                            3/3     Running     0          56m
    csi-rbdplugin-provisioner-5f6d766b6c-694fx     6/6     Running     0          56m
    csi-rbdplugin-provisioner-5f6d766b6c-vzv45     6/6     Running     0          56m