Creating volume snapshots
Use this information for volume snapshot configuration settings.
|
Note:
|
When creating volume snapshots, be sure to follow all of the Snapshot configurations, found in Compatibility and requirements, prior to Snapshot creation.
Enabling creation and deletion of volume snapshots
In order to enable creation and deletion of volume snapshots, create a VolumeSnapshotClass yaml file.
Use the following template-snapshotclass.yaml to configure the file for your storage system.
When configuring the file, be sure to use the same array secret and array secret namespace as
defined in Creating an array secret.
|
Note: When working with IBM DS8000 Family storage systems, the pool parameter
is mandatory. For all other storage systems, this parameter is optional.
|
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
name: <NAME>
driver: block.csi.ibm.com
deletionPolicy: <DELETION_PRIORITY> # Retain or Delete
parameters:
csi.storage.k8s.io/snapshotter-secret-name: <ARRAY_SECRET>
csi.storage.k8s.io/snapshotter-secret-namespace: <ARRAY_SECRET_NAMESPACE>
pool: <POOL_ID> # Mandatory for DS8000 Family storage systems.
snapshot_name_prefix: <NAME_PREFIX> # Optional.
After
the yaml file is created, apply it by using the kubectl apply -f
command.$> kubectl apply -f <filename>.yamlCreating a volume snapshot
Create a snapshot for a specific PersistentVolumeClaim (PVC), using the
template-snapshot.yaml. For more information on PVC configuration, see Creating a PersistentVolumeClaim (PVC).
apiVersion: snapshot.storage.k8s.io/v1beta1apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
name: <NAME>
spec:
snapshotClassName: <SNAPSHOT_CLASS_NAME>
source:
persistentVolumeClaimName: <PVC_NAME>
After
the yaml file is created, apply it by using the kubectl apply -f
command.$> kubectl apply -f <filename>.yamlTo verify that the VolumeSnapshot object is created, run the kubectl describe volumesnapshot command.
See the Status section of the output for the following:
- Bound Volume Snapshot Content Name: Indicates the volume is bound to the specified VolumeSnapshotContent.
- Creation Time: Indicates when the snapshot was created.
- Ready to Use: Indicates the volume snapshot is ready to use.
- Restore Size: Indicates the minimum volume size required when restoring a volume from this snapshot.