From dffab206acd0ac45f6215b0bcf6b872429f2741c Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Sun, 9 Jun 2024 17:10:46 +0300 Subject: [PATCH] vsphere: virt-v2v transfers disks sequentially when scheduling migrations to accommodate the controller_max_vm_inflight setting for vSphere, we didn't take into account that disks are transferred sequentially by virt-v2v (as opposed to CDI that transfers them in parallel by different pods). This lead to performance degregeration since could have triggered more migrations, in case of migrations of multi-disk VMs, simultaneously without exceeding the value of controller_max_vm_inflight. This is fixed by setting the cost of each VM for which the disks are transferred by virt-v2v to 1. Signed-off-by: Arik Hadas --- pkg/controller/plan/scheduler/vsphere/scheduler.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/controller/plan/scheduler/vsphere/scheduler.go b/pkg/controller/plan/scheduler/vsphere/scheduler.go index 100130c90..1315bf23e 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler.go @@ -167,9 +167,18 @@ func (r *Scheduler) buildPending() (err error) { } if !vmStatus.MarkedStarted() && !vmStatus.MarkedCompleted() { + var cost int + if el9, _ := r.Plan.VSphereUsesEl9VirtV2v(); el9 { + /// virt-v2v transfers one disk at a time + cost = 1 + } else { + // CDI transfers the disks in parallel by different pods + cost = len(vm.Disks) + } + pending := &pendingVM{ status: vmStatus, - cost: len(vm.Disks), + cost: cost, } r.pending[vm.Host] = append(r.pending[vm.Host], pending) }