Volume Restore from Snapshot
Volume restore from an existing snapshot will create an exact replica of a storage volume captured at a specific point in time. They serve as an essential tool for data protection, recovery, and efficient management in Kubernetes environments. This article provides a step-by-step guide on how to create a volume restore.
#
Prerequisites#
Step 1: Create a StorageClassTo begin, you will need to create a StorageClass that defines the properties of the snapshot to be restored. Refer to StorageClass Parameters for more details. Use the following command to create the StorageClass:
info
thin: "true" and repl: "1" is the only supported combination.
Command
YAML
note
The name of the StorageClass, which, in the example above, is mayastor-1-restore.
#
Step 2: Create a SnapshotYou need to create a volume snapshot before proceeding with the restore. Follow the steps outlined in this guide to create a volume snapshot.
note
Tthe snapshot's name, for example, pvc-snap-1.
#
Create a Volume Restore of the Existing SnapshotAfter creating a snapshot, you can create a PersistentVolumeClaim (PVC) from it to generate the volume restore. Use the following command:
Command
YAML
By running this command, you create a new PVC named restore-pvc
based on the specified snapshot. The restored volume will have the same data and configuration as the original volume had at the time of the snapshot.