Create a Volume Snapshot
This section describes how to create a volume snapshot.
A volume snapshot captures the current data of a storage volume and can be used to create a PersistentVolumeClaim and the corresponding PersistentVolume.
Prerequisites
-
The KubeSphere Storage extension must be installed and enabled on the KubeSphere platform.
-
You need to join a cluster or project and have the Volume Snapshot Management permission in the cluster or project. For more information, please refer to Cluster Roles and Project Roles.
-
Ensure that the system has created a persistent volume for the persistent volume claim.
-
Ensure the backend storage system supports volume snapshot functionality and that volume snapshot is enabled on the storage class corresponding to the PersistentVolumeClaim. How to: Storage Class > Operations > Set Volume Operations > Enable Volume Snapshot Creation.
Method 1: Volume Snapshots > Create a Volume Snapshot
In a cluster, you can directly create a volume snapshot for a PersistentVolumeClaim under the Volume Snapshots menu.
-
Log in to the KubeSphere web console with a user who has Volume Snapshot Management permissions and enter your cluster.
-
Click Storage > Volume Snapshots in the left navigation pane.
-
Click Create on the page.
-
In the Create Snapshot dialog box, set the persistent volume claim for which you want to create a snapshot, the name of the volume snapshot, and the volume snapshot class, then click OK.
Parameter Description Persistent Volume Claim
The persistent volume claim for which you want to create a snapshot.
Name
The name of the volume snapshot. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and can be up to 253 characters long.
Volume Snapshot Class
Volume snapshot class for creating volume snapshots. Ensure that the provider of the volume snapshot class matches the provider of the storage class corresponding to the PersistentVolume; otherwise, the volume snapshot creation will fail.
The volume snapshot will appear in the volume snapshot list after it is created.
Method 2: PersistentVolumeClaims > Create a Volume Snapshot
In a cluster or project, you can create a volume snapshot for a PersistentVolumeClaim under the PersistentVolumeClaims menu.
-
Log in to the KubeSphere web console as a user with PersistentVolumeClaim Management and Volume Snapshot Management permissions, and enter your cluster or workspace.
-
Select Storage > PersistentVolumeClaims from the left navigation pane.
-
In the PersistentVolumeClaim list, click the name of a PersistentVolumeClaim to open its details page.
-
On the Persistent Volume Claim details page, click Operation > Create Snapshot.
-
In the Create Snapshot dialog box, set the name and volume snapshot class for the volume snapshot, then click OK.
Parameter Description Name
The name of the volume snapshot. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and can be up to 253 characters long.
Volume Snapshot Class
Volume snapshot class for creating volume snapshots. Ensure that the provider of the volume snapshot class matches the provider of the storage class corresponding to the PersistentVolume; otherwise, the volume snapshot creation will fail.
After creation, the volume snapshot will appear in the volume snapshot list on the Volume Snapshots page.