Repository navigation
Fix/vm state newest sample - #25
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
python:3.12with onlytests/requirements.txt, as CI runs it. New tests cover both directions (started, stopped) in either record order.