@@ -129,6 +129,23 @@ One of the following members in the source of the group snapshot must be set.
129129* ` volumeGroupSnapshotContentName ` - specifies the name of a pre-existing
130130 VolumeGroupSnapshotContent object representing an existing volume group snapshot.
131131
132+ In the following example, we have two PVCs.
133+
134+ ``` yaml
135+ NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
136+ pvc-0 Bound pvc-a42d7ea2-e3df-11ed-b5ea-0242ac120002 1Gi RWO 48s
137+ pvc-1 Bound pvc-a42d81b8-e3df-11ed-b5ea-0242ac120002 1Gi RWO 48s
138+ ```
139+
140+ Label the PVCs.
141+ ``` yaml
142+ % kubectl label pvc pvc-0 group=myGroup
143+ persistentvolumeclaim/pvc-0 labeled
144+
145+ % kubectl label pvc pvc-1 group=myGroup
146+ persistentvolumeclaim/pvc-1 labeled
147+ ```
148+
132149For dynamic provisioning, a selector must be set so that the snapshot controller can
133150find PVCs with the matching labels to be snapshotted together.
134151
@@ -149,47 +166,13 @@ spec:
149166In the VolumeGroupSnapshot spec, a user can specify the VolumeGroupSnapshotClass which
150167has the information about which CSI driver should be used for creating the group snapshot.
151168
152- ### Importing an existing group snapshot with Kubernetes
153-
154- You can always import an existing group snapshot to Kubernetes by manually creating
155- a VolumeGroupSnapshotContent object to represent the existing group snapshot.
156- Because VolumeGroupSnapshotContent is a non-namespace API object, only a system admin
157- may have the permission to create it. Once a VolumeGroupSnapshotContent object is
158- created, the user can create a VolumeGroupSnapshot object pointing to the
159- VolumeGroupSnapshotContent object.
169+ Two individual volume snapshots will be created as part of the volume group snapshot creation.
160170
161171` ` ` yaml
162- apiVersion : groupsnapshot.storage.k8s.io/v1alpha1
163- kind : VolumeGroupSnapshotContent
164- metadata :
165- name : pre-existing-group-snap-content1
166- spec :
167- driver : com.example.csi-driver
168- deletionPolicy : Delete
169- source :
170- volumeGroupSnapshotHandle : group-snap-id
171- volumeGroupSnapshotRef :
172- kind : VolumeGroupSnapshot
173- name : pre-existing-group-snap1
174- namespace : demo-namespace
172+ snapshot-62abb5db7204ac6e4c1198629fec533f2a5d9d60ea1a25f594de0bf8866c7947-2023-04-26-2:20:4
173+ snapshot-2026811eb9f0787466171fe189c805a22cdb61a326235cd067dc3a1ac0104900-2023-04-26-2:20:4
175174```
176175
177- A VolumeGroupSnapshot object should be created to allow a user to use the group snapshot:
178-
179- ` ` ` yaml
180- apiVersion : groupsnapshot.storage.k8s.io/v1alpha1
181- kind : VolumeGroupSnapshot
182- metadata :
183- name : pre-existing-group-snap1
184- namespace : demo-namespace
185- spec :
186- snapshotContentName : pre-existing-group-snap-content1
187- ` ` `
188-
189- Once these objects are created, the snapshot controller will bind them together,
190- and set the field ` status.ready` to `"True"` to indicate the group snapshot is ready
191- to use.
192-
193176### How to use group snapshot for restore in Kubernetes
194177
195178At restore time, the user can request a new PersistentVolumeClaim to be created from
@@ -198,6 +181,25 @@ provisioning of a new volume that is pre-populated with data from the specified
198181snapshot. The user should repeat this until all volumes are created from all the
199182snapshots that are part of a group snapshot.
200183
184+ ``` yaml
185+ apiVersion : v1
186+ kind : PersistentVolumeClaim
187+ metadata :
188+ name : pvc0-restore
189+ namespace : demo-namespace
190+ spec :
191+ storageClassName : csi-hostpath-sc
192+ dataSource :
193+ name : snapshot-62abb5db7204ac6e4c1198629fec533f2a5d9d60ea1a25f594de0bf8866c7947-2023-04-26-2:20:4
194+ kind : VolumeSnapshot
195+ apiGroup : snapshot.storage.k8s.io
196+ accessModes :
197+ - ReadWriteOnce
198+ resources :
199+ requests :
200+ storage : 1Gi
201+ ` ` `
202+
201203## As a storage vendor, how do I add support for group snapshots to my CSI driver?
202204
203205To implement the volume group snapshot feature, a CSI driver **must**:
0 commit comments