Verify the metadata for RBD Restore

Procedure

  1. Restore a volume snapshot.
    cat <<EOF | oc create -f -
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: rbd-pvc-restore
    spec:
      storageClassName: ocs-storagecluster-ceph-rbd
      dataSource:
        name: rbd-pvc-snapshot
        kind: VolumeSnapshot
        apiGroup: snapshot.storage.k8s.io
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
    EOF
    persistentvolumeclaim/rbd-pvc-restore created
  2. Check the status of the restored volume snapshot.
    oc get pvc | grep rbd
    
    db-noobaa-db-pg-0                 Bound    pvc-615e2027-78cd-4ea2-a341-fdedd50c5208   50Gi       RWO            ocs-storagecluster-ceph-rbd   51m
    rbd-pvc                           Bound    pvc-30628fa8-2966-499c-832d-a6a3a8ebc594   1Gi        RWO            ocs-storagecluster-ceph-rbd   47m
    rbd-pvc-clone                     Bound    pvc-0d72afda-f433-4d46-a7f1-a5fcb3d766e0   1Gi        RWO            ocs-storagecluster-ceph-rbd   32m
    rbd-pvc-restore                   Bound    pvc-f900e19b-3924-485c-bb47-01b84c559034   1Gi        RWO            ocs-storagecluster-ceph-rbd   111s
  3. Verify the metadata in the IBM Storage Ceph command-line interface (CLI).
    rbd ls ocs-storagecluster-cephblockpool
    
    csi-snap-a1e24408-2848-11ed-94bd-0a580a830012
    csi-vol-063b982d-2845-11ed-94bd-0a580a830012
    csi-vol-063b982d-2845-11ed-94bd-0a580a830012-temp
    csi-vol-5f6e0737-2849-11ed-94bd-0a580a830012
    csi-vol-7d67bfad-2842-11ed-94bd-0a580a830012
    csi-vol-ed5ce27b-2842-11ed-94bd-0a580a830012
    rbd image-meta ls ocs-storagecluster-cephblockpool/csi-vol-5f6e0737-2849-11ed-94bd-0a580a830012
    
    There are 4 metadata on this image:
    
    Key                               Value
    csi.ceph.com/cluster/name         6cd7a18d-7363-4830-ad5c-f7b96927f026
    csi.storage.k8s.io/pv/name        pvc-f900e19b-3924-485c-bb47-01b84c559034
    csi.storage.k8s.io/pvc/name       rbd-pvc-restore
    csi.storage.k8s.io/pvc/namespace  openshift-storage