diff --git a/pkg/controller/plan/migration.go b/pkg/controller/plan/migration.go index 979afe3bd..2535e97c8 100644 --- a/pkg/controller/plan/migration.go +++ b/pkg/controller/plan/migration.go @@ -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()