Volume Snapshot Classes

Volume snapshot class selection

Volume Snapshot Classes are cluster scoped resources used while creating CSI snapshots. Since CloudCasa creates CSI snapshots of PVCs for backups (except when LIVE backup option is selected), it needs to pick a volume snapshot class for a given storage driver.

Here is how the selection logic works:

Check if there is a volume snapshot class whose “driver” field value matches the driver of the PVC that is being snapshotted and if so, check if it has the label: cloudcasa.io/csi-volumesnapshot-class: "true". If a volume snapshot class that meets these conditions is not found, CloudCasa creates a new one automatically. Such automatically created volume snapshot classes work for some drivers but for some such as Ceph, HPE, and Nutanix drivers. This is because volume snapshot classes for these drivers require some custom fields configured in the “parameters” section.

For example, a typical volume snapshot class for the driver openshift-storage.rbd.csi.ceph.com may look like this (some fields are not shown for the sake of brevity):

apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Delete
driver: openshift-storage.rbd.csi.ceph.com
kind: VolumeSnapshotClass
metadata:
  labels:
    storageclass.ocs.openshift.io/is-external: "true"
    manager: ocs-operator
    operation: Update
  name: ocs-external-storagecluster-rbdplugin-snapclass
parameters:
  clusterID: openshift-storage
  csi.storage.k8s.io/snapshotter-secret-name: rook-csi-rbd-provisioner
  csi.storage.k8s.io/snapshotter-secret-namespace: openshift-storage

Note the fields in the “parameters” section. For drivers such as these, CloudCasa provides two ways in which users can explicitly select volume snapshot classes:

  • Configure volume snapshot classes in Cluster Edit page in UI.

    Edit Cluster => Advanced Options => Configure volume snapshot classes

  • Set the label cloudcasa.io/csi-volumesnapshot-class: "true". (or)

The first option is preferred as it is simpler and can be done from UI. If volume snapshot classes are not configured for these drivers explicitly, backups will fail with CSI snapshot errors.