From 5e011fbfd8211514c5446f9cdf1c916de4879e02 Mon Sep 17 00:00:00 2001 From: Martin Necas Date: Mon, 7 Oct 2024 16:15:18 +0200 Subject: [PATCH] MTV-1573 | Allow scheduler to migrate VMs with more disks Issue: When migrating the VM using the warm migration with more disks than the MAX_VM_INFLIGHT the VM won't get scheduled and won't start the migration. Fix: Once the scheduler is empty the controller will start the migration of the large VMs. Signed-off-by: Martin Necas --- pkg/controller/plan/scheduler/vsphere/scheduler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/plan/scheduler/vsphere/scheduler.go b/pkg/controller/plan/scheduler/vsphere/scheduler.go index 0b2abef98..4f8aabe97 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler.go @@ -204,6 +204,11 @@ func (r *Scheduler) schedulable() (schedulable map[string][]*pendingVM) { if vms[i].cost+r.inFlight[host] <= r.MaxInFlight { schedulable[host] = append(schedulable[host], vms[i]) } + // In case there is VM with more disks than the MaxInFlight MTV will migrate it, if there are no other VMs + // being migrated at that time. + if vms[i].cost > r.MaxInFlight && r.inFlight[host] == 0 { + schedulable[host] = append(schedulable[host], vms[i]) + } } }