Skip to content

Commit 728ca14

Browse files
committed
MTV-1774 | Start all available VMs from scheduler
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 <mnecas@redhat.com>
1 parent ea38999 commit 728ca14

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pkg/controller/plan/migration.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,22 @@ func (r *Migration) Run() (reQ time.Duration, err error) {
222222
return
223223
}
224224
}
225-
226-
vm, hasNext, err := r.scheduler.Next()
227-
if err != nil {
228-
return
229-
}
230-
if hasNext {
231-
err = r.execute(vm)
225+
for {
226+
var hasNext bool
227+
var vm *plan.VMStatus
228+
vm, hasNext, err = r.scheduler.Next()
232229
if err != nil {
233230
return
234231
}
232+
if hasNext {
233+
err = r.execute(vm)
234+
if err != nil {
235+
return
236+
}
237+
} else {
238+
r.Log.Info("The scheduler does not have any additional VMs.")
239+
break
240+
}
235241
}
236242

237243
completed, err := r.end()

0 commit comments

Comments
 (0)