You can use the Velero Plugin for vSphere to backup and restore workloads running on vSphere Pods.

Overview

You can use the Velero Plugin for vSphere to backup and restore workloads running on vSphere Pods in the Supervisor Cluster. You can backup and restore both stateless and stateful applications running on vSphere Pods. For stateful applications, you use the Velero Plugin for vSphere to take snapshots of the persistent volumes (PVs).
Note: You cannot use Velero standalone with Restic to backup and restore vSphere Pods. You must use the Velero Plugin for vSphere installed on the Supervisor Cluster.

Prerequisites

Before you can backup and restore vSphere Pods, you need to install and configure the Velero Plugin for vSphere. See Install and Configure the Velero Plugin for vSphere on the Supervisor Cluster.
Note: The Velero Plugin for vSphere is not backing up and restoring the state of the Supervisor Cluster.

Backup a vSphere Pod

To backup a stateless vSphere Pod, run the following command:
velero backup create <backup name> --include-namespaces=my-namespace

The backup is marked Completed after all local snapshots have been taken and Kubernetes metadata is uploaded to the object store. However, the backup of volume snapshots occurs asynchronously and may still be occurring in the background and take some time to complete.

You can check the status of volume snapshots by monitoring Snapshot and Upload custom resources.

Snapshot CRD

For each volume snapshot, a Snapshot custom resource is created in the same namespace as the PVC that is snapshotted. You can get all Snapshots in PVC namespace by running the following command.
kubectl get -n <pvc namespace> snapshot
The Snapshot CRD has several phases for the status.phase field, including:
State Description
New Not processed yet
Snapshotted Local snapshot was taken
SnapshotFailed Local snapshot failed
Uploading Snapshot is being uploaded
Uploaded Snapshot is uploaded
UploadFailed Snapshot failed to be uploaded
Canceling Upload of snapshot is being cancelled
Canceled Upload of snapshot is cancelled
CleanupAfterUploadFailed Cleanup of local snapshot after the upload of snapshot failed

Upload CRD

For each volume snapshot to be uploaded to object store, an Upload CR will be created in the same namespace as Velero. You can get all Uploads in Velero namespace by running the following command.
kubectl get -n <velero namespace> upload
Upload CRD has several phases for the status.phase field, including:
State Description
New Not processed yet
InProgress Upload in progress
UploadError Upload failed
CleanupFailed

Delete local snapshot failed after the upload

Will be retried

Canceling

Upload is being cancelled

Can occur if velero backup delete is called while snapshot upload is in progress

Canceled Upload is cancelled
UploadError uploads will be periodically retried. At that point their phase will return to InProgress. After an upload has been successfully completed, its record will remain for a period of time and eventually be removed.

Restore a vSphere Pod

To restore a vSphere Pod workload that has been backed up using the Velero Plugin for vSphere, complete the following steps.
  1. Create a vSphere Namespace for the workload you will restore.
  2. Configure the storage policy for the namespace.
  3. Run the following Velero command to restore the workload:
    velero restore create --from-backup backup-name

Velero restore will be marked as Completed when volume snapshots and other Kubernetes metadata have been successfully restored to the current cluster. At this point, all tasks of vSphere plugin related to this restore are completed as well. There are no asynchronous data movement tasks behind the scene as that in the case of Velero backup.

Before Velero restore is Completed, you can check the status of volume restore by monitoring CloneFromSnapshot/Download CRs as below.

CloneFromSnapshots CRD

For restore from each volume snapshot, a CloneFromSnapshot CR will be created in the same namespace as the PVC that is originally snapshotted. We can get all CloneFromSnapshots in PVC namespace by running the following command.
kubectl -n <pvc namespace> get clonefromsnapshot
CloneFromSnapshot CRD has several phases for the status.phase field, including:
State Description
New Clone from snapshot is not completed
Completed Clone from snapshot is completed
Failed Clone from snapshot failed
Download CRD
From each restore of volume snapshot to be downloaded from object store, a Download CR will be created in the same namespace as Velero. We can get all Downloads in Velero namespace by running the following command.
kubectl -n <velero namespace> get download
The Download CRD has several phases for the status.phase field, including:
Status Description
New Not processed yet
InProgress Download in progress
Completed Download is completed
Retry

Download is retried.

When there is any failure during the download of backup data, the download is retried

Failed Download is failed