fix(vm): tolerate missing hotplug image during attach#2578
Closed
danilrwx wants to merge 1 commit into
Closed
Conversation
Temporarily build 3p-kubevirt from fix/hotplug-cdisk-teardown-unmount to verify the hotplug container-disk teardown unmount fix on the cluster, and bust the werf install cache so the branch is re-cloned. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
aeec3cb to
808f79d
Compare
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
Reverts #2574 and fixes the same issue with a smaller, builder-only change.
While an image is being hotplugged via VMBDA, KubeVirt adds the volume to KVVM before the
device shows up in the VM
.status.blockDeviceRefs. In that window the builder maps don'tcontain the image yet, and
setVMBDABlockDeviceDiskfailed the whole reconcile with... image "<name>" should exist in the cluster; please recreate it.Fix: in the VirtualImage/ClusterVirtualImage branches, skip the disk when the image is not in
the maps yet — the volume is already present and options are applied on a later reconcile.
This mirrors the already-tolerant VirtualDisk branch. Skip (not
removeDisk): an attachedimage is finalizer-protected, so a missing entry means the status lagged, not that the image
is gone.
Why this instead of #2574: #2574 pre-fetched VMBDA-referenced objects into the builder maps
(~120 lines + extra API Gets per reconcile). This achieves the same result with two guards in
the one function that actually errors, no new API calls, and no reliance on how the block
device status handler reads the maps.
Why do we need it, and what problem does it solve?
The image exists and is
Ready, but the reconcile still errors during the attach window. Itself-heals, yet spams
errorlogs and causes requeue/backoff churn (and e2e flakiness). Thisremoves those false failures. Attach speed is unchanged.
What is the expected result?
Hotplug an image (VI/CVI) to a running VM: no more
image "<name>" should exist in the clustererrors during the attach; the VMBDA reaches
Attachedand the VM status converges cleanly.Checklist
Changelog entries