Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f59806c

Browse files
gman0mergify[bot]
authored andcommittedJun 16, 2022
doc: added docs for snapshot-backed CephFS volumes
Signed-off-by: Robert Vasek <robert.vasek@cern.ch>
1 parent 79cb1b3 commit f59806c

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
 
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Provisioning and mounting CephFS snapshot-backed volumes
2+
3+
Snapshot-backed volumes allow CephFS subvolume snapshots to be exposed as
4+
regular read-only PVCs. No data cloning is performed and provisioning such
5+
volumes is done in constant time.
6+
7+
For more details please refer to [Snapshots as shallow read-only volumes](./design/proposals/cephfs-snapshot-shallow-ro-vol.md)
8+
design document.
9+
10+
## Prerequisites
11+
12+
Prerequisites for this feature are the same as for creating PVCs with snapshot
13+
volume source. See [Create snapshot and Clone Volume](./snap-clone.md) for more
14+
information.
15+
16+
## Usage
17+
18+
### Provisioning a snapshot-backed volume from a volume snapshot
19+
20+
For provisioning new snapshot-backed volumes, following configuration must be
21+
set for storage class(es) and their PVCs respectively:
22+
23+
* StorageClass:
24+
* Specify `backingSnapshot: "true"` parameter.
25+
* PersistentVolumeClaim:
26+
* Set `storageClassName` to point to your storage class with backing
27+
snapshots enabled.
28+
* Define `spec.dataSource` for your desired source volume snapshot.
29+
* Set `spec.accessModes` to `ReadOnlyMany`. This is the only access mode that
30+
is supported by this feature.
31+
32+
### Mounting snapshots from pre-provisioned volumes
33+
34+
Steps for defining a PersistentVolume and PersistentVolumeClaim for
35+
pre-provisioned CephFS subvolumes are identical to those described in
36+
[Static PVC with ceph-csi](./static-pvc.md), except one additional parameter
37+
must be specified: `backingSnapshotID`. CephFS-CSI driver will retrieve the
38+
snapshot identified by the given ID from within the specified subvolume, and
39+
expose it to workloads in read-only mode. Volume access mode must be set to
40+
`ReadOnlyMany`.
41+
42+
Note that the snapshot retrieval is done by traversing `<rootPath>/.snap` and
43+
searching for a directory that contains `backingSnapshotID` value in its name.
44+
The specified snapshot ID does not necessarily need to be the complete directory
45+
name inside `<rootPath>/.snap`, however it must be complete enough to uniquely
46+
identify that directory.
47+
48+
Example:
49+
50+
```
51+
$ ls .snap
52+
_f279df14-6729-4342-b82f-166f45204233_1099511628283
53+
_a364870e-6729-4342-b82f-166f45204233_1099635085072
54+
```
55+
56+
`f279df14-6729-4342-b82f-166f45204233` would be considered a valid value for
57+
`backingSnapshotID` volume parameter, whereas `6729-4342-b82f-166f45204233`
58+
would not, as it would be ambiguous.
59+
60+
If the given snapshot ID is ambiguous, or no such snapshot is found, mounting
61+
the PVC will fail with INVALID_ARGUMENT error code.

‎docs/deploy-cephfs.md

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ you're running it inside a k8s cluster and find the config itself).
8181
| `pool` | no | Ceph pool into which volume data shall be stored |
8282
| `volumeNamePrefix` | no | Prefix to use for naming subvolumes (defaults to `csi-vol-`). |
8383
| `snapshotNamePrefix` | no | Prefix to use for naming snapshots (defaults to `csi-snap-`) |
84+
| `backingSnapshot` | no | Boolean value. The PVC shall be backed by the CephFS snapshot specified in its data source. `pool` parameter must not be specified. (defaults to `false`) |
8485
| `kernelMountOptions` | no | Comma separated string of mount options accepted by cephfs kernel mounter, by default no options are passed. Check man mount.ceph for options. |
8586
| `fuseMountOptions` | no | Comma separated string of mount options accepted by ceph-fuse mounter, by default no options are passed. |
8687
| `csi.storage.k8s.io/provisioner-secret-name`, `csi.storage.k8s.io/node-stage-secret-name` | for Kubernetes | Name of the Kubernetes Secret object containing Ceph client credentials. Both parameters should have the same value |

‎examples/cephfs/storageclass.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ parameters:
4747
# If omitted, defaults to "csi-vol-".
4848
# volumeNamePrefix: "foo-bar-"
4949

50+
# (optional) Boolean value. The PVC shall be backed by the CephFS snapshot
51+
# specified in its data source. `pool` parameter must not be specified.
52+
# (defaults to `false`)
53+
# backingSnapshot: "true"
54+
5055
reclaimPolicy: Delete
5156
allowVolumeExpansion: true
5257
mountOptions:

0 commit comments

Comments
 (0)
Please sign in to comment.