You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note:** The VolumeSnapshot CRDs (CustomResourceDefinitions) of version 8.3.0 are installed in this deployment. If you use a different version, please ensure compatibility with your Kubernetes cluster and CSI sidecars.
91
+
92
+
// TODO: Should we have the crds locally or manually install it from:
In order to take the snapshot of a volume, `persistentVolumeClaimName` should be set to the right PVC name that is bound to the volume whose snapshot is to be taken.
139
+
140
+
You can check CloudStack volume snapshots if the snapshot was successfully created. If for any reason there was an issue, it can be investgated by checking the logs of the cloudstack-csi-controller pods: cloudstack-csi-controller, csi-snapshotter and snapshot-controller containers
141
+
142
+
```
143
+
kubectl logs -f <cloudstack-csi-controller pod_name> -n kube-system # defaults to tailing logs of cloudstack-csi-controller
Update the deployment to point to the restored PVC
161
+
162
+
```
163
+
spec:
164
+
volumes:
165
+
- name: app-volume
166
+
persistentVolumeClaim:
167
+
claimName: pvc-from-snapshot
168
+
```
169
+
170
+
### What happens when you restore a volume from a snapshot
171
+
* The CSI external-provisioner (a container in the cloudstack-csi-controller pod) sees the new PVC and notices it references a snapshot
172
+
* The CSI driver's `CreateVolume` method is called with a `VolumeContentSource` that contains the snapshot ID
173
+
* The CSI driver creates a new volume from the snapshot (using the CloudStack's createVolume API)
174
+
* The new volume is now available as a PV (persistent volume) and is bound to the new PVC
175
+
* The volume is NOT attached to any node just by restoring from a snapshot, the volume is only attached to a node when a Pod that uses the new PVC is scheduled on a node
176
+
* The CSI driver's `ControllerPublishVolume` and `NodePublishVolume` methods are called to attach and mount the volume to the node where the Pod is running
177
+
178
+
Hence to debug any issues during restoring a snapshot, check the logs of the cloudstack-csi-controller, external-provisioner containers
179
+
180
+
```
181
+
kubectl logs -f <cloudstack-csi-controller pod_name> -n kube-system # defaults to tailing logs of cloudstack-csi-controller
0 commit comments