Restoring statically provisioned PVCs
Summary
Statically provisioned PVCs are bound to specific PVs using volumeName
field in the spec and they don’t have a
storage class configured. For this reason, CloudCasa cannot provision a new PV automatically at the restore time as it
does for PVCs that have a storage class configured. This document explains the manual steps needed to restore such
statically provisioned PVCs. It is also assumed that these PVCs are attached to Pods at the backup time.
Restore procedure
Start restore job in CloudCasa UI and identify the job ID.
On the cluster where restore is happening, run the command:
kubectl get -wA pvc -l velero.io/restore-name=<JOB-ID> or (if "watch" command is available) watch kubectl get -A pvc -l velero.io/restore-name=<JOB-ID>
As restore job continues to progress, PVCs will be created in PENDING state and since there is no storage class, they will stay in PENDING state. You will see each such PVC show up, one at a time, in the output of above command.
Edit the PVC and add the following two fields in “spec”:
spec: ... storageClassName: "" # Empty string must be explicitly set otherwise default StorageClass will be set volumeName: <NEW-PV-NAME>
Note that a PV with name
<NEW-PV-NAME>
shouldn’t exist at this point.After editing the PVC, create a new PV with the name
<NEW-PV-NAME>
at which point, the PVC will be bound and the restore continues.Repeat above steps for all statically provisioned PVCs.
Restoring statically provisioned PVCs is not simple but we are making improvements to CloudCasa that would enhance the restore experience.