mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-28 10:45:44 +00:00
Identify the backed-up volume by CSI volume handle in the in-place restore pre-flight check (#10530)
The pre-flight check that verifies the existing PVC is still bound to the backed-up volume compared PV names. A block data mover restore of a file system volume recreates the PV under a new name (the volumeMode field is immutable), so a second in-place restore of the same workload failed the check even though the PVC was bound to the very same volume. Record the CSI volume handle in the backup volume info (PVInfo) and compare handles when both the backup and the bound PV record one; the PV name remains the fallback for non-CSI volumes and for backups taken before the handle was recorded. The handle reaches the PVC CSI RIA through the same carrier annotation mechanism as the source size. Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
@@ -192,6 +192,14 @@ const (
|
||||
// run the in-place restore capacity pre-flight check without access to the volume info.
|
||||
// The annotation is always stripped by the restore engine; it never lands on the cluster.
|
||||
InplaceRestoreSourceSizeAnnotation = "restore.velero.io/inplace-restore-source-size"
|
||||
|
||||
// InplaceRestoreVolumeHandleAnnotation is a Velero-internal carrier annotation set by the
|
||||
// restore engine on a PVC item before RestoreItemActions run. It carries the CSI volume
|
||||
// handle of the PV the PVC was bound to at backup time, recorded in the backup volume info,
|
||||
// so the PVC CSI RestoreItemAction can verify the existing PVC is still bound to the
|
||||
// backed-up volume. The annotation is always stripped by the restore engine; it never lands
|
||||
// on the cluster.
|
||||
InplaceRestoreVolumeHandleAnnotation = "restore.velero.io/inplace-restore-volume-handle"
|
||||
// SkippedNoCSIPVAnnotation - Velero checks this annotation on processed PVC to
|
||||
// find out if the snapshot was skipped b/c the PV is not provisioned via CSI
|
||||
SkippedNoCSIPVAnnotation = "backup.velero.io/skipped-no-csi-pv"
|
||||
|
||||
Reference in New Issue
Block a user