Skip to content
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

Add 'EvictionStrategy' as a cluster-wide setting in the KubeVirt CR #7086

Merged
merged 7 commits into from Feb 16, 2022

Conversation

acardace
Copy link
Member

What this PR does / why we need it:

If set this will apply to all VMIs which don't have an EvictionStrategy setting set in their VMI's spec.

Also add 'EvictionStrategyNone' as a VMI Eviction Strategy, This option can be used by the single VMI to opt-out from being live-migrated on eviction if the cluster is set to do so.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Add 'EvictionStrategy' as a cluster-wide setting in the KubeVirt CR

@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. size/L labels Jan 14, 2022
@acardace
Copy link
Member Author

/retest

Copy link
Contributor

@iholder101 iholder101 left a comment

Choose a reason for hiding this comment

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

Great job!! comments below!

I would also add documentation to here.

@acardace
Copy link
Member Author

Great job!! comments below!

I would also add documentation to here.

I added some docs here 03cdd41#diff-34a591e3aa47260cfad791064c20f34f98fdca4a63532fbf7184e68682f4fcb8R2049.

Thanks for the review!

@acardace acardace force-pushed the cluster-eviction-strategy branch 2 times, most recently from 168a00d to 760ef2f Compare January 19, 2022 14:53
@acardace
Copy link
Member Author

/retest

@acardace
Copy link
Member Author

/retest

@iholder101
Copy link
Contributor

Thank you @acardace!
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2022
@acardace
Copy link
Member Author

/retest

2 similar comments
@acardace
Copy link
Member Author

/retest

@acardace
Copy link
Member Author

acardace commented Feb 3, 2022

/retest

@acardace
Copy link
Member Author

acardace commented Feb 4, 2022

/test pull-kubevirt-unit-test

@kubevirt-bot kubevirt-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm Indicates that a PR is ready to be merged. labels Feb 4, 2022
…t CR

If set this will apply to all VMIs which don't have an EvictionStrategy
setting set in their VMI's spec.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
This patch takes into account the cluster-wide setting if the VMI
specific EvictionStrategy has not been set.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
Removing vmi.VirtualMachineInstance.IsEvictable() as it's now unused in
our codebase.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
This option can be used by the single VMI to opt-out from being
live-migrated on eviction if the cluster is set to do so.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
Signed-off-by: Antonio Cardace <acardace@redhat.com>
Signed-off-by: Antonio Cardace <acardace@redhat.com>
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2022
@acardace
Copy link
Member Author

/retest

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/approve

Thanks!

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidvossel

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 Feb 11, 2022
Copy link
Contributor

@fossedihelm fossedihelm left a comment

Choose a reason for hiding this comment

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

Looks good overall. Just a nits that can be addressed later. Thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2022
…g unit tests

Signed-off-by: Antonio Cardace <acardace@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2022
@fossedihelm
Copy link
Contributor

/lgtm Thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2022
@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Feb 15, 2022

@acardace: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-e2e-k8s-1.20-cgroupsv2 fcd1797 link true /test pull-kubevirt-e2e-k8s-1.20-cgroupsv2
pull-kubevirt-check-tests-for-flakes 3730f7a link false /test pull-kubevirt-check-tests-for-flakes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit 66cedbf into kubevirt:main Feb 16, 2022
@rmohr
Copy link
Member

rmohr commented Feb 16, 2022

Sorry for not checking the code in detail which probably answers this, but how will this behave if the VMI is non-migratable? Will there be warnings triggered, or do you take care of differentiating between explicitly set eviction strategies and defaulting and inhibit the warning events? Or do you expect users to always set None as strategy explicitly to avoid warnings of any sort?

@acardace
Copy link
Member Author

acardace commented Feb 16, 2022

Sorry for not checking the code in detail which probably answers this, but how will this behave if the VMI is non-migratable? Will there be warnings triggered, or do you take care of differentiating between explicitly set eviction strategies and defaulting and inhibit the warning events? Or do you expect users to always set None as strategy explicitly to avoid warnings of any sort?

@rmohr no worries, basically something like the "current" behavior is kept, if you specify you want to live migrate on eviction for all VMIs in the cluster you will get warnings if some VMIs are not.

https://github.com/acardace/kubevirt/blob/3730f7aeb15c16f5821f4006020034d436978341/pkg/virt-handler/vm.go#L910

@rmohr
Copy link
Member

rmohr commented Feb 16, 2022

@rmohr no worries, basically something like the "current" behavior is kept, if you specify you want to live migrate on eviction for all VMIs in the cluster you will get warnings if some VMIs are not.

https://github.com/acardace/kubevirt/blob/3730f7aeb15c16f5821f4006020034d436978341/pkg/virt-handler/vm.go#L910

What I want to get at: I did not have to worry about opting out of live-migrations before if I e.g. chose a local volume, a local resouce, ... Now I will get warnings although I never opted in?

@acardace
Copy link
Member Author

@rmohr no worries, basically something like the "current" behavior is kept, if you specify you want to live migrate on eviction for all VMIs in the cluster you will get warnings if some VMIs are not.
https://github.com/acardace/kubevirt/blob/3730f7aeb15c16f5821f4006020034d436978341/pkg/virt-handler/vm.go#L910

What I want to get at: I did not have to worry about opting out of live-migrations before if I e.g. chose a local volume, a local resouce, ... Now I will get warnings although I never opted in?

I see, in practice yes if the cluster admin set the global conf to live migrate everything on eviction, unless you explicitly set EvictionStrategyNone.

I don't know if it's better to still see the alert or just hide it, @rmohr would you like to silence it?

@rmohr
Copy link
Member

rmohr commented Sep 30, 2022

I don't know if it's better to still see the alert or just hide it, @rmohr would you like to silence it?

Sorry for not following up. I think that in the case where we only set a default recommendation we could come up with an alternative cluster-strategy: Something like LiveMigrateIfPossible which would not trigger a warning if the VMI is not live-migratable. If users don't specify it, they would not care about it, and we would not have to trigger a warning and would just shut them down on cluster evictions. What do you think?

Especially with local storage in play that is anyway the right action. The VMI is bound to that node still and will come up when the node comes up again.

@acardace
Copy link
Member Author

acardace commented Oct 3, 2022

I don't know if it's better to still see the alert or just hide it, @rmohr would you like to silence it?

Sorry for not following up. I think that in the case where we only set a default recommendation we could come up with an alternative cluster-strategy: Something like LiveMigrateIfPossible which would not trigger a warning if the VMI is not live-migratable. If users don't specify it, they would not care about it, and we would not have to trigger a warning and would just shut them down on cluster evictions. What do you think?

Especially with local storage in play that is anyway the right action. The VMI is bound to that node still and will come up when the node comes up again.

Yes, that's a neat idea, I like it!

I'll create an issue to track it and get to it to as soon as possible.

@fabiand
Copy link
Member

fabiand commented Dec 20, 2022

@acardace @stu-gott was the user-guide ever updated?

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. area/monitoring dco-signoff: yes Indicates the PR's author has DCO signed all their commits. 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. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants