Add check for vmi not running or in final state to avoid running the vcpu real time scheduling logic in each update loop
@@ -2793,8 +2793,9 @@ func (d *VirtualMachineController) vmUpdateHelperDefault(origVMI *v1.VirtualMach
return err
}
}
- if origVMI.IsRealtimeEnabled() {
- if err := d.configureVCPUScheduler(origVMI); err != nil {
+ if vmi.IsRealtimeEnabled() && !vmi.IsRunning() && !vmi.IsFinal() {
+ log.Log.Object(vmi).Info("Configuring vcpus for real time workloads")
+ if err := d.configureVCPUScheduler(vmi); err != nil {
return err
}
}
