-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(vol-restore): added a doc for volume restore from a snapshot #156
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3105d60
docs(vol-restore): added a doc for volume restore from a snapshot
AJDatacore 736ecc2
docs(snapshot-restore): added a note
AJDatacore 44aee35
docs(snapshot-restore): added a note
AJDatacore 7e5845f
docs: addressed comments
AJDatacore a4a9b33
docs: addressed comments
AJDatacore 64633a5
docs(storage-calss-param): added details on cloneFsIdAsVolumeId
AJDatacore 91584d1
docs(storage-calss-param): minor changes
AJDatacore cc0c1c9
docs(storage-calss-param): minor changes
AJDatacore 660a8b8
Merge branch 'develop' into snapshot-restore-doc
AJDatacore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
Title: Volume Restore from a Snapshot | ||
--- | ||
|
||
Volume restore from an existing snapshot will create exact replicas of storage volumes captured at a specific point in time. They serve as an essential tool for data protection, recovery, and efficient management in Kubernetes environments. This article provides a step-by-step guide on how to create a volume restore. | ||
AJDatacore marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Prerequisites | ||
|
||
### Step 1: Create a storage class | ||
|
||
To begin, you'll need to create a StorageClass that defines the properties of the snapshot to be restored. Refer to [Storage Class Parameters](reference\storage-class-parameters.md) for more details. Use the following command to create the StorageClass: | ||
|
||
{% hint style="info" %} | ||
thin: "true" and repl: "1" is the only supported combination. | ||
{% endhint %} | ||
|
||
{% tabs %} | ||
{% tab title="Command" %} | ||
```text | ||
cat <<EOF | kubectl create -f - | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: mayastor-1-restore | ||
parameters: | ||
ioTimeout: "30" | ||
protocol: nvmf | ||
repl: "1" | ||
thin: "true" | ||
provisioner: io.openebs.csi-mayastor | ||
EOF | ||
``` | ||
{% endtab %} | ||
{% tab title="YAML" %} | ||
```text | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: mayastor-1-restore | ||
parameters: | ||
ioTimeout: "30" | ||
protocol: nvmf | ||
repl: "1" | ||
thin: "true" | ||
provisioner: io.openebs.csi-mayastor | ||
``` | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
> Note the name of the StorageClass, which, in this example, is **mayastor-1-restore**. | ||
AJDatacore marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
### Step 2: Create a snapshot | ||
|
||
You need to create a volume snapshot before proceeding with the restore. Follow the steps outlined in [this guide](quickstart/snapshot.md) to create a volume snapshot. | ||
|
||
> Note the snapshot's name, for example, **pvc-snap-1**. | ||
|
||
------------------- | ||
|
||
## Create a volume restore of the existing snapshot | ||
|
||
After creating a snapshot, you can create a PersistentVolumeClaim (PVC) from it to generate the volume restore. Use the following command: | ||
|
||
{% tabs %} | ||
{% tab title="Command" %} | ||
```text | ||
cat <<EOF | kubectl create -f - | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: restore-pvc //add a name for your new volume | ||
spec: | ||
storageClassName: mayastor-1-restore //add your storage class name | ||
dataSource: | ||
name: pvc-snap-1 //add your volumeSnapshot name | ||
kind: VolumeSnapshot | ||
apiGroup: snapshot.storage.k8s.io | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi | ||
EOF | ||
``` | ||
{% endtab %} | ||
{% tab title="YAML" %} | ||
```text | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: restore-pvc //add a name for your new volume | ||
spec: | ||
storageClassName: mayastor-1-restore //add your storage class name | ||
dataSource: | ||
name: pvc-snap-1 //add your volumeSnapshot name | ||
kind: VolumeSnapshot | ||
apiGroup: snapshot.storage.k8s.io | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi | ||
``` | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
|
||
By running this command, you create a new PVC named `restore-pvc` based on the specified snapshot. The restored volume will have the same data and configuration as the original volume had at the time of the snapshot. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be snapshot-restore.md?