Skip to content

Commit

Permalink
vsphere: virt-v2v transfers disks sequentially
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ahadas committed Jun 9, 2024
1 parent 4b425e4 commit 3775aa3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/controller/plan/scheduler/vsphere/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,19 @@ func (r *Scheduler) buildPending() (err error) {
return
}

var cost int
if el9, _ := r.Plan.VSphereUsesEl9VirtV2v(); el9 {

Check warning on line 170 in pkg/controller/plan/scheduler/vsphere/scheduler.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/plan/scheduler/vsphere/scheduler.go#L169-L170

Added lines #L169 - L170 were not covered by tests
/// virt-v2v transfers one disk at a time
cost = 1
} else {

Check warning on line 173 in pkg/controller/plan/scheduler/vsphere/scheduler.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/plan/scheduler/vsphere/scheduler.go#L172-L173

Added lines #L172 - L173 were not covered by tests
// CDI transfers the disks in parallel by different pods
cost = len(vm.Disks)

Check warning on line 175 in pkg/controller/plan/scheduler/vsphere/scheduler.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/plan/scheduler/vsphere/scheduler.go#L175

Added line #L175 was not covered by tests
}

if !vmStatus.MarkedStarted() && !vmStatus.MarkedCompleted() {
pending := &pendingVM{
status: vmStatus,
cost: len(vm.Disks),
cost: cost,

Check warning on line 181 in pkg/controller/plan/scheduler/vsphere/scheduler.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/plan/scheduler/vsphere/scheduler.go#L181

Added line #L181 was not covered by tests
}
r.pending[vm.Host] = append(r.pending[vm.Host], pending)
}
Expand Down

0 comments on commit 3775aa3

Please sign in to comment.