Skip to content

Commit

Permalink
MTV-1774 | Start all available VMs from scheduler
Browse files Browse the repository at this point in the history
Issue:
This issue is visible with a combination of two problems.
The first problem is if there is some step/phase that takes some time to
finish and halts the process. An example of such an issue MTV-1775.
This causes the VM migration startup to take some time as we don't start
all available VMs at once but we add VMs one by one in the reconcile.
This in large-scale migration can take a long time.
For example on the scale of 200 VMs in best case scenario it would take
10 minutes to start all VMs as we have 3s reconciled.

Fix:
Start all available VMs from the scheduler at once.

Ref: https://issues.redhat.com/browse/MTV-1774

Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Dec 12, 2024
1 parent ea38999 commit 7c33864
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pkg/controller/plan/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,22 @@ func (r *Migration) Run() (reQ time.Duration, err error) {
return
}
}

vm, hasNext, err := r.scheduler.Next()
if err != nil {
return
}
if hasNext {
err = r.execute(vm)
for {
var hasNext bool
var vm *plan.VMStatus
vm, hasNext, err = r.scheduler.Next()
if err != nil {
return
}
if hasNext {
err = r.execute(vm)
if err != nil {
return
}
} else {
r.Log.Info("The scheduler does not have any additional VMs.")
break
}
}

completed, err := r.end()
Expand Down

0 comments on commit 7c33864

Please sign in to comment.