Repository navigation
kubevirt-csi depends on the deprecated HotplugVolumes gate for VMI-level detach #4032
Description
Activity
- addedkind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debtCategorizes issue or PR as related to cleanup of code, process, or technical debtarea/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
on Sep 2, 2026 - addedtriage/needs-triageIndicates an issue needs triage by a maintainerIndicates an issue needs triage by a maintainer
on Sep 2, 2026 lexfrei commented
on Sep 6, 2026 ContributorAuthorMore actionsFiled upstream as kubevirt/csi-driver#381.
Worth correcting the framing here while I am at it: the VMI-level detach is not a cozystack deviation. Upstream
removeVolumeFromVmcallsRemoveVolumeFromVMfirst and only drops toRemoveVolumeFromVMIwhen the volume is not inVM.spec, which is the teardown case. So the dependency onHotplugVolumeslives in the driver, and moving off it is upstream work rather than something this repo can patch around.Separate finding from the same read, which deserves its own issue rather than being folded in here: the local wrapper in
packages/apps/kubernetes/images/kubevirt-csi-driver/controller.godocuments itself as a backport of kubevirt/csi-driver#184, to be dropped once that merges and the module is bumped past it. Both conditions are met. #184 merged on 2026-06-24 andgo.modpins that exact commit. Whether the wrapper is now fully redundant needs a behaviour diff, since it adds a VMI status check andEnsureVolumeRemovedon top of what upstream does.- addedtriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked onpriority/backlogGeneral backlog priority. Lower than priority/important-longtermGeneral backlog priority. Lower than priority/important-longtermupstream-issueRequires resolving an issue in an upstream projectRequires resolving an issue in an upstream projectand removedtriage/needs-triageIndicates an issue needs triage by a maintainerIndicates an issue needs triage by a maintainer
on Sep 23, 2026 - added a commit that references this issue
on Oct 5, 2026 - added a commit that references this issue
on Oct 6, 2026
What this tracks
KubeVirt v1.9.0 marks the
HotplugVolumesfeature gateDeprecated("replaced by DeclarativeHotplugVolumes"). The platform keeps it enabled on purpose (#4015), becausekubevirt-csidetaches tenant volumes through the VMI-levelremovevolumesubresource, and virt-api accepts that call on a VM-owned VMI only whileHotplugVolumesis on:vmiVolumePatchchecksephemeralHotplugSupported(), which is exactlyHotplugVolumesEnabled()(pkg/virt-api/rest/volumes.go). Our wrapper callsRemoveVolumeFromVMIatpackages/apps/kubernetes/images/kubevirt-csi-driver/controller.go:455, and upstream kubevirt/csi-driver has the same fallback inremoveVolumeFromVmfor the case where the VM is already gone during teardown.Upstream names no removal release. Its
Deprecatedstate says "discontinued in the following release" in a doc comment, butMultiArchitectureandDisableMDEVConfigurationhave been deprecated since 1.8.0 and are still registered at 1.9.0, so the state is a direction, not a date. WhenHotplugVolumesdoes becomeDiscontinued, the VMI-level detach path stops working and tenant volume detach breaks during control-plane teardown.While the gate stays enabled it also keeps
DeclarativeHotplugVolumesinert:handleDeclarativeVolumeHotpluginpkg/virt-controller/watch/vm/vm.goreturns early whenHotplugVolumesEnabled(). So anything that wants declarative hotplug (dataVolume.hotpluggable: truein a VM spec) waits on the same change.What has to happen before the gate can go
Move kubevirt-csi off the VMI-level
removevolume: detach through the VM subresource while the VM exists, and for the teardown race handle the orphaned hotplug attachment pod without the VMI subresource (delete the attachment pod, or wait for the VMI to finish terminating). Then dropHotplugVolumesfrom the staticfeatureGatesinpackages/system/kubevirt/templates/kubevirt-cr.yaml, which also switches declarative hotplug on.Check the pinned release's
pkg/virt-config/featuregate/inactive.goat every KubeVirt bump for the state of this gate.