From 5c9cc29aac0622deefadc0d0e8cf5ff899c5df14 Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Mon, 10 Jun 2024 11:53:43 +0300 Subject: [PATCH] vsphere: skip archived plans when counting inflight vms It could be that we have VMs for which the migration is marked as started and not marked as completed in archived plans. From now on, we will not take such VMs into account when counting the inflight VMs. Signed-off-by: Arik Hadas --- pkg/controller/plan/scheduler/vsphere/scheduler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/plan/scheduler/vsphere/scheduler.go b/pkg/controller/plan/scheduler/vsphere/scheduler.go index 2e7159450..ccf5fb11f 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler.go @@ -127,6 +127,11 @@ func (r *Scheduler) buildInFlight() (err error) { continue } + // skip archived plans + if p.Spec.Archived { + continue + } + // skip plans that aren't being executed snapshot := p.Status.Migration.ActiveSnapshot() if !snapshot.HasCondition("Executing") {