Verify the metadata for RBD PVC

Procedure

  1. Create a PVC.
    cat <<EOF | oc create -f -
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: rbd-pvc
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
      storageClassName: ocs-storagecluster-ceph-rbd
    EOF
  2. Check the status of the PVC.
    oc get pvc | grep cephfs
    
    rbd-pvc                           Bound    pvc-30628fa8-2966-499c-832d-a6a3a8ebc594   1Gi        RWO            ocs-storagecluster-ceph-rbd   32s
  3. Verify the metadata in the IBM Storage Ceph command-line interface (CLI).
    rbd ls ocs-storagecluster-cephblockpool
    
    csi-vol-7d67bfad-2842-11ed-94bd-0a580a830012
    csi-vol-ed5ce27b-2842-11ed-94bd-0a580a830012
    rbd image-meta ls ocs-storagecluster-cephblockpool/csi-vol-ed5ce27b-2842-11ed-94bd-0a580a830012

    There are four metadata on this image:

    Key                               Value
    csi.ceph.com/cluster/name         6cd7a18d-7363-4830-ad5c-f7b96927f026
    csi.storage.k8s.io/pv/name        pvc-30628fa8-2966-499c-832d-a6a3a8ebc594
    csi.storage.k8s.io/pvc/name       rbd-pvc
    csi.storage.k8s.io/pvc/namespace  openshift-storage