fix(vm): resolve VMBDA-attached images during hotplug window#2574
Merged
Conversation
The KVVM builder resolves block device images from maps built out of .spec/.status blockDeviceRefs, while the VMBDA-driven volume sync iterates the VMBDA list. During a hotplug attach KubeVirt adds the volume to KVVM before the device appears in .status.blockDeviceRefs, so the freshly attached image is missing from the maps and setBlockDeviceDisk aborts the whole reconcile with "image should exist in the cluster". Fill the builder maps with VMBDA-referenced images/disks not yet reflected in the refs. Scoped to the KVVM builder call site so block device readiness and finalizer logic are unaffected. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Assert ResolveVMBDAAttachedDevices fills the builder maps with images and disks referenced by VMBDAs that are missing from the block device refs, and tolerates a VMBDA whose image does not exist. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
universal-itengineer
approved these changes
Jul 2, 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.
Description
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 short window the KVVM buildercan't find the image and fails the whole reconcile with
... image "<name>" should exist in the cluster; please recreate it.Fix: resolve VMBDA-attached images/disks that aren't in the refs yet, so the builder can set
their disks instead of aborting. Scoped to the KVVM builder only — readiness and finalizer
logic are untouched.
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