Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsphere: virt-v2v transfers disks sequentially #926

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions pkg/controller/plan/scheduler/vsphere/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
return
}
if vmStatus.Running() {
r.inFlight[vm.Host] += len(vm.Disks)
r.inFlight[vm.Host] += r.cost(vm)

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L110 was not covered by tests
}
}

Expand Down Expand Up @@ -148,7 +148,7 @@
}
return err
}
r.inFlight[vm.Host] += len(vm.Disks)
r.inFlight[vm.Host] += r.cost(vm)

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L151 was not covered by tests
}
}

Expand All @@ -169,14 +169,24 @@
if !vmStatus.MarkedStarted() && !vmStatus.MarkedCompleted() {
pending := &pendingVM{
status: vmStatus,
cost: len(vm.Disks),
cost: r.cost(vm),

Check warning on line 172 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

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

func (r *Scheduler) cost(vm *model.VM) int {
if el9, _ := r.Plan.VSphereUsesEl9VirtV2v(); el9 {

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#L180-L181

Added lines #L180 - L181 were not covered by tests
/// virt-v2v transfers one disk at a time
return 1
} else {

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

View check run for this annotation

Codecov / codecov/patch

pkg/controller/plan/scheduler/vsphere/scheduler.go#L183-L184

Added lines #L183 - L184 were not covered by tests
// CDI transfers the disks in parallel by different pods
return len(vm.Disks)

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L186 was not covered by tests
}
}

// Return a map of all the VMs that could be scheduled
// based on the available host capacities.
func (r *Scheduler) schedulable() (schedulable map[string][]*pendingVM) {
Expand Down
Loading