diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/README.MD b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/README.MD new file mode 100644 index 0000000000..b24daec654 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/README.MD @@ -0,0 +1,53 @@ +# Various test cases for backing up / restoring vms using selectors + +## DataVolume precreated: backup all, restore one at a time +#### setup: +``` +alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero' +cd cirros-test-with-dataVolumePV +oc create namespace cirros-test-ds-pv +oc create -f cirros-datasource-datavolume.yaml +oc create -f cirros-test-1.yaml -f cirros-test-2.yaml -f cirros-test-3.yaml +velero backup create backup-cirros-test-pv-all --include-namespaces cirros-test-ds-pv --snapshot-move-data=true +oc delete -f cirros-test-1.yaml -f cirros-test-2.yaml -f cirros-test-3.yaml +``` + +#### to restore: +``` +alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero' +velero restore create cirros-test-pv-1 --from-backup backup-cirros-test-pv-all --selector app=cirros-test-pv-1 +velero restore create cirros-test-pv-2 --from-backup backup-cirros-test-pv-all --selector app=cirros-test-pv-2 +velero restore create cirros-test-pv-3 --from-backup backup-cirros-test-pv-all --selector app=cirros-test-pv-3 +``` + +**The above use case should all work as expected. \0/** +See the results in [cirros-test-with-dataVolumePV/RESULTS](cirros-test-with-dataVolumePV/RESULTS) + +## DataVolume not precreated, container disk: backup all, restore one at a time +#### setup: +``` +alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero' +cd cirros-test-dataVolumeContainer + +oc create namespace cirros-test-cont +oc create -f cirros-test-1.yaml -f cirros-test-2.yaml -f cirros-test-3.yaml +velero backup create backup-cirros-test-cont-all --include-namespaces cirros-test-cont --snapshot-move-data=true +oc delete -f cirros-test-1.yaml -f cirros-test-2.yaml -f cirros-test-3.yaml +``` +#### to restore scenario 1: (does NOT work) +See the results in [cirros-test-with-dataVolumeContainer/RESULTS](cirros-test-with-dataVolumeContainer/RESULTS) + +``` +velero restore create cirros-test-cont-1 --from-backup backup-cirros-test-cont-all --selector app=cirros-test-cont-1 +velero restore create cirros-test-cont-2 --from-backup backup-cirros-test-cont-all --selector app=cirros-test-cont-2 +velero restore create cirros-test-cont-3 --from-backup backup-cirros-test-cont-all --selector app=cirros-test-cont-3 +``` + +#### to restore scenario 2: (works) +``` +velero restore create cirros-test-1 --from-backup backup-cirros-test-cont-all +``` + +**Velero selectors in some cases are not working, The datavolume PV/PVC is not a restore resource** + +[visual diff of restore's resources](cirros-test-with-dataVolumeContainer/RESULTS/visual_diff_of_restore.png) \ No newline at end of file diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/cirros-test-cont-1-dv b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/cirros-test-cont-1-dv new file mode 100644 index 0000000000..e029f0cba2 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/cirros-test-cont-1-dv @@ -0,0 +1,54 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataVolume +metadata: + annotations: + cdi.kubevirt.io/allowClaimAdoption: "true" + cdi.kubevirt.io/storage.deleteAfterCompletion: "false" + cdi.kubevirt.io/storage.prePopulated: cirros-test-cont-1-dv + cdi.kubevirt.io/storage.usePopulator: "true" + creationTimestamp: "2025-02-14T18:02:10Z" + generation: 1 + labels: + kubevirt.io/created-by: 6a13cdf9-5248-43c5-af45-173686433723 + velero.io/backup-name: backup-cirros-test-cont-all + velero.io/restore-name: cirros-test-cont-1 + name: cirros-test-cont-1-dv + namespace: cirros-test-cont + ownerReferences: + - apiVersion: kubevirt.io/v1 + blockOwnerDeletion: true + controller: true + kind: VirtualMachine + name: cirros-test-cont-1 + uid: 8df919d1-9798-47f8-b4ce-1ba0859d451c + resourceVersion: "24067411" + uid: bf4409e2-1992-4d36-bfb9-3c29857947dc +spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 150Mi + volumeMode: Block + source: + registry: + pullMethod: node + url: docker://quay.io/kubevirt/cirros-container-disk-demo +status: + conditions: + - lastHeartbeatTime: "2025-02-14T18:02:10Z" + lastTransitionTime: "2025-02-14T18:02:10Z" + message: No PVC found + reason: NotFound + status: Unknown + type: Bound + - lastHeartbeatTime: "2025-02-14T18:02:10Z" + lastTransitionTime: "2025-02-14T18:02:10Z" + status: "False" + type: Ready + - lastHeartbeatTime: "2025-02-14T18:02:10Z" + lastTransitionTime: "2025-02-14T18:02:10Z" + status: "False" + type: Running + phase: Pending diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-cirros-test-cont-1-dv b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-cirros-test-cont-1-dv new file mode 100644 index 0000000000..ddb05a6c68 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-cirros-test-cont-1-dv @@ -0,0 +1,56 @@ +Name: cirros-test-cont-1-dv +Namespace: cirros-test-cont +Labels: kubevirt.io/created-by=6a13cdf9-5248-43c5-af45-173686433723 + velero.io/backup-name=backup-cirros-test-cont-all + velero.io/restore-name=cirros-test-cont-1 +Annotations: cdi.kubevirt.io/allowClaimAdoption: true + cdi.kubevirt.io/storage.deleteAfterCompletion: false + cdi.kubevirt.io/storage.prePopulated: cirros-test-cont-1-dv + cdi.kubevirt.io/storage.usePopulator: true +API Version: cdi.kubevirt.io/v1beta1 +Kind: DataVolume +Metadata: + Creation Timestamp: 2025-02-14T18:02:10Z + Generation: 1 + Owner References: + API Version: kubevirt.io/v1 + Block Owner Deletion: true + Controller: true + Kind: VirtualMachine + Name: cirros-test-cont-1 + UID: 8df919d1-9798-47f8-b4ce-1ba0859d451c + Resource Version: 24067411 + UID: bf4409e2-1992-4d36-bfb9-3c29857947dc +Spec: + Pvc: + Access Modes: + ReadWriteOnce + Resources: + Requests: + Storage: 150Mi + Volume Mode: Block + Source: + Registry: + Pull Method: node + URL: docker://quay.io/kubevirt/cirros-container-disk-demo +Status: + Conditions: + Last Heartbeat Time: 2025-02-14T18:02:10Z + Last Transition Time: 2025-02-14T18:02:10Z + Message: No PVC found + Reason: NotFound + Status: Unknown + Type: Bound + Last Heartbeat Time: 2025-02-14T18:02:10Z + Last Transition Time: 2025-02-14T18:02:10Z + Status: False + Type: Ready + Last Heartbeat Time: 2025-02-14T18:02:10Z + Last Transition Time: 2025-02-14T18:02:10Z + Status: False + Type: Running + Phase: Pending +Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal NotFound 3m50s datavolume-import-controller No PVC found diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-vm-cirros-test-cont-1 b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-vm-cirros-test-cont-1 new file mode 100644 index 0000000000..f1f93f0de9 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-vm-cirros-test-cont-1 @@ -0,0 +1,80 @@ +Name: cirros-test-cont-1 +Namespace: cirros-test-cont +Labels: app=cirros-test-cont-1 + velero.io/backup-name=backup-cirros-test-cont-all + velero.io/restore-name=cirros-test-cont-1 +Annotations: kubevirt.io/latest-observed-api-version: v1 + kubevirt.io/storage-observed-api-version: v1 +API Version: kubevirt.io/v1 +Kind: VirtualMachine +Metadata: + Creation Timestamp: 2025-02-14T18:02:10Z + Finalizers: + kubevirt.io/virtualMachineControllerFinalize + Generation: 1 + Resource Version: 24067415 + UID: 8df919d1-9798-47f8-b4ce-1ba0859d451c +Spec: + Data Volume Templates: + Metadata: + Annotations: + cdi.kubevirt.io/storage.deleteAfterCompletion: false + Creation Timestamp: + Name: cirros-test-cont-1-dv + Spec: + Pvc: + Access Modes: + ReadWriteOnce + Resources: + Requests: + Storage: 150Mi + Volume Mode: Block + Source: + Registry: + Pull Method: node + URL: docker://quay.io/kubevirt/cirros-container-disk-demo + Running: true + Template: + Metadata: + Creation Timestamp: + Name: cirros-test-cont-1 + Spec: + Architecture: amd64 + Domain: + Devices: + Disks: + Disk: + Bus: virtio + Name: volume0 + Interfaces: + Mac Address: 02:87:36:00:00:7e + Masquerade: + Name: default + Rng: + Machine: + Type: q35 + Resources: + Requests: + Memory: 256M + Networks: + Name: default + Pod: + Termination Grace Period Seconds: 0 + Volumes: + Data Volume: + Name: cirros-test-cont-1-dv + Name: volume0 +Status: + Conditions: + Last Probe Time: 2025-02-14T18:02:10Z + Last Transition Time: 2025-02-14T18:02:10Z + Message: VMI does not exist + Reason: VMINotExists + Status: False + Type: Ready + Printable Status: Provisioning + Volume Snapshot Statuses: + Enabled: false + Name: volume0 + Reason: PVC not found +Events: diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1 b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1 new file mode 100644 index 0000000000..fcab4cb504 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1 @@ -0,0 +1,53 @@ +Name: cirros-test-cont-1 +Namespace: openshift-adp +Labels: +Annotations: + +Phase: Completed +Total items to be restored: 5 +Items restored: 5 + +Started: 2025-02-14 18:02:09 +0000 UTC +Completed: 2025-02-14 18:02:10 +0000 UTC + +Backup: backup-cirros-test-cont-all + +Namespaces: + Included: all namespaces found in the backup + Excluded: + +Resources: + Included: * + Excluded: nodes, events, events.events.k8s.io, backups.velero.io, restores.velero.io, resticrepositories.velero.io, csinodes.storage.k8s.io, volumeattachments.storage.k8s.io, backuprepositories.velero.io + Cluster-scoped: auto + +Namespace mappings: + +Label selector: app=cirros-test-cont-1 + +Or label selector: + +Restore PVs: auto + +CSI Snapshot Restores: + +Existing Resource Policy: +ItemOperationTimeout: 4h0m0s + +Preserve Service NodePorts: auto + +Uploader config: + + +HooksAttempted: 0 +HooksFailed: 0 + +Resource List: + cdi.kubevirt.io/v1beta1/DataVolume: + - cirros-test-cont/cirros-test-cont-1-dv(created) + kubevirt.io/v1/VirtualMachine: + - cirros-test-cont/cirros-test-cont-1(created) + velero.io/v2alpha1/DataUpload: + - openshift-adp/backup-cirros-test-cont-all-fvs4v(skipped) + - openshift-adp/backup-cirros-test-cont-all-nkdsq(skipped) + - openshift-adp/backup-cirros-test-cont-all-tgtb7(skipped) diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1-get-all b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1-get-all new file mode 100644 index 0000000000..45f67a2705 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1-get-all @@ -0,0 +1,5 @@ +NAME PHASE PROGRESS RESTARTS AGE +datavolume.cdi.kubevirt.io/cirros-test-cont-1-dv Pending 107s + +NAME AGE STATUS READY +virtualmachine.kubevirt.io/cirros-test-cont-1 108s Provisioning False diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/visual_diff_of_restore.png b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/visual_diff_of_restore.png new file mode 100644 index 0000000000..c2e6670f4f Binary files /dev/null and b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/visual_diff_of_restore.png differ diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-1.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-1.yaml new file mode 100644 index 0000000000..008fda04ba --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-1.yaml @@ -0,0 +1,58 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + annotations: + generation: 1 + labels: + app: cirros-test-cont-1 + name: cirros-test-cont-1 + namespace: cirros-test-cont +spec: + dataVolumeTemplates: + - metadata: + annotations: + cdi.kubevirt.io/storage.deleteAfterCompletion: "false" + creationTimestamp: null + name: cirros-test-cont-1-dv + spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 150Mi + volumeMode: Block + source: + registry: + pullMethod: node + url: docker://quay.io/kubevirt/cirros-container-disk-demo + running: true + template: + metadata: + creationTimestamp: null + name: cirros-test-cont-1 + spec: + architecture: amd64 + domain: + devices: + disks: + - disk: + bus: virtio + name: volume0 + interfaces: + - masquerade: {} + name: default + rng: {} + machine: + type: q35 + resources: + requests: + memory: 256M + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 0 + volumes: + - dataVolume: + name: cirros-test-cont-1-dv + name: volume0 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-2.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-2.yaml new file mode 100644 index 0000000000..fbe36924dd --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-2.yaml @@ -0,0 +1,58 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + annotations: + generation: 1 + labels: + app: cirros-test-cont-2 + name: cirros-test-cont-2 + namespace: cirros-test-cont +spec: + dataVolumeTemplates: + - metadata: + annotations: + cdi.kubevirt.io/storage.deleteAfterCompletion: "false" + creationTimestamp: null + name: cirros-test-cont-2-dv + spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 150Mi + volumeMode: Block + source: + registry: + pullMethod: node + url: docker://quay.io/kubevirt/cirros-container-disk-demo + running: true + template: + metadata: + creationTimestamp: null + name: cirros-test-cont-2 + spec: + architecture: amd64 + domain: + devices: + disks: + - disk: + bus: virtio + name: volume0 + interfaces: + - masquerade: {} + name: default + rng: {} + machine: + type: q35 + resources: + requests: + memory: 256M + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 0 + volumes: + - dataVolume: + name: cirros-test-cont-2-dv + name: volume0 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-3.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-3.yaml new file mode 100644 index 0000000000..58c46e3d12 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-3.yaml @@ -0,0 +1,58 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + annotations: + generation: 1 + labels: + app: cirros-test-cont-3 + name: cirros-test-cont-3 + namespace: cirros-test-cont +spec: + dataVolumeTemplates: + - metadata: + annotations: + cdi.kubevirt.io/storage.deleteAfterCompletion: "false" + creationTimestamp: null + name: cirros-test-cont-3-dv + spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 150Mi + volumeMode: Block + source: + registry: + pullMethod: node + url: docker://quay.io/kubevirt/cirros-container-disk-demo + running: true + template: + metadata: + creationTimestamp: null + name: cirros-test-cont-3 + spec: + architecture: amd64 + domain: + devices: + disks: + - disk: + bus: virtio + name: volume0 + interfaces: + - masquerade: {} + name: default + rng: {} + machine: + type: q35 + resources: + requests: + memory: 256M + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 0 + volumes: + - dataVolume: + name: cirros-test-cont-3-dv + name: volume0 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1 b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1 new file mode 100644 index 0000000000..d88786d798 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1 @@ -0,0 +1,70 @@ +Name: cirros-test-pv-1 +Namespace: openshift-adp +Labels: +Annotations: + +Phase: Completed +Total items to be restored: 6 +Items restored: 6 + +Started: 2025-02-14 17:45:24 +0000 UTC +Completed: 2025-02-14 17:45:55 +0000 UTC + +Backup: backup-cirros-test-pv-all + +Namespaces: + Included: all namespaces found in the backup + Excluded: + +Resources: + Included: * + Excluded: nodes, events, events.events.k8s.io, backups.velero.io, restores.velero.io, resticrepositories.velero.io, csinodes.storage.k8s.io, volumeattachments.storage.k8s.io, backuprepositories.velero.io + Cluster-scoped: auto + +Namespace mappings: + +Label selector: app=cirros-test-pv-1 + +Or label selector: + +Restore PVs: auto + +CSI Snapshot Restores: + cirros-test-ds-pv/cirros-test-pv-1: + Data Movement: + Operation ID: dd-25300e47-4dcf-4dad-951d-930b18d633c3.c053f1d8-fddf-498d791ef + Data Mover: velero + Uploader Type: kopia + +Existing Resource Policy: +ItemOperationTimeout: 4h0m0s + +Preserve Service NodePorts: auto + +Uploader config: + +Restore Item Operations: + Operation for persistentvolumeclaims cirros-test-ds-pv/cirros-test-pv-1: + Restore Item Action Plugin: velero.io/csi-pvc-restorer + Operation ID: dd-25300e47-4dcf-4dad-951d-930b18d633c3.c053f1d8-fddf-498d791ef + Phase: Completed + Progress: 157286400 of 157286400 complete (Bytes) + Progress description: Completed + Created: 2025-02-14 17:45:25 +0000 UTC + Started: 2025-02-14 17:45:29 +0000 UTC + Updated: 2025-02-14 17:45:37 +0000 UTC + +HooksAttempted: 0 +HooksFailed: 0 + +Resource List: + kubevirt.io/v1/VirtualMachine: + - cirros-test-ds-pv/cirros-test-pv-1(created) + v1/PersistentVolume: + - pvc-67aa6a30-3b06-4d9c-a07c-26dbecb0f553(skipped) + v1/PersistentVolumeClaim: + - cirros-test-ds-pv/cirros-test-pv-1(created) + velero.io/v2alpha1/DataUpload: + - openshift-adp/backup-cirros-test-pv-all-5j6g6(skipped) + - openshift-adp/backup-cirros-test-pv-all-cvjph(skipped) + - openshift-adp/backup-cirros-test-pv-all-gxh6d(skipped) diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1-gell-all b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1-gell-all new file mode 100644 index 0000000000..bee91be55a --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-1-gell-all @@ -0,0 +1,11 @@ +NAME READY STATUS RESTARTS AGE +pod/virt-launcher-cirros-test-pv-1-8lpt7 1/1 Running 0 3m2s + +NAME PHASE PROGRESS RESTARTS AGE +datavolume.cdi.kubevirt.io/cirros-test-pv-1 Succeeded N/A 3m3s + +NAME AGE PHASE IP NODENAME READY +virtualmachineinstance.kubevirt.io/cirros-test-pv-1 3m4s Running 10.129.3.14 mtv82-hqmq6-worker-0-wcgl5 True + +NAME AGE STATUS READY +virtualmachine.kubevirt.io/cirros-test-pv-1 3m4s Running True diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2 b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2 new file mode 100644 index 0000000000..339a6bfa5a --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2 @@ -0,0 +1,70 @@ +Name: cirros-test-pv-2 +Namespace: openshift-adp +Labels: +Annotations: + +Phase: Completed +Total items to be restored: 6 +Items restored: 6 + +Started: 2025-02-14 17:49:11 +0000 UTC +Completed: 2025-02-14 17:49:55 +0000 UTC + +Backup: backup-cirros-test-pv-all + +Namespaces: + Included: all namespaces found in the backup + Excluded: + +Resources: + Included: * + Excluded: nodes, events, events.events.k8s.io, backups.velero.io, restores.velero.io, resticrepositories.velero.io, csinodes.storage.k8s.io, volumeattachments.storage.k8s.io, backuprepositories.velero.io + Cluster-scoped: auto + +Namespace mappings: + +Label selector: app=cirros-test-pv-2 + +Or label selector: + +Restore PVs: auto + +CSI Snapshot Restores: + cirros-test-ds-pv/cirros-test-pv-2: + Data Movement: + Operation ID: dd-6a0a8a38-fc24-4d24-9158-1ff692c86be8.445720a6-9581-44511e817 + Data Mover: velero + Uploader Type: kopia + +Existing Resource Policy: +ItemOperationTimeout: 4h0m0s + +Preserve Service NodePorts: auto + +Uploader config: + +Restore Item Operations: + Operation for persistentvolumeclaims cirros-test-ds-pv/cirros-test-pv-2: + Restore Item Action Plugin: velero.io/csi-pvc-restorer + Operation ID: dd-6a0a8a38-fc24-4d24-9158-1ff692c86be8.445720a6-9581-44511e817 + Phase: Completed + Progress: 157286400 of 157286400 complete (Bytes) + Progress description: Completed + Created: 2025-02-14 17:49:11 +0000 UTC + Started: 2025-02-14 17:49:24 +0000 UTC + Updated: 2025-02-14 17:49:37 +0000 UTC + +HooksAttempted: 0 +HooksFailed: 0 + +Resource List: + kubevirt.io/v1/VirtualMachine: + - cirros-test-ds-pv/cirros-test-pv-2(created) + v1/PersistentVolume: + - pvc-98c1e104-6ca9-47fe-816e-76f3111fe0c6(skipped) + v1/PersistentVolumeClaim: + - cirros-test-ds-pv/cirros-test-pv-2(created) + velero.io/v2alpha1/DataUpload: + - openshift-adp/backup-cirros-test-pv-all-5j6g6(skipped) + - openshift-adp/backup-cirros-test-pv-all-cvjph(skipped) + - openshift-adp/backup-cirros-test-pv-all-gxh6d(skipped) diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2-gell-all b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2-gell-all new file mode 100644 index 0000000000..b96d71789a --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/RESULTS/restore-cirros-test-pv-2-gell-all @@ -0,0 +1,15 @@ +NAME READY STATUS RESTARTS AGE +pod/virt-launcher-cirros-test-pv-1-8lpt7 1/1 Running 0 5m16s +pod/virt-launcher-cirros-test-pv-2-gj59m 1/1 Running 0 89s + +NAME PHASE PROGRESS RESTARTS AGE +datavolume.cdi.kubevirt.io/cirros-test-pv-1 Succeeded N/A 5m18s +datavolume.cdi.kubevirt.io/cirros-test-pv-2 Succeeded N/A 91s + +NAME AGE PHASE IP NODENAME READY +virtualmachineinstance.kubevirt.io/cirros-test-pv-1 5m18s Running 10.129.3.14 mtv82-hqmq6-worker-0-wcgl5 True +virtualmachineinstance.kubevirt.io/cirros-test-pv-2 91s Running 10.129.3.16 mtv82-hqmq6-worker-0-wcgl5 True + +NAME AGE STATUS READY +virtualmachine.kubevirt.io/cirros-test-pv-1 5m18s Running True +virtualmachine.kubevirt.io/cirros-test-pv-2 91s Running True diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-datasource-datavolume.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-datasource-datavolume.yaml new file mode 100644 index 0000000000..04684670fc --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-datasource-datavolume.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: List +items: +- apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataSource + metadata: + name: cirros + namespace: openshift-virtualization-os-images + spec: + source: + pvc: + name: cirros + namespace: openshift-virtualization-os-images +- apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: cirros + namespace: openshift-virtualization-os-images + spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 150Mi + source: + http: + url: https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img + diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-1.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-1.yaml new file mode 100644 index 0000000000..a152efbe06 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-1.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: List +items: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + name: cirros-test-pv-1 + namespace: cirros-test-ds-pv + labels: + app: cirros-test-pv-1 + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: cirros-test-pv-1 + spec: + sourceRef: + kind: DataSource + name: cirros + namespace: openshift-virtualization-os-images + storage: + resources: + requests: + storage: 150Mi + running: true + template: + metadata: + annotations: + vm.kubevirt.io/flavor: tiny + spec: + domain: + devices: + disks: + - disk: + bus: virtio + name: rootdisk + firmware: + bootloader: + efi: + secureBoot: false + resources: + requests: + cpu: 1 + memory: 256Mi + volumes: + - name: rootdisk + persistentVolumeClaim: + claimName: cirros-test-pv-1 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-2.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-2.yaml new file mode 100644 index 0000000000..e23159187f --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-2.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: List +items: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + name: cirros-test-pv-2 + namespace: cirros-test-ds-pv + labels: + app: cirros-test-pv-2 + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: cirros-test-pv-2 + spec: + sourceRef: + kind: DataSource + name: cirros + namespace: openshift-virtualization-os-images + storage: + resources: + requests: + storage: 150Mi + running: true + template: + metadata: + annotations: + vm.kubevirt.io/flavor: tiny + spec: + domain: + devices: + disks: + - disk: + bus: virtio + name: rootdisk + firmware: + bootloader: + efi: + secureBoot: false + resources: + requests: + cpu: 1 + memory: 256Mi + volumes: + - name: rootdisk + persistentVolumeClaim: + claimName: cirros-test-pv-2 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-3.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-3.yaml new file mode 100644 index 0000000000..7b2f9ff214 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/cirros-test-3.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: List +items: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + name: cirros-test-pv-3 + namespace: cirros-test-ds-pv + labels: + app: cirros-test-pv-3 + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: cirros-test-pv-3 + spec: + sourceRef: + kind: DataSource + name: cirros + namespace: openshift-virtualization-os-images + storage: + resources: + requests: + storage: 150Mi + running: true + template: + metadata: + annotations: + vm.kubevirt.io/flavor: tiny + spec: + domain: + devices: + disks: + - disk: + bus: virtio + name: rootdisk + firmware: + bootloader: + efi: + secureBoot: false + resources: + requests: + cpu: 1 + memory: 256Mi + volumes: + - name: rootdisk + persistentVolumeClaim: + claimName: cirros-test-pv-3 diff --git a/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/restore-cirros-test-3-only.yaml b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/restore-cirros-test-3-only.yaml new file mode 100644 index 0000000000..a4542316f3 --- /dev/null +++ b/tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumePV/restore-cirros-test-3-only.yaml @@ -0,0 +1,13 @@ +apiVersion: velero.io/v1 +kind: Restore +metadata: + name: restore-matchlabel-cirros-test-3 + namespace: openshift-adp +spec: + backupName: 3-cirros-vms-all + hooks: {} + includedNamespaces: + - '*' + labelSelector: + matchLabels: + app: cirros-test-3