Create a Snapshot
A snapshot is the state of a Kubernetes volume at any given moment in time.
Snapshot Management via SUSE Storage UI
To create a snapshot of an existing cluster, follow these steps:
-
In the top navigation bar of the SUSE Storage UI, click Volume.
-
Click the name of the volume for which you want to create a snapshot. This leads to the volume detail page.
-
Click the Take Snapshot button.
Once the snapshot is created, you can view it in the list of snapshots for the volume before the Volume Head.
Snapshot Management with Custom Resources (CRs)
This section demonstrates how to create, list, restore and delete Longhorn snapshots directly via kubectl using the Custom Resources (CRs) of SUSE Storage.
|
SUSE Storage uses its own |
Create a snapshot
-
Prepare the manifest - Create a file named
longhorn-snapshot.yamlwith the following content:apiVersion: longhorn.io/v1beta2 kind: Snapshot metadata: name: longhorn-test-snapshot namespace: longhorn-system spec: volume: pvc-840804d8-6f11-49fd-afae-54bc5be639de # replace with your actual Longhorn volume name createSnapshot: true -
Apply the manifest:
kubectl apply -f longhorn-snapshot.yamlExpected output:
snapshot.longhorn.io/longhorn-test-snapshot createdIf the volume is detached, a brief warning about the engine not running appears. SUSE Storage automatically retries and the snapshot completes when the volume is attached.