Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Preserve existing disk provenance when importing legacy QGA eligibility

pulse-triage[bot]98037ba9d91f
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 4b1b9fa17b..7595b797d8 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -24,7 +24,9 @@ useful guest metadata can establish fallback query eligibility. A later poll
that preserves optional IP/OS/version strings does not renew that evidence.
Internal `GuestAgentEvidence` crosses model, canonical and previous-state
snapshots, including an explicit missing origin. Legacy direct snapshots import
-their receipt once; expired, missing and future origins cannot admit a fallback.
+their receipt once, while already annotated disk-only evidence uses its recorded
+filesystem origin, never a linked-agent origin or renewed VM receipt. Expired,
+missing and future origins cannot admit a fallback.
The existing ten-minute boundary, authoritative unavailable status, metadata
backoff and every-command backup-lock/shared uncertainty fences remain intact.
Cached display identity remains available, but cannot upgrade a failed/empty
diff --git a/internal/monitoring/guest_agent_evidence.go b/internal/monitoring/guest_agent_evidence.go
index bd27117643..dd0986d1cf 100644
--- a/internal/monitoring/guest_agent_evidence.go
+++ b/internal/monitoring/guest_agent_evidence.go
@@ -35,7 +35,10 @@ func guestAgentEvidenceTime(prev *models.VM) time.Time {
}
if len(prev.Disks) > 0 && !strings.HasPrefix(prev.DiskStatusReason, "prev-") {
- return prev.LastSeen
+ // Disk provenance was available before query eligibility had its own
+ // annotation. Do not import a known linked-agent or unknown-age reading
+ // as fresh QGA evidence just because the legacy VM row was refreshed.
+ return guestDiskObservationTime(prev)
}
return time.Time{}
}
diff --git a/internal/monitoring/guest_agent_evidence_age_test.go b/internal/monitoring/guest_agent_evidence_age_test.go
index 0909ef85b3..3f27ff890b 100644
--- a/internal/monitoring/guest_agent_evidence_age_test.go
+++ b/internal/monitoring/guest_agent_evidence_age_test.go
@@ -53,6 +53,23 @@ func testGuestAgentEvidenceOriginalAge(t *testing.T) {
if m.hasRecentGuestMetadataEvidence("pve", "node", 105, now) {
t.Fatal("future metadata admitted a guest query")
}
+ for _, tc := range []struct {
+ name string
+ disk models.GuestDiskObservation
+ want bool
+ }{
+ {"legacy-disk-only-original", models.GuestDiskObservation{Source: "guest-agent", ObservedAt: now.Add(-time.Minute)}, true},
+ {"legacy-disk-only-expired", models.GuestDiskObservation{Source: "guest-agent", ObservedAt: now.Add(-20 * time.Minute)}, false},
+ {"legacy-disk-only-unknown", models.GuestDiskObservation{Source: "guest-agent"}, false},
+ {"legacy-linked-agent-is-not-QGA", models.GuestDiskObservation{Source: "agent", ObservedAt: now}, false},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ prev := models.VM{Type: "qemu", LastSeen: now, Disks: []models.Disk{{Total: 1000, Used: 200}}, DiskObservation: tc.disk}
+ if got := hasRecentGuestAgentEvidence(&prev, now); got != tc.want {
+ t.Errorf("disk-only legacy eligibility=%t want=%t", got, tc.want)
+ }
+ })
+ }
}
func testGuestAgentEvidenceCanonicalContinuity(t *testing.T) {