fix(vm): allow disk updates when VM is stopped#2407
Open
hardcoretime wants to merge 1 commit into
Open
Conversation
When a VM with paravirtualization is stopped and disks are changed in VM spec, the KVVM was not being updated. This caused the old disks to remain and new disks to not be added. Additionally, added wait for 'lsblk' command to be ready in the block_device_hotplug e2e test to prevent intermittent failures. Changes: - Add isVmRunning check to paravirtualization condition in applyBlockDeviceRefs to allow new disks when VM is stopped - Update cleanupRemovedStaticDisks to remove all disks unconditionally when VM is stopped - Add unit tests for cleanupRemovedStaticDisks with isVmRunning parameter - Add util.UntilGuestCommandsReady for lsblk in block_device_hotplug test Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
0622ef2 to
01e81fd
Compare
Contributor
|
Workflow has started. |
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.
Description
Fixed the issue where disk changes on a stopped VirtualMachine with WaitForFirstConsumer (wffc) volume binding mode were not being applied to the KVVM (intvirtvm) resource.
Changes made to
pkg/controller/kvbuilder/kvvm_utils.go:isVmRunningcheck to the paravirtualization condition inapplyBlockDeviceRefsto allow new disks when VM is stoppedcleanupRemovedStaticDisksfunction to acceptisVmRunningparameter and remove all disks unconditionally when VM is stopped (not just non-hotpluggable ones)Added unit tests in
pkg/controller/kvbuilder/kvvm_utils_test.goto verify:Why do we need it, and what problem does it solve?
The DataExport e2e test was failing when using storage class with WaitForFirstConsumer (wffc) volume binding mode. The scenario:
The VM got stuck in starting phase because:
This happened because the code was designed for running VMs with hotplug handler, not for stopped VMs where changes should be applied directly.
What is the expected result?
When a VM is stopped and disks are changed in the VM spec (disks added/removed), the KVVM resource should be updated accordingly. After the fix:
Checklist
Changelog entries