Skip to content

vm-instance: expose evictionStrategy so a VM can opt out of eviction on a drain #4419

Open

Description

A tenant cannot choose how their VM is treated on a node drain. The vm-instance chart renders no evictionStrategy in the VM and has no value for it, so every VMInstance inherits the cluster-wide strategy from the KubeVirt CR.

KubeVirt already supports a per-VM choice. It reads spec.evictionStrategy on the VMI first and falls back to the cluster setting only when that field is unset (migrations.go#L116-L122). The chart just does not pass anything through.

This matters more after #4403. That PR moves the cluster default from LiveMigrate to LiveMigrateIfPossible, so a VM that cannot live-migrate is shut down on eviction instead of holding the drain. For most VMs this is the better default. For a VM whose disk is bound to one node, for example on a LINSTOR class without DRBD, it means the VM is down until that node is back. Some tenants would rather have the drain wait than lose such a VM for a whole maintenance window, and today they have no way to ask for that.

I propose an optional evictionStrategy value in vm-instance, rendered into the VM only when set. Empty keeps the current behaviour, which is the cluster default. kubernetes-nodes already sets External per VM, so a per-VM strategy is not new to the platform.

One question to settle first. LiveMigrate on a non-migratable VM blocks the drain forever, so exposing the full enum hands a tenant a veto over node maintenance. Offering only a subset of values may be the safer option.

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature
    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
    on Sep 23, 2026
  2. added
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions