Skip to content

fix(core): skip node placement migration during volume migration#2497

Draft
danilrwx wants to merge 3 commits into
mainfrom
fix/vmop/local-nodeplacement-update
Draft

fix(core): skip node placement migration during volume migration#2497
danilrwx wants to merge 3 commits into
mainfrom
fix/vmop/local-nodeplacement-update

Conversation

@danilrwx

Copy link
Copy Markdown
Contributor

Description

Prevent the workload updater from creating nodeplacement-update-* VMOPs while a KubeVirt VMI has an active volume migration state.

The node placement handler now skips automatic migration when VolumesChange=True or status.migratedVolumes is not empty.

Why do we need it, and what problem does it solve?

During local disk migration, KubeVirt can temporarily set NodePlacementNotMatched=True because the running pod placement and the desired disk/node affinity differ while volumes are being switched.

Previously, the workload updater treated this transient state as a node placement change and created an extra nodeplacement-update-* operation for the same VM. This could interfere with disk migration and leave the VM/VMI in a stale volume migration state.

What is the expected result?

  1. Start migration for a VM with a local disk.
  2. While the VMI has VolumesChange=True or non-empty status.migratedVolumes, no nodeplacement-update-* VMOP is created.
  3. Disk migration completes without an extra workload updater migration for the same VM.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: core
type: fix
summary: Prevent node placement updates from interrupting active VM volume migration.
impact_level: low

@danilrwx danilrwx force-pushed the fix/vmop/local-nodeplacement-update branch 3 times, most recently from 09b1590 to 8ce1b97 Compare June 17, 2026 13:11
danilrwx added 3 commits June 18, 2026 12:38
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
A node placement update is fulfilled via a live migration (Evict VMOP).
For a VMI that is not live-migratable, e.g. one with local/non-shared
disks, a live migration can never reconcile the placement, so triggering
it only produces a failing VMOP.

Previously the handler skipped node placement migration only while
volume migration signals were active (VolumesChange, MigratedVolumes,
active MigrationState). Once they cleared after a volume migration with
local disks, the handler could still fire an Evict when NodePlacementNotMatched
was True and the recorded placement sum diverged from the current one,
which happened intermittently due to a race during the affinity revert.

Gate the handler on the KVVMI LiveMigratable condition: if the VMI is
not live-migratable, never trigger the migration. The placement sum is
not recorded in this case so the migration can still fire once the VMI
becomes migratable again (e.g. after disks are migrated to shared storage).

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vmop/local-nodeplacement-update branch from 3f26743 to 446f2ee Compare June 18, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant