project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

Overview stopped VM count should use explicit stopped status

Open artistpromedia opened this issue 3 months ago • 3 comments

Noticed this while looking at the overview on a six-cluster setup.

The "VMs Stopped" number appears to be derived as totalVms - runningVms in the overview UI. That works only when every non-running guest is actually stopped. It can mislabel other guest states as stopped, and it also makes the label a little misleading because the backend already exposes explicit stopped counts.

There is a similar pattern in the group status path: the loop increments stopped in the else branch after checking for running, so any non-running status becomes stopped.

Expected behavior:

  • count running only when status == "running"
  • count stopped only when status == "stopped"
  • keep total as the broader guest total if you want it to include templates/paused/suspended/etc.

Local hotfix tested on my install:

  • backend group totals now use an explicit elif status == "stopped"
  • overview/group UI now carries stoppedVms and displays that instead of totalVms - runningVms

After the local patch, the estate reads cleanly:

  • all clusters: 30 running / 26 stopped
  • on-prem group: 21 running / 4 stopped
  • labs group: 9 running / 22 stopped

I'll keep the PR for this to only this count/label issue, per your note on keeping contributions smaller and single-purpose.

artistpromedia avatar Aug 30 '26 22:08 artistpromedia

Opened the small fix PR here: #750. Kept it to just the stopped-count issue.

artistpromedia avatar Aug 30 '26 22:08 artistpromedia

Good catch, and thanks for the tested breakdown — that matches what we found.

Fixed on Testing:

  • the group-status loop now increments stopped only on status == "stopped", so paused/suspended guests and templates no longer land in the stopped bucket (the old catch-all else was the culprit);
  • the all-clusters overview and the per-node cards carry the backend's explicit stopped count instead of total − running.

Total still covers every guest, so running + stopped won't always equal it — which is what you asked for. Ships in the next release.

mkellermann97 avatar Aug 31 '26 07:08 mkellermann97

Shipped in v1.1.0 — closing this out. Reopen if it still shows up for you.

MrMasterbay avatar Aug 31 '26 09:08 MrMasterbay