Disable KubeVirt live migrate during upgrades (backport #60)#61
Merged
Conversation
* feat(upgradeplan): disable KubeVirt LiveMigrate during upgrades Clear workloadUpdateMethods on the KubeVirt CR in ClusterUpgrade.PreRun and add a matching entry to the harvester ManagedChart's spec.diff.comparePatches so Fleet does not revert the change as drift. Restore [LiveMigrate] and remove the comparePatch entry during cleanup. Without this, upgrading the KubeVirt operator triggers a simultaneous live-migration of every running VM to refresh virt-launcher, even though those pods are about to be replaced by node upgrades anyway. Ported from harvester/harvester#10386. CPU/memory hot-plugging is unavailable for the upgrade window; VMs migrate naturally during node upgrades. Signed-off-by: Zespre Chang <[email protected]> Co-authored-by: Kiefer Chang <[email protected]> * feat(chart): add corresponding RBAC rules Signed-off-by: Zespre Chang <[email protected]> --------- Signed-off-by: Zespre Chang <[email protected]> Co-authored-by: Kiefer Chang <[email protected]> (cherry picked from commit 534a2bd)
starbops
approved these changes
Apr 17, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem:
The
LiveMigrateworkload update method indicates that all VMs will be live-migrated to update their launcher images during the cluster-upgrade phase as soon as KubeVirt gets upgraded to the new version. These excessive VM live migrations are considered harmful to the cluster and upgrade stability.Solution:
Temporarily turn off the
LiveMigrateworkload update method during the upgrade. Revert it at the end of the upgrade.The
harvesterManagedChart also needs to be handled to prevent Fleet from reverting the config during the upgrade.Related Issue(s):
harvester/harvester#10349
Test plan:
starbops/harvester-upgrade-toolkit:feat-disable-kubevirt-live-migrate-during-upgrade-head)LiveMigrateremoved), and theharvesterManagedChart CR should be patched with the corresponding comparePatch*-workload-update-*VMIMs created and no VMs are being live migratedharvesterManagedChart should be revertedAdditional documentation or context
Porting changes from harvester/harvester#10386
Note
The major difference between harvester/harvester#10386 is that LiveMigrate disabling is handled in the controller using a pure Go implementation instead of a shell script.
This is an automatic backport of pull request #60 done by Mergify.