mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00:00
Skip disk carry-forward when guest agent is explicitly disabled (#1319)
Prevents stale disk data from persisting indefinitely in the efficient poller when a user disables the guest agent after it had been providing data. Matches the fallback poller's agent-disabled exclusion.
This commit is contained in:
parent
abbd0df609
commit
9c279732f7
1 changed files with 4 additions and 1 deletions
|
|
@ -7755,7 +7755,10 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam
|
|||
// intermittently times out. Refs: #1319
|
||||
// Also triggers when GetVMStatus itself failed (agentEnabled stays
|
||||
// false but the VM had real disk data last cycle).
|
||||
if res.Status == "running" && res.Type == "qemu" && diskUsage <= 0 {
|
||||
// Skip when we know the agent is explicitly disabled — that's a
|
||||
// permanent state and stale data shouldn't persist indefinitely.
|
||||
agentExplicitlyOff := detailedStatus != nil && detailedStatus.Agent.Value == 0
|
||||
if res.Status == "running" && res.Type == "qemu" && diskUsage <= 0 && !agentExplicitlyOff {
|
||||
if prev, ok := prevDiskByGuestID[guestID]; ok && prev.Usage > 0 && prev.Total > 0 && prev.Used >= 0 && prev.Used <= prev.Total {
|
||||
diskTotal = uint64(prev.Total)
|
||||
diskUsed = uint64(prev.Used)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue