Skip to content

fix(vm): sync unschedulable KVVM on vmclass placement change#2177

Merged
danilrwx merged 1 commit into
mainfrom
fix/vm/sync-kvvm-vmclass
Apr 7, 2026
Merged

fix(vm): sync unschedulable KVVM on vmclass placement change#2177
danilrwx merged 1 commit into
mainfrom
fix/vm/sync-kvvm-vmclass

Conversation

@danilrwx
Copy link
Copy Markdown
Contributor

@danilrwx danilrwx commented Apr 1, 2026

Description

Fix synchronization of internal KubeVirt VM when the VM is in Unschedulable state and placement-related settings are changed via VMClass.

The workaround path in SyncKvvmHandler now treats these change paths as placement policy updates:

  • virtualMachineClassName
  • VirtualMachineClass:spec.nodeSelector
  • VirtualMachineClass:spec.tolerations

This allows controller to apply KVVM update and recycle launcher pod for unschedulable cases.

Also added unit tests for placement-path detection in isPlacementPolicyChanged.

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

When VM pod creation fails and KVVM stays Unschedulable, changing VMClass (for example, discovery -> generic) did not trigger full KVVM resync for placement-dependent fields.
As a result, domain.cpu / tolerations could stay stale and VM remained stuck.

This change makes unschedulable recovery react to VMClass-driven placement changes.

What is the expected result?

  1. Put VM into Unschedulable state.
  2. Change VMClass name or update VMClass spec.nodeSelector / spec.tolerations.
  3. Verify KVVM is synchronized and VM can leave Unschedulable when constraints become schedulable.

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.

@danilrwx danilrwx modified the milestones: v1.7.0, v1.8.0 Apr 1, 2026
@danilrwx danilrwx marked this pull request as ready for review April 1, 2026 14:13
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vm/sync-kvvm-vmclass branch from 86a4bbf to 0690a4d Compare April 1, 2026 14:13
@danilrwx danilrwx merged commit 42f1801 into main Apr 7, 2026
27 of 28 checks passed
@danilrwx danilrwx deleted the fix/vm/sync-kvvm-vmclass branch April 7, 2026 08:20
fl64 pushed a commit that referenced this pull request Apr 28, 2026
Fix synchronization of internal KubeVirt VM when the VM is in Unschedulable state and placement-related settings are changed via VMClass.

The workaround path in SyncKvvmHandler now treats these change paths as placement policy updates:

virtualMachineClassName
VirtualMachineClass:spec.nodeSelector
VirtualMachineClass:spec.tolerations
This allows controller to apply KVVM update and recycle launcher pod for unschedulable cases.

Also added unit tests for placement-path detection in isPlacementPolicyChanged.

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
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.

2 participants