diff --git a/docs/design/kubevirt-datamover.md b/docs/design/kubevirt-datamover.md index d8797df9fa0..52a10a0ff6d 100644 --- a/docs/design/kubevirt-datamover.md +++ b/docs/design/kubevirt-datamover.md @@ -43,18 +43,18 @@ Taking a VolumeSnapshot and then using kopia to process the entire volume and co ## High-Level design ### Upstream velero changes -- Update velero volume policy model to allow unrecognized volume policy actions. Velero would treat unrecognized actions as "skip" (i.e. no snapshot or fs-backup), but the kubevirt datamover could only act if the policy action is "kubevirt". +- Update velero volume policy model to allow custom volume policy actions. Velero would treat custom actions as "skip" (i.e. no snapshot or fs-backup), but the kubevirt datamover could only act if the policy action is "custom" with "datamover: kubevirt" in "parameters". - In `pkg/restore/actions/dataupload_retrieve_action.go` and in `DataDownload` we need to add SnapshotType. ### BackupItemAction/RestoreItemAction plugins - VirtualMachine BIA plugin - The plugin will check whether the VirtualMachine's `status.ChangedBlockTracking` is `Enabled` - The plugin must also determine whether the VM is running, since offline backup is not supported in the initial release. - - If QEMU backup is enabled, the next question is whether the user wants to use the kubevirt datamover for this VM's volumes. We will use volume policies for this, although it's a bit more complicated since a VM could have multiple PVCs. If at least one PVC for the VM has the "kubevirt" policy action specified, and no PVCs in this VM have other non-skip policies (i.e. "snapshot", etc.) then we'll use the kubevirt datamover - - In addition, SnapshotMoveData must be true + - If QEMU backup is enabled, the next question is whether the user wants to use the kubevirt datamover for this VM's volumes. We will use volume policies for this, although it's a bit more complicated since a VM could have multiple PVCs. If at least one PVC for the VM has the "custom" policy action with "datamover=kubevirt" parameter specified, and no PVCs in this VM have other non-skip policies (i.e. "snapshot", etc.) then we'll use the kubevirt datamover + - In addition, SnapshotMoveData must be true - Iterate over all PVCs for the VM - - If any PVC has an action other than "kubevirt" or "skip", exit without action - - If at least one PVC has an action of "kubevirt", then use the kubevirt datamover + - If any PVC has an action other than "custom" or "skip", exit without action + - If at least one PVC has an action of "custom" with parameter "datamover=kubevirt", then use the kubevirt datamover - This plugin will create a DataUpload with `Spec.SnapshotType` set to "kubevirt" and `Spec.DataMover` set to "kubevirt" - Note that unlike the built-in datamover, this DataUpload is tied to a VM (which could include multiple PVCs) rather than to a single PVC. - An annotation will be added to the DataUpload identifying the VirtualMachine we're backing up. diff --git a/tests/e2e/lib/backup.go b/tests/e2e/lib/backup.go index 4b77991b26f..1c931a372d8 100755 --- a/tests/e2e/lib/backup.go +++ b/tests/e2e/lib/backup.go @@ -62,8 +62,9 @@ const kubevirtVolumePolicyData = `version: v1 volumePolicies: - conditions: {} action: - type: skip -` + type: custom + parameters: + datamover: kubevirt` // EnsureKubevirtVolumePolicy creates (or updates) the volume policy ConfigMap // that tells Velero to skip CSI snapshots for CBT-labeled PVCs, allowing the diff --git a/tests/e2e/sample-applications/virtual-machines/kubevirt-dm/volume-policy.yaml b/tests/e2e/sample-applications/virtual-machines/kubevirt-dm/volume-policy.yaml index dd7f63af920..2b3543230a3 100644 --- a/tests/e2e/sample-applications/virtual-machines/kubevirt-dm/volume-policy.yaml +++ b/tests/e2e/sample-applications/virtual-machines/kubevirt-dm/volume-policy.yaml @@ -9,4 +9,6 @@ data: volumePolicies: - conditions: {} action: - type: skip + type: custom + parameters: + datamover: kubevirt \ No newline at end of file