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.
info
A volume snapshot transcends into taking snapshots on each of the volume's replicas for consistency. For instance, a snapshot on a source volume with three replicas (repl=3) results in snapshot-ting all three replicas of the source volume. Similarly, the replica count of the new volume must be less than or equal to the available replica snapshot count of the corresponding source volume when a restore is initiated, or a new volume is provisioned by specifying the source volume's snapshot as the source.
- Do the following command to find the number of available replicas of a volume:
Command
Output
- Do the following command to check the replica snapshot information for volume snapshots:
Command
Output
#
PrerequisitesBefore proceeding, ensure the following Prerequisites are met:
- A volume snapshot has already been created.
- A compatible StorageClass is available for the restore operation.
- A snapshot has been created for the source volume. Follow the steps outlined in the Volume Snapshots Documentation to create a volume snapshot.
#
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.