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 dffab20
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 @@ -167,9 +167,18 @@ func (r *Scheduler) buildPending() (err error) {
}

if !vmStatus.MarkedStarted() && !vmStatus.MarkedCompleted() {
var cost int
if el9, _ := r.Plan.VSphereUsesEl9VirtV2v(); el9 {

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

View check run for this annotation

Codecov / codecov/patch

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

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

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

View check run for this annotation

Codecov / codecov/patch

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

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

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L176 was not covered by tests
}

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 dffab20

Please sign in to comment.