Skip to content

Fix/vm state newest sample - #25

Merged
wvcollenburg merged 2 commits into
masterfrom
fix/vm-state-newest-sample
Nov 22, 2026
Merged

wvcollenburg merged 2 commits into
masterfrom
fix/vm-state-newest-sample

Conversation

@wvcollenburg

Copy link
Copy Markdown
Owner

What this fixes

A VM started from + New VM (or powered on or off) kept its old state in the VM list for up to two minutes: it read shutoff while its console already showed as open.

Cause. Power state, node, OS and replication source are stored as tags on the collector's inventory points. Right after a power change a VM therefore has two series side by side, the old state and the new one, until the older one leaves the dashboard's two-minute query window. The VM list took whichever series it read last, and SHUTOFF sorts after RUNNING.

Fix. The VM list reads each VM from its newest inventory record (vm_rows.newest_inventory), the same way it already reads performance samples since 1.8.1. A VM whose newest record says it is running but that has no performance sample yet (started a moment ago) was left out of the list; it is listed now too.

Together with 1.9.0's immediate poll after a change, the list follows a start or stop within a second.

Testing

  • Unit: 1110 passed in a clean python:3.12 with only tests/requirements.txt, as CI runs it. New tests cover both directions (started, stopped) in either record order.
  • Live on a lab cluster: a New VM with start showed RUNNING 0.6 s after its change finished; a power off showed SHUTOFF after 0.9 s.

William David van Collenburg added 2 commits November 22, 2026 22:36
A VM started from New VM (or powered on or off) kept its old state in the VM list for up to two
minutes, while its console already showed as open. Power state, node, OS and replication source
are tags of the inventory points, so right after a change the VM has an old and a new series side
by side until the old one leaves the query window, and the list took whichever came last
('SHUTOFF' sorts after 'RUNNING'). Each VM is now read from its newest inventory record
(vm_rows.newest_inventory), the way vm_rows.fold already reads the performance samples.

A VM whose newest record is RUNNING but that has no performance sample yet (started a moment ago)
was left out of the list; it is listed now too. Measured on WDvCN11: New VM with start shows
RUNNING 0.6 s after the change finished, a power off SHUTOFF after 0.9 s.
@wvcollenburg
wvcollenburg merged commit 1c957ce into master Nov 22, 2026
@wvcollenburg
wvcollenburg deleted the fix/vm-state-newest-sample branch November 23, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant