This is unreleased documentation for SUSE® Storage 1.11 (Dev).

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:

  1. In the top navigation bar of the SUSE Storage UI, click Volume.

  2. Click the name of the volume for which you want to create a snapshot. This leads to the volume detail page.

  3. 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.

Understanding the Snapshot Chain Visualization

On the Volume Details page, the Snapshots and Backups section displays the snapshot history as a chain. By default, the Show System Snapshots option is enabled, and all system-created snapshots appear in the view.

Each snapshot in the chain is color coded to indicate its type or status. If a snapshot meets multiple criteria, the visualization uses the color with the highest priority.

Snapshot Type Color Description Priority (1 = highest)

Error

Red

Indicates that snapshot creation failed or that the snapshot has an issue.

1

Removed

Light grey

Indicates that the snapshot is marked for removal or has been deleted.

2

System created

Orange/Yellow

Automatically created by Longhorn, often for recurring jobs or internal operations.

3

Backup

Green

Indicates that the snapshot has a backup stored on a configured backup target.

4

Default (user created)

Blue

A user-initiated snapshot taken manually with the Take Snapshot action.

5

The following figure shows an example of the snapshot chain visualization:

Snapshot Volume Page

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 Snapshot CRD under the longhorn.io API group (for example, v1beta2), not the generic Kubernetes VolumeSnapshot from snapshot.storage.k8s.io.

Create a snapshot

  1. Prepare the manifest - Create a file named longhorn-snapshot.yaml with 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
  2. Apply the manifest:

    kubectl apply -f longhorn-snapshot.yaml

    Expected output:

    snapshot.longhorn.io/longhorn-test-snapshot created

    If 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.

List snapshots

To list all snapshots for a specific volume, use the following command:

kubectl get snapshots.longhorn.io -l longhornvolume=pvc-840804d8-6f11-49fd-afae-54bc5be639de -n longhorn-system

Delete a snapshot

To delete a specific snapshot, use the following command:

kubectl delete snapshot.longhorn.io longhorn-test-snapshot -n longhorn-system

Expected output:

snapshot.longhorn.io "longhorn-test-snapshot" deleted

SUSE Storage automatically handles the cleanup of the underlying data.