Skip to content

Allow VMExport to start if completed VMI exists #13240

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

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

awels
Copy link
Member

@awels awels commented Nov 12, 2024

What this PR does

Before this PR:
It is possible that a VMI has completed or failed and one wants to export the VM disk. Right now the VMExport will remain pending because it finds the VMI and refuses to start.
After this PR:
This change allows the VMExport to become ready if a VMI exists that is either failed or succeeded.

Fixes https://issues.redhat.com/browse/CNV-49376

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Special notes for your reviewer

The default behavior if a VM is stopped normally is to delete the VMI, but in case this doesn't
happen, the VMExport should still be allowed to start.

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

Fix issue starting Virtual Machine Export when succeed/failed VMI exists for that VM

Sorry, something went wrong.

It is possible that a VMI has completed or failed
and one wants to export the VM disk. This change
allows the VMExport to become ready if either of
those conditions are met.

The default behavior if a VM is stopped normally
is to delete the VMI, but in case this doesn't
happen, the VMExport should still be allowed to
start.

Signed-off-by: Alexander Wels <awels@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Nov 12, 2024
@dosubot dosubot bot added the kind/bug label Nov 12, 2024
@@ -408,6 +411,34 @@ var _ = Describe("PVC source", func() {
Entry("PVCs", createVMWithPVCs, "kubevirt", "kubevirt", verifyKubevirtInternal),
Entry("Memorydump and pvc", createVMWithPVCandMemoryDump, "kubevirt", "archive", verifyMixedInternal),
)
It("Should create VM export, when VM is stopped, but VMI exists in succeeded state", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to add also a test for the failed case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I agree should be a pretty small change to make it test also the failed cased. other then that looks good and I will lgtm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@alicefr
Copy link
Member

alicefr commented Nov 13, 2024

The code looks good, I have only one question.
/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alicefr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 13, 2024
Signed-off-by: Alexander Wels <awels@redhat.com>
Copy link
Contributor

@ShellyKa13 ShellyKa13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 13, 2024
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.30-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.29-sig-network
/test pull-kubevirt-e2e-k8s-1.29-sig-storage
/test pull-kubevirt-e2e-k8s-1.29-sig-compute
/test pull-kubevirt-e2e-k8s-1.29-sig-operator
/test pull-kubevirt-e2e-k8s-1.30-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-storage
/test pull-kubevirt-e2e-k8s-1.30-sig-compute
/test pull-kubevirt-e2e-k8s-1.30-sig-operator

@kubevirt-bot kubevirt-bot merged commit 55bde60 into kubevirt:main Nov 14, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants