Skip to content

SapNfsVolumeSnapshotRestore Custom Resource ​

WARNING

This is a beta feature available only per request for SAP-internal teams.

The sapnfsvolumesnapshotrestore.cloud-resources.kyma-project.io namespaced custom resource (CR) triggers a one-shot restore of an SapNfsVolumeSnapshot to either an existing or a new SapNfsVolume.

Overview ​

SapNfsVolumeSnapshotRestore supports two restore paths, selected by the destination field:

  • Existing volume (in-place revert): reverts an existing SapNfsVolume to the snapshot's state using the Manila "Revert share to snapshot" API. The volume's current data is overwritten. Due to an OpenStack Manila constraint, only the most recent snapshot of a given volume can be used for in-place revert.

  • New volume (create from snapshot): creates a new SapNfsVolume pre-populated with the snapshot's data using the Manila "create share from snapshot" capability. This path works with any snapshot, not just the most recent, and produces an independent volume.

Exactly one of destination.existingVolume or destination.newVolume must be specified.

SapNfsVolumeSnapshotRestore is a one-shot operation. Once a restore reaches Done or Failed, it cannot be retried. Create a new resource to attempt the operation again.

Prerequisites ​

Before creating an SapNfsVolumeSnapshotRestore, ensure that:

  • The source SapNfsVolumeSnapshot exists and is in Ready state.
  • For existing-volume restores: the destination SapNfsVolume exists, is in Ready state, and the snapshot was taken from that volume.
  • For existing-volume restores: the snapshot is the most recent snapshot of the destination volume.
  • For new-volume restores: the capacityGb in the new volume spec is greater than or equal to the source snapshot's size in GiB.

How It Works ​

StateDescription
InProgressThe restore operation has been accepted and is running (revert or new-volume creation in progress).
DoneThe restore completed successfully.
FailedA permanent error occurred (for example, the snapshot is not the most recent, or it does not belong to the destination volume). Check .status.conditions for details. No further retries are performed.
ErrorA transient error occurred (for example, source or destination not yet ready). The reconciler retries automatically.

Specification ​

This table lists the parameters of the given resource together with their descriptions:

Spec:

ParameterTypeRequiredImmutableDescription
sourceSnapshotobjectYesYesReference to the SapNfsVolumeSnapshot to restore from. The snapshot must be in Ready state.
sourceSnapshot.namestringYesYesName of the source SapNfsVolumeSnapshot.
sourceSnapshot.namespacestringNoYesNamespace of the source SapNfsVolumeSnapshot. Defaults to the namespace of this resource if not provided.
destinationobjectYesYesSpecifies where to restore the snapshot data. Exactly one of existingVolume or newVolume must be set.
destination.existingVolumeobjectNo*YesReference to an existing SapNfsVolume to revert in-place. *Required if newVolume is not set.
destination.existingVolume.namestringYes*YesName of the destination SapNfsVolume. *Required if existingVolume is set.
destination.existingVolume.namespacestringNoYesNamespace of the destination SapNfsVolume. Defaults to the namespace of this resource if not provided.
destination.newVolumeobjectNo*YesDefines a new SapNfsVolume to create from the snapshot. *Required if existingVolume is not set.
destination.newVolume.metadata.namestringYes*YesName of the new SapNfsVolume to create. *Required if newVolume is set.
destination.newVolume.metadata.namespacestringNoYesNamespace of the new SapNfsVolume. Defaults to the namespace of this resource if not provided.
destination.newVolume.metadata.labelsmap[string]stringNoYesLabels for the new SapNfsVolume.
destination.newVolume.metadata.annotationsmap[string]stringNoYesAnnotations for the new SapNfsVolume.
destination.newVolume.spec.capacityGbintYes*YesCapacity of the new volume in GiB. Must be greater than zero and greater than or equal to the snapshot's source share size. *Required if newVolume is set.
destination.newVolume.spec.ipRangeobjectNoYesIpRange reference for the new volume. If omitted, the default IpRange is used.
destination.newVolume.spec.ipRange.namestringNoYesName of the existing IpRange to use.
destination.newVolume.spec.volumeobjectNoYesPersistentVolume options for the new volume (name, labels, annotations).
destination.newVolume.spec.volumeClaimobjectNoYesPersistentVolumeClaim options for the new volume (name, labels, annotations).

Status:

ParameterTypeDescription
statestringCurrent state of the restore operation. Possible values: InProgress, Done, Failed, Error.
revertInitiatedbooleanIndicates that the Manila revert API call was successfully submitted. Used internally for idempotency to prevent duplicate revert calls on reconciler requeue.
createdVolumeobjectRefReference to the SapNfsVolume created during a new-volume restore. Populated only for newVolume destination restores.
conditions[]objectRepresents the current state of the CR's conditions.
conditions.lastTransitionTimestringDefines the date of the last condition status change.
conditions.messagestringProvides more details about the condition status change.
conditions.reasonstringDefines the reason for the condition status change.
conditions.status (required)stringRepresents the status of the condition. The value is either True, False, or Unknown.
conditions.typestringProvides a short description of the condition.

Limitations ​

  • In-place revert (most recent snapshot only): the Manila "Revert share to snapshot" API only succeeds if the referenced snapshot is the most recent one for that share. If newer snapshots exist, the restore will set state to Failed. To revert to an older state, delete the newer snapshots first, then create a new SapNfsVolumeSnapshotRestore.
  • In-place revert (snapshot must belong to the destination volume): Manila only allows reverting a share to its own snapshot. Cross-volume revert is not supported.
  • New-volume restore (same availability zone): the new volume is created in the same OpenStack project and availability zone as the parent share of the snapshot.
  • Immutable after completion: once a restore reaches Done or Failed, create a new SapNfsVolumeSnapshotRestore resource to retry.

Sample Custom Resources ​

In-Place Revert to the Most Recent Snapshot ​

Revert an existing volume to the state captured in a snapshot:

yaml
apiVersion: cloud-resources.kyma-project.io/v1beta1
kind: SapNfsVolumeSnapshotRestore
metadata:
  name: revert-to-snapshot
  namespace: default
spec:
  sourceSnapshot:
    name: my-snapshot
  destination:
    existingVolume:
      name: my-sap-nfs-vol

Create a New Volume from a Snapshot ​

Restore snapshot data into a new, independent volume:

yaml
apiVersion: cloud-resources.kyma-project.io/v1beta1
kind: SapNfsVolumeSnapshotRestore
metadata:
  name: restore-to-new-volume
  namespace: default
spec:
  sourceSnapshot:
    name: my-snapshot
  destination:
    newVolume:
      metadata:
        name: my-restored-vol
      spec:
        capacityGb: 1000

Cross-Namespace Restore to a New Volume ​

Restore a snapshot from one namespace into a new volume in another namespace:

yaml
apiVersion: cloud-resources.kyma-project.io/v1beta1
kind: SapNfsVolumeSnapshotRestore
metadata:
  name: cross-namespace-restore
  namespace: staging
spec:
  sourceSnapshot:
    name: production-snapshot
    namespace: production
  destination:
    newVolume:
      metadata:
        name: staging-restored-vol
        namespace: staging
        labels:
          env: staging
      spec:
        capacityGb: 2000