-
Notifications
You must be signed in to change notification settings - Fork 79
add a 3 cirros-vm test for manual recreate #1626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
weshayutin
wants to merge
11
commits into
openshift:master
Choose a base branch
from
weshayutin:3-vms
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+830
−0
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
390ce4a
add a 3 cirros-vm test for manual recreate
weshayutin a30feb3
update restore yaml
weshayutin bce9adf
add some notes
weshayutin 3b7ab1f
added second test case
weshayutin b5dac71
updated w/ container based disks for vms
weshayutin 3884a6f
cleanup readme
weshayutin 6a6bb67
clean up cirros pv test,readme,results
weshayutin 5e84b0b
more cleanup
weshayutin 44854da
add screenshot of diff
weshayutin 0e6fc70
fix file name
weshayutin 6a0280d
Update tests/e2e/sample-applications/virtual-machines/cirros-test/3-v…
weshayutin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
tests/e2e/sample-applications/virtual-machines/cirros-test/3-vms/README.MD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
54 changes: 54 additions & 0 deletions
54
...ines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/cirros-test-cont-1-dv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
56 changes: 56 additions & 0 deletions
56
...os-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-cirros-test-cont-1-dv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
80 changes: 80 additions & 0 deletions
80
...os-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/describe-vm-cirros-test-cont-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: <nil> | ||
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: <nil> | ||
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: <none> |
53 changes: 53 additions & 0 deletions
53
...cirros-test/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Name: [1mcirros-test-cont-1[22m | ||
Namespace: openshift-adp | ||
Labels: <none> | ||
Annotations: <none> | ||
|
||
Phase: [32mCompleted[0m | ||
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: <none> | ||
|
||
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: <none> | ||
|
||
Label selector: app=cirros-test-cont-1 | ||
|
||
Or label selector: <none> | ||
|
||
Restore PVs: auto | ||
|
||
CSI Snapshot Restores: <none included> | ||
|
||
Existing Resource Policy: <none> | ||
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) |
5 changes: 5 additions & 0 deletions
5
...est/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/restore-cirros-test-cont-1-get-all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Binary file added
BIN
+277 KB
...t/3-vms/cirros-test-with-dataVolumeContainer/RESULTS/visual_diff_of_restore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions
58
...irtual-machines/cirros-test/3-vms/cirros-test-with-dataVolumeContainer/cirros-test-1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.