Repository navigation
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
fix(kubevirt)!: evict non-migratable VMs instead of blocking the drain (