Uploaded image for project: 'OpenShift API for Data Protection'
  1. OpenShift API for Data Protection
  2. OADP-6809

Add VMFR PVC RestoreItemAction plugin for multi-backup collision prevention

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • OADP 1.6.0
    • None
    • None
    • None
    • Product / Portfolio Work
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Selected
    • ToDo
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown
    • None

      Summary

      Implements Velero RestoreItemAction plugin to solve PVC name collisions in Virtual Machine File Restore scenarios. The plugin ensures unique PVC names when multiple backups contain the same VM, preventing restore conflicts through a robust, length-safe GenerateName approach.

      Problem Solved

      When VM File Restore discovers multiple backups containing the same VM, restoring PVCs from these backups would fail due to identical PVC names. This plugin ensures each restored PVC has a unique name while respecting Kubernetes naming constraints.

      Implementation Details

      _ _Plugin Name*: openshift.io/04-vmfr-pvc-restore-plugin
      _ _Trigger*: oadp.openshift.io/vmfr-restore: "true" annotation on Velero Restore
      _ _Naming Strategy*: Uses GenerateName with length-safe prefix generation
      _ _DNS-1123 Compliance*: Ensures names never exceed 253-character Kubernetes limit
      _ _Labels Added*:

      • oadp.openshift.io/vmfr-backup: Source backup name
      • oadp.openshift.io/vmfr-original-name: Original PVC name

      Key Features

      _ _Length-safe GenerateName approach*: Prevents API server rejection due to name length
      _ _Reusable utility function*: MakeGenerateName in common/util.go for other plugins
      _ _Proper truncation logic*: Respects DNS-1123 limits (248 chars + 5 for K8s suffix)
      _ _Dash trimming*: Avoids malformed names when truncating
      _ _Comprehensive test coverage*: Including edge cases for very long names

      GitHub PR

      Related GitHub Pull Request: https://github.com/openshift/openshift-velero-plugin/pull/355

      Files Added/Modified

      • velero-plugins/common/util.go - Added MakeGenerateName utility function
      • velero-plugins/pvc/vmfr_restore.go - Main plugin implementation
      • velero-plugins/pvc/vmfr_restore_test.go - Comprehensive test coverage
      • velero-plugins/main.go - Plugin registration

      Status

      COMPLETED - PR merged on October 2, 2025
      ✅ All tests pass including comprehensive unit tests
      ✅ Approved by reviewers: kaovilai, sseago

              spampatt@redhat.com Shubham Pampattiwar
              spampatt@redhat.com Shubham Pampattiwar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: