Volume Snapshots
This website/page will be End-of-life (EOL) after 31 August 2024. We recommend you to visit OpenEBS Documentation for the latest Mayastor documentation (v2.6 and above).
Mayastor is now also referred to as OpenEBS Replicated PV Mayastor.
Volume snapshots are copies of a persistent volume at a specific point in time. They can be used to restore a volume to a previous state or create a new volume. Mayastor provides support for industry standard copy-on-write (COW) snapshots, which is a popular methodology for taking snapshots by keeping track of only those blocks that have changed. Mayastor incremental snapshot capability enhances data migration and portability in Kubernetes clusters across different cloud providers or data centers. Using standard kubectl commands, you can seamlessly perform operations on snapshots and clones in a fully Kubernetes-native manner.
Use cases for volume snapshots include:
Efficient replication for backups.
Utilization of clones for troubleshooting.
Development against a read-only copy of data.
Volume snapshots allow the creation of read-only incremental copies of volumes, enabling you to maintain a history of your data. These volume snapshots possess the following characteristics:
Consistency: The data stored within a snapshot remains consistent across all replicas of the volume, whether local or remote.
Immutability: Once a snapshot is successfully created, the data contained within it cannot be modified.
Currently, Mayastor supports the following operations related to volume snapshots:
Creating a snapshot for a PVC
Listing available snapshots for a PVC
Deleting a snapshot for a PVC
Prerequisites
Deploy and configure Mayastor by following the steps given here and create disk pools.
Create a Mayastor StorageClass with single replica.
Currently, Mayastor only supports snapshots for volumes with a single replica. Snapshot support for volumes with more than one replica will be available in the future versions.
Create a PVC using these steps and check if the status of the PVC is Bound.
Copy the PVC name, for example,
ms-volume-claim
.
(Optional) Create an application by following these steps.
Create a Snapshot
You can create a snapshot (with or without an application) using the PVC. Follow the steps below to create a volume snapshot:
Step 1: Create a Kubernetes VolumeSnapshotClass object
Apply VolumeSnapshotClass details
Step 2: Create the snapshot
Apply the snapshot
When a snapshot is created on a thick-provisioned volume, the storage system automatically converts it into a thin-provisioned volume.
List Snapshots
To retrieve the details of the created snapshots, use the following command:
Delete a Snapshot
To delete a snapshot, use the following command:
Last updated