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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix Proxmox cluster membership reconciliation
rcourtman3a913752de60
diff --git a/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-2026-04-21.md b/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-2026-04-21.mdindex 39c8ef7d93..81680e57fc 100644--- a/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-2026-04-21.md+++ b/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-2026-04-21.md@@ -67,14 +67,19 @@- the candidate already supports filtering the workloads slice by status (`All`, `Running`, `Degraded`, `Stopped`), so there is no missing offline-filter blocker to carry into GA.7. `#1433` (`[Bug]: v5.1.28 - Want All Proxmox Nodes Displayed on the DashBoard even if they are not Powered On`)- - Covered on the current v6 candidate by explicit proof on the v6 surfaces that own node visibility:- - the dashboard overview still counts the offline Proxmox node and surfaces it in `Problem Resources`- - the infrastructure inventory still lists the offline Proxmox node instead of dropping it when the node powers off- - Verification:- - `go test ./internal/api -run 'TestDashboardSummaryKeepsOfflineProxmoxNodeVisible'`- - `cd /Volumes/Development/pulse/repos/pulse/tests/integration && PULSE_E2E_SKIP_DOCKER=1 PLAYWRIGHT_BASE_URL=http://127.0.0.1:5173 npm test -- tests/65-offline-proxmox-node-visibility.spec.ts --project=chromium`+ - The original candidate proof covered a static offline fixture and the+ browser row, but did not exercise a healthy partial `/nodes` poll replacing+ an earlier full cluster inventory. That gap allowed current main to remove+ an unpowered member before the browser received the next snapshot.+ - Superseded disposition:+ - see+ `known-rc-issue-closure-for-ga-proxmox-offline-membership-2026-07-24.md`+ for the provider-membership reconciliation fix, removal rule, restart+ proof, same-name-cluster isolation, downstream history/count proof, and+ desktop/mobile browser coverage.- Result:- - the current v6 candidate does not hide an offline Proxmox node from the product; it remains visible on the canonical dashboard and infrastructure surfaces even though v6 no longer uses the legacy v5 full-node dashboard layout.+ - the earlier static proof is retained as historical evidence but is no+ longer treated as sufficient lifecycle closure for `#1433`.8. `#1436` (`Better disk i/o reads for LXC containers`)- Fixed by merging prefetched LXC `status/current` counters into both container polling paths before rate calculation and reusing the same status snapshot for metadata enrichment.diff --git a/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-proxmox-offline-membership-2026-07-24.md b/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-proxmox-offline-membership-2026-07-24.mdnew file mode 100644index 0000000000..c89f549192--- /dev/null+++ b/docs/release-control/v6/internal/records/known-rc-issue-closure-for-ga-proxmox-offline-membership-2026-07-24.md@@ -0,0 +1,84 @@+# Known RC Issue Closure For GA Proxmox Offline Membership Record++- Date: `2026-07-24`+- Gate: `known-rc-issue-closure-for-ga`+- Issue: `#1433`+- Result: `fixed-main-proof`++## Context++The earlier v6 proof for `#1433` showed that a static offline Proxmox node row+could render, and whole-instance failures later gained last-known placeholder+handling. It did not cover the normal partial-poll transition: a healthy+cluster `/nodes` response could contain only the reachable members, after which+`State.UpdateNodesForInstance` treated the telemetry slice as complete+inventory and removed the powered-off member. The canonical registry then+correctly propagated that mistaken omission as a real resource removal to+overview counts, navigation, history, API, websocket, and mobile consumers.++Setup and refresh discovery had a matching lifecycle error: once any member API+validated, individually unreachable members from `/cluster/status` were+discarded rather than persisted as unavailable members. Configuration+normalization and overview grouping also treated `ClusterName` as globally+unique, allowing unrelated clusters with the same display name to collide.++## Disposition++Proxmox cluster membership and telemetry are now separate contracts.+`/nodes` remains a live metrics observation. A quorate, complete+`/cluster/status` response is the absence-authoritative membership source.+Members present in cluster status but absent from live metrics remain canonical+with their stable node identity, last-seen and linked-agent evidence, zeroed+live CPU/uptime, and explicit offline or stale connection state.++Failed, incomplete, non-quorate, or cluster-identity-mismatched membership reads+retain the last-known union, break any pending absence sequence, and never+advance removal. A member omitted by a+healthy authoritative membership read is retained on the first observation and+retired only after a second consecutive confirmed absence. The pending member+also remains in durable endpoint configuration, so a Pulse restart resets the+volatile confirmation window instead of converting uncertainty into deletion.+Confirmed removal deletes the endpoint and node once, allowing canonical+history and monitored-system/licensing projections to emit and count the real+removal without transient churn.++Discovery persists every member returned by cluster status and records+per-endpoint API reachability as separate evidence. It can add or enrich+members but cannot delete a previously saved member before monitoring's+confirmation rule. Duplicate cluster+configuration now requires overlapping endpoint identity rather than an equal+display name. Node, storage, overview grouping, search, and guest counts use+provider-scoped identity when cluster names repeat.++The Proxmox node table renders explicit `Offline` or `Stale` text and suppresses+live uptime, temperature, bars, and sparklines when provider telemetry is not+current. The row remains navigable on desktop and mobile.++## Proof++- focused monitoring reconciliation tests covering powered-off members,+ unavailable/incomplete/non-quorate reads, cluster identity mismatch,+ immediate membership additions, repeated confirmed removal, uncertainty+ resets, restart, linked-agent evidence, and same-name cluster identity+- configuration and API discovery tests covering distinct same-name clusters+ and unreachable member persistence+- model and unified-resource tests covering provider-scoped deduplication,+ stable offline resource identity, no premature `resource_removed` history,+ and monitored-system count removal only after canonical retirement+- Proxmox page-model and node-table tests covering provider-scoped grouping,+ search, guest counts, explicit offline/stale state, and stale-metric+ suppression+- `tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts` on+ desktop Chromium and the mobile browser project+- issue-owned Go race suites, frontend unit/lint/type/build checks, and v6+ control-plane, status, registry, contract, completion, and readiness audits+- a repository-wide Go race run in which the issue-owned packages passed; the+ run remained red outside this change because the Docker-agent command test+ has an asynchronous cleanup race and the managed migration proof requires+ the absent sibling `pulse-pro/license-server`++## Outcome++The fix is on `main` for a future v6 release. It is not retroactively part of+`v6.1.1`, no v5 backport or publication date is claimed, and `#1433` remains+open for reporter confirmation after a release containing the change.diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 1aa2704e1d..1e65da9958 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -131,6 +131,15 @@ and every supported `pulse-agent` release target built from this source.## Shared Boundaries+`internal/models/models.go` and `internal/monitoring/monitor.go` also carry+monitoring-owned Proxmox cluster node identity and membership-confirmation+state. Provider instances with equal cluster/member display names must not+collapse through a shared endpoint or linked-agent alias, but this scoping does+not change Unified Agent enrollment, token binding, report admission,+tombstones, re-enrollment, or command authority. A linked agent remains+supplemental evidence on the retained canonical Proxmox member; its presence+does not decide provider membership or authorize removal.+Docker / Podman report transport is shared with `api-contracts`.`internal/dockeragent/agent.go` measures the gzip-encoded HTTP entity and thedecoded JSON before attempting any destination, whilediff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 53a90ec860..8b2dcfbf9d 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -8332,3 +8332,27 @@ steady-state authentication/processing emits only at debug severity.`internal/hostagent/proxmox_setup_test.go` prove the wire headers, omittedsetup credential, one-time bootstrap, concurrency, and rejected-tokendiagnostics.++### Proxmox cluster membership discovery transport++The PVE config add, setup, and refresh paths treat `/cluster/status` member rows+as inventory and per-member API validation as separate reachability evidence.+Every returned member is persisted in `clusterEndpoints`, including powered-off+or individually unreachable members. `online` reflects Proxmox cluster status;+`pulseReachable`, `lastPulseCheck`, and `pulseError` reflect Pulse's endpoint+probe. A failed member probe preserves existing guest URL, override,+fingerprint, and last-seen evidence instead of removing the member. Config+discovery may add or enrich members but retains any previously saved member+omitted from a later read because it has no confirmation window for removal.+normalization may consolidate two equal cluster labels only when their saved+authority or literal endpoint address overlaps; equal cluster/member display+names alone are not duplicate identity.++The browser config payload remains additive and compatible: no endpoint field+is removed or renamed. Monitoring owns the later repeated-authoritative-+absence retirement rule; config handlers must not reinterpret a partial+membership or telemetry read as deletion.+`internal/api/config_handlers_cluster_additional_test.go` and+`internal/config/pve_instances_test.go` prove unreachable-member persistence,+evidence preservation, duplicate consolidation, and same-name-cluster+isolation.diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex df7ea687a2..28919e7ae5 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -1349,6 +1349,14 @@ Agent`), with the plain-language source phrase available through accessiblesystem badge names a platform with its version, source/method context maystill add collection labels such as Pulse Agent, but it must not repeat thesame platform again as an unversioned source badge.+ Proxmox Overview node rows also preserve provider availability explicitly.+ An offline or stale provider observation keeps the node identity, external+ link, detail affordance, and provider-scoped guest counts visible on desktop+ and mobile, while live uptime, temperature, bars, and sparklines render as+ unavailable. The row must expose visible `Offline` or `Stale` text rather+ than relying on an aria-hidden dot or opacity. Same-named cluster and member+ rows use Proxmox instance/platform scope for grouping, search ownership, and+ guest counts; a display label alone is not a cross-provider join key.8. Keep summary chart interaction identity on one shared helper. Summary surfaces that expose row-hover, group-hover, chart-hover, or route-focus-driven chart emphasis must derive page/group/entity scope through `frontend-modern/src/components/shared/summaryCardInteraction.ts` and pass that same resolved scope into card-state, sparkline, and density-map primitives, rather than letting cards read `hovered || focused` while charts listen to a different page-local ID source. Hovering one summary chart must promote that series into the shared active entity so sibling cards highlight the same object instead of keeping chart-local hover islands, and hovering or pinning a workload group header, infrastructure cluster header, or storage pool-group header must scope the matching summary cards through that same shared contract instead of forking a page-local summary filter path. Sibling cards should surface that synchronized hover as one compact header readout through the shared summary-card contract, while the chart under the pointer keeps the only floating tooltip. Recovery is explicitly outside this interaction dialect: its retired posture-card strip must not return with row/group/chart hover behavior without a separate governed product decision.9. Keep page summaries page-scoped when table rows enter contextual focus. Route-backed row selection may add a focused label and shared series emphasis, but infrastructure, workloads, and storage summary cards must continue to render the page-level series set instead of collapsing the summary down to the selected row or replacing the global trend view with row-local empty states.10. Keep contextual row focus on the shared summary primitive. Summary surfaces and same-route table drill-ins must reuse `frontend-modern/src/components/shared/contextualFocus.ts` for interactive-series filtering, focused-name lookup, active-series derivation, local scroll preservation, and deliberate inline-detail reveal instead of rebuilding page-local `Set` filters, focused-label scans, drawer-aware scroll math, or ad hoc scroll restoration in each surface.diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 27afd14f5c..8d37a88de4 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -202,6 +202,21 @@ when the member's effective dial URL is unchanged; a network move resets theold result until the new target is checked. Infrastructure Settings presentsone cluster-level API source while retaining member addresses and theirnode-local Agent evidence.+Proxmox cluster membership is not the `/nodes` telemetry slice. A quorate,+complete `/cluster/status` response is absence-authoritative; members present+there but missing from `/nodes` remain in `models.State` with their stable+identity and last-known linkage while live CPU/uptime is cleared and+connection state is offline or stale. Failed, incomplete, non-quorate, or+cluster-identity-mismatched membership reads retain the last-known+node/endpoint union, break any pending absence sequence, and never advance+deletion. A member absent from a healthy+authoritative membership read is retired only after two consecutive+confirmations; the first omission remains in durable endpoint configuration so+a monitor restart resets the confirmation window rather than converting+uncertainty into removal. A newly reported member is admitted immediately.+Cluster display names are not global identity: config consolidation requires+overlapping endpoint authority, and different provider instances with the same+cluster/member names stay distinct in node and storage identity.## Canonical Filesdiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 19c2a681fd..a504e83215 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -35,6 +35,12 @@ availability-check identity by replaying authoritative supplemental records.That availability composition remains owned by API contracts and unifiedresources; it does not make availability rows recovery points, storage health,backup evidence, or restore authority.+The shared Proxmox config discovery path likewise persists powered-off cluster+members and separates membership from member API reachability. Storage and+recovery consumers may use the resulting provider-scoped node/instance+identity to keep same-named cluster storage distinct, but member retention or+confirmed retirement does not fabricate backup evidence, restore points, or+storage protection state.## Canonical Filesdiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 5c1d1fd392..0b9daa92d2 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -63,6 +63,18 @@ metric object exists, so `/api/resources`, `/api/state`, websocket resources,history, alerts, and UI adapters never need to interpret `null` as either idleor unknown. Unified resources must not infer validity from the numeric guestcompatibility field alone.+Proxmox node inventory continuity is monitoring-authored and+unified-resource-consumed. A powered-off or temporarily unreachable cluster+member must remain one canonical `agent` resource while monitoring still+publishes it, preserving canonical ID, alerts, navigation, history target, and+monitored-system membership with explicit non-fresh source status. Registry+replacement must not emit `resource_removed` merely because live telemetry is+missing; it emits removal only after monitoring's authoritative repeated-+absence reconciliation removes the node from the snapshot. Confirmed removal+then leaves the top-level monitored-system projection exactly once so usage and+licensing do not count a decommissioned member. Proxmox platform consumers must+scope equal cluster labels and node names by provider instance when grouping,+searching, and assigning guests or storage.Physical-disk resources own cross-source disk identity. When Proxmox inventoryand host-agent SMART telemetry describe the same device, the merged resourcemust retain Proxmox node/instance source payloads while carrying SMARTdiff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsxindex 6f5f2f95bf..4a300a5a19 100644--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx@@ -53,8 +53,8 @@ import type { Resource } from '@/types/resource';import { nodeFromResource } from '@/utils/resourceStateAdapters';import {getResourceClusterLabel,- getResourceNodeName,getResourceVersion,+ isProxmoxChildOfNode,} from './proxmoxPageModel';import {getProxmoxHostColumnWidthStyle,@@ -88,10 +88,10 @@ const formatNodeUptime = (seconds: number | undefined): { label: string; warn: btype GuestCounts = { vms: number; containers: number };-const countGuestsForNode = (guests: Resource[], nodeName: string): GuestCounts => {+const countGuestsForNode = (guests: Resource[], node: Resource): GuestCounts => {const counts: GuestCounts = { vms: 0, containers: 0 };for (const guest of guests) {- if (getResourceNodeName(guest) !== nodeName) continue;+ if (!isProxmoxChildOfNode(guest, node)) continue;if (guest.type === 'vm') counts.vms += 1;else if (guest.type === 'system-container' || guest.type === 'oci-container') {counts.containers += 1;@@ -175,9 +175,9 @@ const getHostSortValue = (case 'uptime':return node.uptime ?? null;case 'vms':- return countGuestsForNode(guests, getResourceNodeName(node)).vms;+ return countGuestsForNode(guests, node).vms;case 'cts':- return countGuestsForNode(guests, getResourceNodeName(node)).containers;+ return countGuestsForNode(guests, node).containers;default:key satisfies never;return null;@@ -276,10 +276,31 @@ export const ProxmoxNodesTable: Component<{};const version = () => asTrimmedString(getResourceVersion(node));const cluster = () => getResourceClusterLabel(node);- const counts = () => countGuestsForNode(props.guests, getResourceNodeName(node));+ const counts = () => countGuestsForNode(props.guests, node);const indicator = () => getSimpleStatusIndicator(node.status);- const isOnline = () => indicator().variant === 'success';- const uptime = () => formatNodeUptime(node.uptime);+ const connectionHealth = createMemo(() =>+ (asTrimmedString(node.proxmox?.connectionHealth) ?? '').toLowerCase(),+ );+ const availabilityLabel = createMemo(() => {+ if (node.status === 'offline') return 'Offline';+ // A linked Pulse agent can still prove that a host is online+ // while the Proxmox provider path is unavailable. In that+ // hybrid case the provider metrics are stale, not evidence+ // that the host itself is powered off.+ if (connectionHealth() === 'error' && node.status === 'online') return 'Stale';+ if (connectionHealth() === 'error') return 'Offline';+ if (+ node.status === 'unknown' ||+ connectionHealth() === 'degraded' ||+ connectionHealth() === 'stale'+ ) {+ return 'Stale';+ }+ if (node.status === 'degraded' || node.status === 'warning') return 'Degraded';+ return 'Online';+ });+ const isOnline = createMemo(() => availabilityLabel() === 'Online');+ const uptime = () => formatNodeUptime(isOnline() ? node.uptime : undefined);const metricsKey = () => buildMetricKeyForUnifiedResource(node);const temperature = () => node.temperature;const alertResourceIds = () => hostOverrideIdCandidates(node);@@ -358,6 +379,11 @@ export const ProxmoxNodesTable: Component<{fallbackClass="truncate font-semibold text-base-content"title={`Open ${name()} web interface`}/>+ <Show when={!isOnline()}>+ <span class="rounded bg-surface-alt px-1.5 py-0.5 text-[10px] font-medium text-muted">+ {availabilityLabel()}+ </span>+ </Show><Show when={isOnline() && pendingUpdates() > 0}><spanclass={`rounded px-1 py-0 text-[9px] font-medium whitespace-nowrap ${@@ -398,27 +424,29 @@ export const ProxmoxNodesTable: Component<{case 'cpu':return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}>- <Show- when={isSparklineMode()}- fallback={- <ResponsiveMetricCell- class="w-full"- value={cpuPercent()}- type="cpu"- resourceId={metricsKey()}- isRunning={isOnline()}- showMobile={false}+ <Show when={isOnline()} fallback={<PlatformTableMetricFallback />}>+ <Show+ when={isSparklineMode()}+ fallback={+ <ResponsiveMetricCell+ class="w-full"+ value={cpuPercent()}+ type="cpu"+ resourceId={metricsKey()}+ isRunning+ showMobile={false}+ />+ }+ >+ <MetricMiniSparkline+ series={cpuSeries()}+ valueLabel={formatPlatformTablePercentValue(cpuPercent(), {+ normalizeRatio: true,+ clamp: true,+ })}+ title={`${name()} CPU history`}/>- }- >- <MetricMiniSparkline- series={cpuSeries()}- valueLabel={formatPlatformTablePercentValue(cpuPercent(), {- normalizeRatio: true,- clamp: true,- })}- title={`${name()} CPU history`}- />+ </Show></Show></TableCell>);@@ -426,14 +454,12 @@ export const ProxmoxNodesTable: Component<{return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}><Show- when={isSparklineMode()}- fallback={- <Show- when={- isOnline() && (memoryTotal() > 0 || memoryPercentOnly() != null)- }- fallback={<PlatformTableMetricFallback />}- >+ when={isOnline() && (memoryTotal() > 0 || memoryPercentOnly() != null)}+ fallback={<PlatformTableMetricFallback />}+ >+ <Show+ when={isSparklineMode()}+ fallback={<StackedMemoryBarused={memoryUsed()}total={memoryTotal()}@@ -444,21 +470,21 @@ export const ProxmoxNodesTable: Component<{swapUsed={drawerNode()?.memory?.swapUsed || 0}swapTotal={drawerNode()?.memory?.swapTotal || 0}/>- </Show>- }- >- <MetricMiniSparkline- series={memorySeries()}- valueLabel={- drawerNode()?.memory?.usageUnavailable- ? 'N/A'- : formatPlatformTablePercentValue(memoryPercent(), {- normalizeRatio: true,- clamp: true,- })}- title={`${name()} memory history`}- />+ >+ <MetricMiniSparkline+ series={memorySeries()}+ valueLabel={+ drawerNode()?.memory?.usageUnavailable+ ? 'N/A'+ : formatPlatformTablePercentValue(memoryPercent(), {+ normalizeRatio: true,+ clamp: true,+ })+ }+ title={`${name()} memory history`}+ />+ </Show></Show></TableCell>);@@ -466,12 +492,12 @@ export const ProxmoxNodesTable: Component<{return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}><Show- when={isSparklineMode()}- fallback={- <Show- when={isOnline() && (aggregateDisk() || node.agent?.disks?.length)}- fallback={<PlatformTableMetricFallback />}- >+ when={isOnline() && (aggregateDisk() || node.agent?.disks?.length)}+ fallback={<PlatformTableMetricFallback />}+ >+ <Show+ when={isSparklineMode()}+ fallback={<StackedDiskBarmode={(node.agent?.disks?.length ?? 0) > 1 ? 'vertical-bars' : undefined@@ -479,17 +505,17 @@ export const ProxmoxNodesTable: Component<{disks={normalizeDiskArray(node.agent?.disks)}aggregateDisk={aggregateDisk()}/>- </Show>- }- >- <MetricMiniSparkline- series={diskSeries()}- valueLabel={formatPlatformTablePercentValue(diskPercent(), {- normalizeRatio: true,- clamp: true,- })}- title={`${name()} disk history`}- />+ }+ >+ <MetricMiniSparkline+ series={diskSeries()}+ valueLabel={formatPlatformTablePercentValue(diskPercent(), {+ normalizeRatio: true,+ clamp: true,+ })}+ title={`${name()} disk history`}+ />+ </Show></Show></TableCell>);@@ -497,7 +523,11 @@ export const ProxmoxNodesTable: Component<{return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}><Show- when={typeof temperature() === 'number' && (temperature() as number) > 0}+ when={+ isOnline() &&+ typeof temperature() === 'number' &&+ (temperature() as number) > 0+ }fallback={<span class="text-xs text-muted">—</span>}><TemperatureGauge@@ -510,7 +540,10 @@ export const ProxmoxNodesTable: Component<{case 'vms':return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}>- <span class={counts().vms > 0 ? VMS_BADGE : ZERO_BADGE}>+ <span+ class={counts().vms > 0 ? VMS_BADGE : ZERO_BADGE}+ data-proxmox-vm-count+ >{counts().vms}</span></TableCell>@@ -518,7 +551,10 @@ export const ProxmoxNodesTable: Component<{case 'cts':return (<TableCell class={getPlatformTableCellClassForKind(column.kind)}>- <span class={counts().containers > 0 ? CTS_BADGE : ZERO_BADGE}>+ <span+ class={counts().containers > 0 ? CTS_BADGE : ZERO_BADGE}+ data-proxmox-container-count+ >{counts().containers}</span></TableCell>diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsxindex 740bc95658..8436754283 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx@@ -1,4 +1,5 @@import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { createStore } from 'solid-js/store';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import type { Resource } from '@/types/resource';@@ -242,6 +243,143 @@ describe('ProxmoxNodesTable', () => {const offlineRow = screen.getByText('pve-node-2').closest('tr');expect(offlineRow?.className).toContain('opacity-60');expect(offlineRow).not.toHaveAttribute('data-workload-alert-accent');+ expect(offlineRow).toHaveTextContent('Offline');+ });++ it('labels stale provider telemetry and does not present old metrics as current', () => {+ render(() => (+ <ProxmoxNodesTable+ nodes={[+ makeNodeResource({+ status: 'online',+ uptime: 187_200,+ temperature: 76,+ proxmox: {+ clusterName: 'homelab',+ nodeName: 'pve-node-1',+ connectionHealth: 'degraded',+ },+ }),+ ]}+ guests={[]}+ metricDisplayMode={() => 'sparklines'}+ emptyIcon={<span />}+ emptyTitle="No Proxmox VE nodes"+ emptyDescription="No nodes"+ />+ ));++ const row = screen.getByText('pve-node-1').closest('tr');+ expect(row).toHaveTextContent('Stale');+ expect(row).toHaveTextContent('—');+ expect(row?.className).toContain('opacity-60');+ expect(screen.queryByTestId('metric-mini-sparkline')).not.toBeInTheDocument();+ expect(screen.queryByTestId('temperature-gauge')).not.toBeInTheDocument();+ });++ it('updates every availability signal when a live row becomes offline', () => {+ const [state, setState] = createStore({+ nodes: [makeNodeResource({ uptime: 187_200, temperature: 76 })],+ });++ render(() => (+ <ProxmoxNodesTable+ nodes={state.nodes}+ guests={[]}+ emptyIcon={<span />}+ emptyTitle="No Proxmox VE nodes"+ emptyDescription="No nodes"+ />+ ));++ const row = screen.getByText('pve-node-1').closest('tr');+ expect(row).toHaveTextContent('2d 4h');+ expect(screen.getByTestId('temperature-gauge')).toBeInTheDocument();++ setState('nodes', 0, 'status', 'offline');+ setState('nodes', 0, 'proxmox', 'connectionHealth', 'error');++ expect(row).toHaveTextContent('Offline');+ expect(row).toHaveTextContent('—');+ expect(row).not.toHaveTextContent('2d 4h');+ expect(row?.className).toContain('opacity-60');+ expect(screen.queryByTestId('temperature-gauge')).not.toBeInTheDocument();+ });++ it('treats a live linked agent with an unavailable Proxmox provider as stale, not powered off', () => {+ render(() => (+ <ProxmoxNodesTable+ nodes={[+ makeNodeResource({+ status: 'online',+ uptime: 187_200,+ proxmox: {+ clusterName: 'homelab',+ nodeName: 'pve-node-1',+ connectionHealth: 'error',+ },+ }),+ ]}+ guests={[]}+ emptyIcon={<span />}+ emptyTitle="No Proxmox VE nodes"+ emptyDescription="No nodes"+ />+ ));++ const row = screen.getByText('pve-node-1').closest('tr');+ expect(row).toHaveTextContent('Stale');+ expect(row).not.toHaveTextContent('Offline');+ expect(row).toHaveTextContent('—');+ });++ it('counts same-named-node guests only within the matching provider', () => {+ render(() => (+ <ProxmoxNodesTable+ nodes={[+ makeNodeResource({+ id: 'site-a-node',+ platformId: 'site-a',+ proxmox: {+ instance: 'site-a',+ clusterName: 'production',+ nodeName: 'pve-1',+ },+ }),+ makeNodeResource({+ id: 'site-b-node',+ platformId: 'site-b',+ proxmox: {+ instance: 'site-b',+ clusterName: 'production',+ nodeName: 'pve-1',+ },+ }),+ ]}+ guests={[+ {+ id: 'site-b-vm',+ type: 'vm',+ name: 'site-b-vm',+ displayName: 'site-b-vm',+ platformId: 'site-b',+ platformType: 'proxmox-pve',+ sourceType: 'api',+ status: 'running',+ lastSeen: 1_700_000_000_000,+ proxmox: { instance: 'site-b', nodeName: 'pve-1', vmid: 101 },+ },+ ]}+ emptyIcon={<span />}+ emptyTitle="No Proxmox VE nodes"+ emptyDescription="No nodes"+ />+ ));++ const siteARow = document.querySelector('[data-proxmox-host-row="site-a-node"]');+ const siteBRow = document.querySelector('[data-proxmox-host-row="site-b-node"]');+ expect(siteARow?.querySelector('[data-proxmox-vm-count]')).toHaveTextContent('0');+ expect(siteBRow?.querySelector('[data-proxmox-vm-count]')).toHaveTextContent('1');});it('sorts rows from the column headers with metric columns defaulting to descending', async () => {diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.tsindex e3e709ad7b..79d2ed190d 100644--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts@@ -744,7 +744,7 @@ describe('buildProxmoxPageModel cluster grouping', () => {const model = buildProxmoxPageModel([nodeA, guestOnNode, storageOnNode]);- expect(model.clusterGroups.map((g) => g.id)).toEqual(['cluster-x']);+ expect(model.clusterGroups.map((g) => g.id)).toEqual(['lab::cluster-x']);const group = model.clusterGroups[0];expect(group.nodes.map((r) => r.id)).toEqual(['node-a']);expect(group.guests.map((r) => r.id)).toEqual(['vm-1']);@@ -773,9 +773,9 @@ describe('buildProxmoxPageModel cluster grouping', () => {const model = buildProxmoxPageModel([nodeA, orphanGuest, orphanStorage]);- expect(model.clusterGroups.map((g) => g.id)).toEqual(['cluster-x', '__standalone__']);+ expect(model.clusterGroups.map((g) => g.id)).toEqual(['lab::cluster-x', 'lab::__standalone__']);const standalone = model.clusterGroups[1];- expect(standalone.id).toBe('__standalone__');+ expect(standalone.id).toBe('lab::__standalone__');expect(standalone.label).toBe('Standalone');expect(standalone.nodes).toEqual([]);expect(standalone.guests.map((r) => r.id)).toEqual(['vm-orphan']);@@ -806,6 +806,10 @@ describe('buildProxmoxPageModel cluster grouping', () => {const model = buildProxmoxPageModel([nodeBravo, nodeAlpha, orphanGuest]);expect(model.clusterGroups.map((g) => g.label)).toEqual(['alpha', 'bravo', 'Standalone']);- expect(model.clusterGroups.map((g) => g.id)).toEqual(['alpha', 'bravo', '__standalone__']);+ expect(model.clusterGroups.map((g) => g.id)).toEqual([+ 'lab::alpha',+ 'lab::bravo',+ 'lab::__standalone__',+ ]);});});diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.test.tsindex 3795a117aa..cce2435b53 100644--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.test.ts+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.test.ts@@ -65,6 +65,32 @@ describe('proxmoxPageModel', () => {it('still matches a node by its own name', () => {expect(filterProxmoxNodesForSearch([minipc, delly], [debianGo], 'delly')).toEqual([delly]);});++ it('does not attach a matching guest to a same-named node in another provider', () => {+ const siteANode = makeResource({+ id: 'site-a-node',+ type: 'agent',+ platformId: 'site-a',+ proxmox: { instance: 'site-a', nodeName: 'pve-1', clusterName: 'production' },+ });+ const siteBNode = makeResource({+ id: 'site-b-node',+ type: 'agent',+ platformId: 'site-b',+ proxmox: { instance: 'site-b', nodeName: 'pve-1', clusterName: 'production' },+ });+ const siteBGuest = makeResource({+ id: 'site-b-vm',+ type: 'vm',+ name: 'database-b',+ platformId: 'site-b',+ proxmox: { instance: 'site-b', nodeName: 'pve-1', vmid: 101 },+ });++ expect(+ filterProxmoxNodesForSearch([siteANode, siteBNode], [siteBGuest], 'database-b'),+ ).toEqual([siteBNode]);+ });});it('builds a Proxmox-first estate model from canonical v6 resources', () => {@@ -174,6 +200,49 @@ describe('proxmoxPageModel', () => {expect(buildVisibleProxmoxTabSpecs(model, 0).map((tab) => tab.id)).toEqual(['overview']);});+ it('keeps same-named clusters and nodes isolated by provider identity', () => {+ const model = buildProxmoxPageModel([+ makeResource({+ id: 'site-a-node',+ type: 'agent',+ platformId: 'site-a',+ proxmox: { instance: 'site-a', nodeName: 'pve-1', clusterName: 'production' },+ }),+ makeResource({+ id: 'site-b-node',+ type: 'agent',+ platformId: 'site-b',+ proxmox: { instance: 'site-b', nodeName: 'pve-1', clusterName: 'production' },+ }),+ makeResource({+ id: 'site-a-vm',+ type: 'vm',+ platformId: 'site-a',+ proxmox: { instance: 'site-a', nodeName: 'pve-1', vmid: 101 },+ }),+ makeResource({+ id: 'site-b-vm',+ type: 'vm',+ platformId: 'site-b',+ proxmox: { instance: 'site-b', nodeName: 'pve-1', vmid: 101 },+ }),+ ]);++ expect(model.summary.clusterCount).toBe(2);+ expect(model.clusterGroups).toHaveLength(2);+ expect(model.clusterGroups.map((group) => group.label)).toEqual(['production', 'production']);+ expect(+ model.clusterGroups.map((group) => ({+ id: group.id,+ nodes: group.nodes.map((node) => node.id),+ guests: group.guests.map((guest) => guest.id),+ })),+ ).toEqual([+ { id: 'site-a::production', nodes: ['site-a-node'], guests: ['site-a-vm'] },+ { id: 'site-b::production', nodes: ['site-b-node'], guests: ['site-b-vm'] },+ ]);+ });+it('resolves Proxmox suite scope from canonical platform hints', () => {expect(resolveProxmoxPlatformScope(makeResource({ id: 'pbs', type: 'pbs' }))).toBe('proxmox-pbs',diff --git a/frontend-modern/src/features/proxmox/proxmoxPageModel.ts b/frontend-modern/src/features/proxmox/proxmoxPageModel.tsindex f18ad260cb..3dbf83d5e4 100644--- a/frontend-modern/src/features/proxmox/proxmoxPageModel.ts+++ b/frontend-modern/src/features/proxmox/proxmoxPageModel.ts@@ -170,6 +170,34 @@ export function getResourceNodeName(resource: Resource): string {);}+export function getProxmoxProviderScope(resource: Resource): string {+ return (+ resource.proxmox?.instance ||+ resource.platformId ||+ resource.clusterId ||+ resource.parentId ||+ resource.id+ );+}++const getProxmoxProviderScopes = (resource: Resource): string[] =>+ [resource.proxmox?.instance, resource.platformId, resource.clusterId]+ .filter((scope): scope is string => typeof scope === 'string' && scope.trim().length > 0)+ .map((scope) => scope.trim());++export function isProxmoxChildOfNode(child: Resource, node: Resource): boolean {+ if (child.parentId && child.parentId === node.id) return true;+ if (getResourceNodeName(child) !== getResourceNodeName(node)) return false;++ const childScopes = getProxmoxProviderScopes(child);+ const nodeScopes = new Set(getProxmoxProviderScopes(node));+ return (+ childScopes.length === 0 ||+ nodeScopes.size === 0 ||+ childScopes.some((scope) => nodeScopes.has(scope))+ );+}+// filterProxmoxNodesForSearch narrows the nodes table to match the shared// workload search box. Because that box is a VM/LXC filter, filtering nodes by// the raw term alone collapses the table to its empty state whenever the term@@ -183,15 +211,11 @@ export function filterProxmoxNodesForSearch(term: string,): Resource[] {if (!term.trim()) return nodes;- const matchingGuestNodeNames = new Set(- guests- .filter((guest) => resourceMatchesSearch(guest, term))- .map((guest) => getResourceNodeName(guest))- .filter(Boolean),- );+ const matchingGuests = guests.filter((guest) => resourceMatchesSearch(guest, term));return nodes.filter((node) =>- resourceMatchesSearch(node, term) || matchingGuestNodeNames.has(getResourceNodeName(node)),+ resourceMatchesSearch(node, term) ||+ matchingGuests.some((guest) => isProxmoxChildOfNode(guest, node)),);}@@ -280,8 +304,9 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {const physicalDisks = proxmoxResources.filter((resource) => resource.type === 'physical_disk');const groupsById = new Map<string, ProxmoxClusterGroup>();- const ensureGroup = (label: string): ProxmoxClusterGroup => {- const id = label.toLowerCase() === 'standalone' ? '__standalone__' : label;+ const ensureGroup = (label: string, providerScope: string): ProxmoxClusterGroup => {+ const labelKey = label.toLowerCase() === 'standalone' ? '__standalone__' : label;+ const id = `${providerScope}::${labelKey}`;const existing = groupsById.get(id);if (existing) return existing;const created: ProxmoxClusterGroup = {@@ -295,30 +320,33 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {return created;};- pveNodes.forEach((resource) =>- ensureGroup(getResourceClusterLabel(resource)).nodes.push(resource),- );+ pveNodes.forEach((resource) => {+ ensureGroup(getResourceClusterLabel(resource), getProxmoxProviderScope(resource)).nodes.push(+ resource,+ );+ });guests.forEach((resource) => {- const nodeName = getResourceNodeName(resource);- const owningNode = pveNodes.find((node) => getResourceNodeName(node) === nodeName);+ const owningNode = pveNodes.find((node) => isProxmoxChildOfNode(resource, node));ensureGroup(owningNode ? getResourceClusterLabel(owningNode) : getResourceClusterLabel(resource),+ owningNode ? getProxmoxProviderScope(owningNode) : getProxmoxProviderScope(resource),).guests.push(resource);});storage.forEach((resource) => {- const nodeName = getResourceNodeName(resource);- const owningNode = pveNodes.find((node) => getResourceNodeName(node) === nodeName);+ const owningNode = pveNodes.find((node) => isProxmoxChildOfNode(resource, node));ensureGroup(owningNode ? getResourceClusterLabel(owningNode) : getResourceClusterLabel(resource),+ owningNode ? getProxmoxProviderScope(owningNode) : getProxmoxProviderScope(resource),).storage.push(resource);});const clusterGroups = Array.from(groupsById.values()).sort((a, b) => {- if (a.id === '__standalone__') return 1;- if (b.id === '__standalone__') return -1;- return a.label.localeCompare(b.label);+ const aStandalone = a.label.toLowerCase() === 'standalone';+ const bStandalone = b.label.toLowerCase() === 'standalone';+ if (aStandalone !== bStandalone) return aStandalone ? 1 : -1;+ return a.label.localeCompare(b.label) || a.id.localeCompare(b.id);});const alertCount = proxmoxResources.reduce(@@ -337,7 +365,8 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {physicalDisks,clusterGroups,summary: {- clusterCount: clusterGroups.filter((group) => group.id !== '__standalone__').length,+ clusterCount: clusterGroups.filter((group) => group.label.toLowerCase() !== 'standalone')+ .length,nodeCount: pveNodes.length,guestCount: guests.length,runningGuestCount: guests.filter(diff --git a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.tsindex c6101c2ce5..b7f3ef0b6a 100644--- a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts+++ b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts@@ -814,6 +814,12 @@ describe('useUnifiedResources', () => {proxmox: {nodeName: 'pve1',clusterName: 'cluster-b',+ instance: 'site-a',+ host: 'https://pve1.example:8006',+ guestUrl: 'https://console.example/pve1',+ connectionHealth: 'error',+ pveVersion: '8.4.1',+ kernelVersion: '6.8.12-10-pve',},},],@@ -830,6 +836,17 @@ describe('useUnifiedResources', () => {await result!.refetch();expect(result!.resources()[0]?.clusterId).toBe('cluster-b');+ expect(result!.resources()[0]?.proxmox).toMatchObject({+ node: 'pve1',+ nodeName: 'pve1',+ clusterName: 'cluster-b',+ instance: 'site-a',+ host: 'https://pve1.example:8006',+ guestUrl: 'https://console.example/pve1',+ connectionHealth: 'error',+ pveVersion: '8.4.1',+ kernelVersion: '6.8.12-10-pve',+ });dispose();});diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.tsindex ae044be61a..206fb40d0d 100644--- a/frontend-modern/src/hooks/useUnifiedResources.ts+++ b/frontend-modern/src/hooks/useUnifiedResources.ts@@ -206,6 +206,11 @@ type APIResource = {nodeName?: string;clusterName?: string;instance?: string;+ host?: string;+ guestUrl?: string;+ connectionHealth?: string;+ pveVersion?: string;+ kernelVersion?: string;vmid?: number;cpus?: number;uptime?: number;@@ -789,13 +794,20 @@ const toResource = (v2: APIResource): Resource => {? {vmid: v2.proxmox.vmid,node: v2.proxmox.nodeName,+ nodeName: v2.proxmox.nodeName,instance: v2.proxmox.instance,+ clusterName: v2.proxmox.clusterName,+ host: v2.proxmox.host,+ guestUrl: v2.proxmox.guestUrl,+ connectionHealth: v2.proxmox.connectionHealth,cpus: v2.proxmox.cpus,template: v2.proxmox.template,disks: normalizeDiskArray(v2.proxmox.disks),swapUsed: v2.proxmox.swapUsed,swapTotal: v2.proxmox.swapTotal,balloon: v2.proxmox.balloon,+ pveVersion: v2.proxmox.pveVersion,+ kernelVersion: v2.proxmox.kernelVersion,temperatureDetails: v2.proxmox.temperatureDetails,}: undefined,diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex a2ec334091..a6c9e3dd24 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -656,6 +656,8 @@ export interface ResourceProxmoxMeta {host?: string;/** Operator-set web interface URL override. */guestUrl?: string;+ /** Reachability of the Proxmox API source for this canonical node. */+ connectionHealth?: string;cpus?: number;template?: boolean;disks?: Disk[];diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.goindex 8a2e2ca1f3..55b1816df8 100644--- a/internal/api/config_handlers.go+++ b/internal/api/config_handlers.go@@ -1101,6 +1101,34 @@ func findExistingIPOverride(nodeName string, existingEndpoints []config.ClusterEreturn ""}+func findExistingClusterEndpoint(nodeName string, existingEndpoints []config.ClusterEndpoint) (config.ClusterEndpoint, bool) {+ for _, endpoint := range existingEndpoints {+ if strings.EqualFold(strings.TrimSpace(endpoint.NodeName), strings.TrimSpace(nodeName)) {+ return endpoint, true+ }+ }+ return config.ClusterEndpoint{}, false+}++func retainUnreconciledClusterEndpoints(discovered, existing []config.ClusterEndpoint) []config.ClusterEndpoint {+ seen := make(map[string]struct{}, len(discovered))+ for _, endpoint := range discovered {+ seen[strings.ToLower(strings.TrimSpace(endpoint.NodeName))] = struct{}{}+ }+ for _, endpoint := range existing {+ key := strings.ToLower(strings.TrimSpace(endpoint.NodeName))+ if key == "" {+ continue+ }+ if _, ok := seen[key]; ok {+ continue+ }+ discovered = append(discovered, endpoint)+ seen[key] = struct{}{}+ }+ return discovered+}+// extractIPFromHost extracts the IP address from a host URL.// For example, "https://198.51.100.5:8006" returns 198.51.100.5 as net.IP.func extractIPFromHost(host string) net.IP {@@ -1194,8 +1222,9 @@ func findPreferredIP(interfaces []proxmox.NodeNetworkInterface, referenceIP net.}var (- detectPVECluster = defaultDetectPVECluster- fetchTLSFingerprint = tlsutil.FetchFingerprint+ detectPVECluster = defaultDetectPVECluster+ validatePVEClusterNode = validateNodeAPI+ fetchTLSFingerprint = tlsutil.FetchFingerprint)// detectPVECluster checks if a PVE node is part of a cluster and returns cluster information@@ -1279,32 +1308,49 @@ func defaultDetectPVECluster(clientConfig proxmox.ClientConfig, nodeName string,Msg("Extracted connection IP for network preference")}- var unvalidatedNodes []proxmox.ClusterStatus-+ validatedCount := 0for _, clusterNode := range clusterNodes {- // Validate that this node actually has a working Proxmox API- // This filters out qdevice VMs and other non-Proxmox participants- // Also captures the node's TLS fingerprint for TOFU- isValid, nodeFingerprint := validateNodeAPI(clusterNode, clientConfig)+ // Reachability enriches a member endpoint but never defines cluster+ // membership. Powered-off nodes remain canonical members even+ // though their individual API cannot answer during discovery.+ isValid, nodeFingerprint := validatePVEClusterNode(clusterNode, clientConfig)+ existingEndpoint, hadExistingEndpoint := findExistingClusterEndpoint(clusterNode.Name, existingEndpoints)if !isValid {- log.Debug().+ log.Info().Str("node", clusterNode.Name).Str("ip", clusterNode.IP).- Msg("Skipping cluster node - no valid Proxmox API detected (likely qdevice or external node)")- unvalidatedNodes = append(unvalidatedNodes, clusterNode)- continue+ Msg("Cluster member API is unreachable - preserving membership with unavailable endpoint state")+ } else {+ validatedCount++}// Build the host URL with proper port// Store hostname in Host field (for TLS validation), IP separately+ now := time.Now()+ lastSeen := time.Time{}+ if hadExistingEndpoint {+ lastSeen = existingEndpoint.LastSeen+ }+ if isValid {+ lastSeen = now+ }+ if nodeFingerprint == "" && hadExistingEndpoint {+ nodeFingerprint = existingEndpoint.Fingerprint+ }+ pulseReachable := isValidendpoint := config.ClusterEndpoint{- NodeID: clusterNode.ID,- NodeName: clusterNode.Name,- GuestURL: findExistingGuestURL(clusterNode.Name, existingEndpoints),- IPOverride: findExistingIPOverride(clusterNode.Name, existingEndpoints), // Preserve user override- Fingerprint: nodeFingerprint, // Store captured fingerprint for per-node TLS verification- Online: clusterNode.Online == 1,- LastSeen: time.Now(),+ NodeID: clusterNode.ID,+ NodeName: clusterNode.Name,+ GuestURL: findExistingGuestURL(clusterNode.Name, existingEndpoints),+ IPOverride: findExistingIPOverride(clusterNode.Name, existingEndpoints), // Preserve user override+ Fingerprint: nodeFingerprint, // Store captured fingerprint for per-node TLS verification+ Online: clusterNode.Online == 1,+ LastSeen: lastSeen,+ PulseReachable: &pulseReachable,+ LastPulseCheck: &now,+ }+ if !isValid {+ endpoint.PulseError = "Proxmox API endpoint unavailable during cluster discovery"}// Populate Host field with hostname (if available) for TLS certificate validation@@ -1352,76 +1398,17 @@ func defaultDetectPVECluster(clientConfig proxmox.ClientConfig, nodeName string,clusterEndpoints = append(clusterEndpoints, endpoint)}- if len(clusterEndpoints) == 0 && len(unvalidatedNodes) > 0 {- log.Warn().- Str("cluster", clusterName).- Int("total_discovered", len(unvalidatedNodes)).- Msg("All detected cluster nodes failed validation; falling back to cluster metadata")-- for _, clusterNode := range unvalidatedNodes {- if clusterNode.Name == "" && clusterNode.IP == "" {- continue- }-- endpoint := config.ClusterEndpoint{- NodeID: clusterNode.ID,- NodeName: clusterNode.Name,- GuestURL: findExistingGuestURL(clusterNode.Name, existingEndpoints),- Online: clusterNode.Online == 1,- LastSeen: time.Now(),- }-- // Populate Host field with hostname (if available) for TLS certificate validation- if clusterNode.Name != "" {- nodeHost := ensureHostHasPort(clusterNode.Name, defaultPort)- endpoint.Host = schemePrefix + nodeHost- }-- // Populate IP field separately for DNS-free connections- if clusterNode.IP != "" {- endpoint.IP = clusterNode.IP- }-- // Apply subnet preference even in fallback path (refs #929)- // Node validation may have failed because cluster-reported IPs are on internal- // network, but we can still query node interfaces via the initial connection- if connectionIP != nil && clusterNode.IP != "" && clusterNode.Name != "" {- clusterIP := net.ParseIP(clusterNode.IP)- if clusterIP != nil && !ipsOnSameNetwork(clusterIP, connectionIP) {- // Cluster IP is on a different network, try to find one on the same network- ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)- nodeInterfaces, err := tempClient.GetNodeNetworkInterfaces(ctx, clusterNode.Name)- cancel()-- if err == nil {- preferredIP := findPreferredIP(nodeInterfaces, connectionIP)- if preferredIP != "" && preferredIP != clusterNode.IP {- log.Info().- Str("node", clusterNode.Name).- Str("cluster_ip", clusterNode.IP).- Str("preferred_ip", preferredIP).- Str("connection_ip", connectionIP.String()).- Msg("Found preferred management IP for unvalidated cluster node")- endpoint.IPOverride = preferredIP- }- } else {- log.Debug().- Err(err).- Str("node", clusterNode.Name).- Msg("Could not query node network interfaces in fallback path")- }- }- }-- clusterEndpoints = append(clusterEndpoints, endpoint)- }- }+ // Configuration discovery can add or enrich membership, but it has no+ // repeated-absence reconciliation state and therefore cannot safely+ // retire an existing member. Monitoring owns confirmed removal.+ clusterEndpoints = retainUnreconciledClusterEndpoints(clusterEndpoints, existingEndpoints)- // Log the final count of valid Proxmox nodes found+ // Membership count and reachable API count are deliberately separate.log.Info().Str("cluster", clusterName).Int("total_discovered", len(clusterNodes)).- Int("valid_proxmox_nodes", len(clusterEndpoints)).+ Int("persisted_members", len(clusterEndpoints)).+ Int("reachable_api_endpoints", validatedCount).Msg("Cluster node validation complete")// Fallback if we couldn't get the cluster namediff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex c9e420a4fc..f8859d1fae 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -56,6 +56,7 @@ import (pkglicensing "github.com/rcourtman/pulse-go-rewrite/pkg/licensing"licensetestsupport "github.com/rcourtman/pulse-go-rewrite/pkg/licensing/testsupport""github.com/rcourtman/pulse-go-rewrite/pkg/metrics"+ "github.com/rcourtman/pulse-go-rewrite/pkg/proxmox""github.com/rcourtman/pulse-go-rewrite/pkg/reporting""github.com/rs/zerolog"tmock "github.com/stretchr/testify/mock"@@ -94,6 +95,81 @@ func TestContract_AgentVersionResponsePreventsStaleReconciliation(t *testing.T)}}+func TestContract_DefaultDetectPVEClusterRetainsUnreachableMembers(t *testing.T) {+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.URL.Path != "/api2/json/cluster/status" {+ http.NotFound(w, r)+ return+ }+ w.Header().Set("Content-Type", "application/json")+ _ = json.NewEncoder(w).Encode(map[string]interface{}{+ "data": []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 1},+ {Type: "node", ID: "node/a", Name: "pve-a", IP: "127.0.0.1", Online: 1},+ {Type: "node", ID: "node/b", Name: "pve-b", IP: "127.0.0.1", Online: 0},+ },+ })+ }))+ defer server.Close()++ originalValidate := validatePVEClusterNode+ t.Cleanup(func() { validatePVEClusterNode = originalValidate })+ validatePVEClusterNode = func(node proxmox.ClusterStatus, _ proxmox.ClientConfig) (bool, string) {+ if node.Name == "pve-a" {+ return true, "fingerprint-a"+ }+ return false, ""+ }+ lastSeen := time.Now().Add(-time.Hour).UTC()++ isCluster, clusterName, endpoints := defaultDetectPVECluster(+ proxmox.ClientConfig{+ Host: server.URL,+ TokenName: "root@pam!pulse",+ TokenValue: "secret",+ Timeout: time.Second,+ },+ "pve-a",+ []config.ClusterEndpoint{{+ NodeName: "pve-b",+ GuestURL: "https://guest.example/pve-b",+ Fingerprint: "fingerprint-b",+ LastSeen: lastSeen,+ }, {+ NodeName: "pve-c",+ Host: "https://pve-c:8006",+ LastSeen: lastSeen.Add(-time.Hour),+ }},+ )+ if !isCluster || clusterName != "production" {+ t.Fatalf("cluster detection = (%v, %q), want (true, production)", isCluster, clusterName)+ }+ if len(endpoints) != 3 {+ t.Fatalf("cluster endpoints = %d, want 2 observed plus 1 pending reconciliation: %+v", len(endpoints), endpoints)+ }+ var offline config.ClusterEndpoint+ for _, endpoint := range endpoints {+ if endpoint.NodeName == "pve-b" {+ offline = endpoint+ break+ }+ }+ if offline.NodeName == "" {+ t.Fatalf("powered-off member missing from cluster endpoints: %+v", endpoints)+ }+ if offline.Online || offline.PulseReachable == nil || *offline.PulseReachable {+ t.Fatalf("powered-off member reachability is not honest: %+v", offline)+ }+ if offline.Fingerprint != "fingerprint-b" || offline.GuestURL != "https://guest.example/pve-b" || !offline.LastSeen.Equal(lastSeen) {+ t.Fatalf("powered-off member lost last-known endpoint evidence: %+v", offline)+ }+ if pending, ok := findExistingClusterEndpoint("pve-c", endpoints); !ok ||+ pending.Host != "https://pve-c:8006" ||+ !pending.LastSeen.Equal(lastSeen.Add(-time.Hour)) {+ t.Fatalf("partially omitted endpoint was deleted before monitor reconciliation: %+v", endpoints)+ }+}+func TestContract_OperationalTrustAttentionActionOfferJSONIsAdditiveAndTyped(t *testing.T) {payload, err := json.Marshal(ai.AttentionActionOffer{ActionID: "action-1",diff --git a/internal/config/pve_instances.go b/internal/config/pve_instances.goindex 931f006dff..3cb862084a 100644--- a/internal/config/pve_instances.go+++ b/internal/config/pve_instances.go@@ -9,7 +9,8 @@ import ()// ConsolidatePVEInstances canonicalizes PVE instance configuration by:-// - merging duplicate cluster definitions with the same ClusterName+// - merging duplicate cluster definitions only when the same ClusterName is+// backed by overlapping endpoint identity// - removing standalone instances whose endpoint is already represented by// a unique cluster endpoint//@@ -20,8 +21,7 @@ func ConsolidatePVEInstances(instances []PVEInstance) ([]PVEInstance, bool) {}working := clonePVEInstances(instances)- changed := mergeDuplicateClusterInstances(working)- working = dedupeClusterInstances(working)+ working, changed := mergeDuplicateClusterInstances(working)standaloneMerged := mergeStandalonePVEIntoClusters(working)if standaloneMerged {@@ -47,35 +47,39 @@ func clonePVEInstances(instances []PVEInstance) []PVEInstance {return out}-func mergeDuplicateClusterInstances(instances []PVEInstance) bool {- clusterGroups := make(map[string][]int)- for i, instance := range instances {- if instance.IsCluster && strings.TrimSpace(instance.ClusterName) != "" {- clusterGroups[strings.TrimSpace(instance.ClusterName)] = append(clusterGroups[strings.TrimSpace(instance.ClusterName)], i)- }- }-+func mergeDuplicateClusterInstances(instances []PVEInstance) ([]PVEInstance, bool) {+ removed := make(map[int]struct{})mergedAny := false- for clusterName, indices := range clusterGroups {- if len(indices) < 2 {+ for primaryIdx := range instances {+ if _, skip := removed[primaryIdx]; skip {+ continue+ }+ if !instances[primaryIdx].IsCluster || strings.TrimSpace(instances[primaryIdx].ClusterName) == "" {continue}-- log.Warn().- Str("cluster", clusterName).- Int("duplicates", len(indices)).- Msg("Detected duplicate cluster instances - consolidating")-- primaryIdx := indices[0]primary := &instances[primaryIdx]-existingEndpoints := make(map[string]int)for idx, ep := range primary.ClusterEndpoints {existingEndpoints[strings.TrimSpace(strings.ToLower(ep.NodeName))] = idx}- for _, dupIdx := range indices[1:] {+ for dupIdx := primaryIdx + 1; dupIdx < len(instances); dupIdx++ {+ if _, skip := removed[dupIdx]; skip {+ continue+ }duplicate := instances[dupIdx]+ if !duplicate.IsCluster ||+ !strings.EqualFold(strings.TrimSpace(primary.ClusterName), strings.TrimSpace(duplicate.ClusterName)) ||+ !pveClusterInstancesHaveStrongOverlap(*primary, duplicate) {+ continue+ }++ clusterName := strings.TrimSpace(primary.ClusterName)+ log.Warn().+ Str("cluster", clusterName).+ Str("primary", primary.Name).+ Str("duplicate", duplicate.Name).+ Msg("Detected duplicate cluster instances with overlapping endpoints - consolidating")log.Info().Str("cluster", clusterName).Str("primary", primary.Name).@@ -97,12 +101,21 @@ func mergeDuplicateClusterInstances(instances []PVEInstance) bool {Str("endpoint", ep.NodeName).Msg("Added endpoint from duplicate cluster instance")}+ removed[dupIdx] = struct{}{}+ mergedAny = true}-- mergedAny = true}-- return mergedAny+ if !mergedAny {+ return instances, false+ }+ out := make([]PVEInstance, 0, len(instances)-len(removed))+ for idx, instance := range instances {+ if _, skip := removed[idx]; skip {+ continue+ }+ out = append(out, instance)+ }+ return out, true}func mergeClusterEndpointData(dst *ClusterEndpoint, src ClusterEndpoint) {@@ -211,28 +224,6 @@ func mergePVEInstanceData(dst *PVEInstance, src PVEInstance) {}}-func dedupeClusterInstances(instances []PVEInstance) []PVEInstance {- out := make([]PVEInstance, 0, len(instances))- seenClusters := make(map[string]bool)-- for _, instance := range instances {- clusterName := strings.TrimSpace(instance.ClusterName)- if instance.IsCluster && clusterName != "" {- if seenClusters[clusterName] {- log.Info().- Str("cluster", clusterName).- Str("instance", instance.Name).- Msg("Removing duplicate cluster instance")- continue- }- seenClusters[clusterName] = true- }- out = append(out, instance)- }-- return out-}-func normalizePVEEndpointIdentity(raw string) string {value := strings.TrimSpace(raw)if value == "" {@@ -264,6 +255,55 @@ func normalizePVEEndpointIdentity(raw string) string {return net.JoinHostPort(host, port)}+func pveInstanceEndpointIdentityKeys(instance PVEInstance) map[string]struct{} {+ keys := make(map[string]struct{}, 1+len(instance.ClusterEndpoints)*3)+ if key := normalizePVEEndpointIdentity(instance.Host); key != "" {+ keys[key] = struct{}{}+ }+ for _, endpoint := range instance.ClusterEndpoints {+ for _, raw := range []string{endpoint.IP, endpoint.IPOverride} {+ if key := normalizePVEEndpointIdentity(raw); key != "" {+ keys[key] = struct{}{}+ }+ }+ // Cluster discovery commonly synthesizes endpoint.Host from the raw+ // member name. Equal node names such as "pve-1" are not identity+ // evidence across two clusters with the same display name. A literal+ // endpoint IP is strong enough to compare; named endpoint hosts are+ // deliberately ignored unless they are the operator-saved instance+ // authority above.+ if endpointHost := endpointHostIdentityIP(endpoint.Host); endpointHost != "" {+ keys[endpointHost] = struct{}{}+ }+ }+ return keys+}++func endpointHostIdentityIP(raw string) string {+ key := normalizePVEEndpointIdentity(raw)+ if key == "" {+ return ""+ }+ host, _, err := net.SplitHostPort(key)+ if err != nil || net.ParseIP(host) == nil {+ return ""+ }+ return key+}++func pveClusterInstancesHaveStrongOverlap(a, b PVEInstance) bool {+ aKeys := pveInstanceEndpointIdentityKeys(a)+ if len(aKeys) == 0 {+ return false+ }+ for key := range pveInstanceEndpointIdentityKeys(b) {+ if _, ok := aKeys[key]; ok {+ return true+ }+ }+ return false+}+func clusterEndpointIdentityKeys(endpoint ClusterEndpoint) []string {keys := make([]string, 0, 3)if key := normalizePVEEndpointIdentity(endpoint.Host); key != "" {diff --git a/internal/config/pve_instances_test.go b/internal/config/pve_instances_test.goindex 047f9fff76..dbd0fbf7b8 100644--- a/internal/config/pve_instances_test.go+++ b/internal/config/pve_instances_test.go@@ -4,8 +4,8 @@ import "testing"func TestConsolidatePVEInstancesMergesDuplicateClusters(t *testing.T) {instances, changed := ConsolidatePVEInstances([]PVEInstance{- {Name: "c1", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []ClusterEndpoint{{NodeName: "n1"}}},- {Name: "c2", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []ClusterEndpoint{{NodeName: "n2"}}},+ {Name: "c1", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []ClusterEndpoint{{NodeName: "n1", Host: "https://10.0.0.1:8006"}}},+ {Name: "c2", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []ClusterEndpoint{{NodeName: "n1", Host: "https://10.0.0.1:8006"}, {NodeName: "n2", Host: "https://10.0.0.2:8006"}}},{Name: "c3", ClusterName: "cluster-B", IsCluster: true},})@@ -20,6 +20,34 @@ func TestConsolidatePVEInstancesMergesDuplicateClusters(t *testing.T) {}}+func TestConsolidatePVEInstancesKeepsDistinctClustersWithSameName(t *testing.T) {+ instances, changed := ConsolidatePVEInstances([]PVEInstance{+ {+ Name: "site-a",+ ClusterName: "production",+ IsCluster: true,+ ClusterEndpoints: []ClusterEndpoint{+ {NodeName: "pve1", Host: "https://pve1:8006", IP: "10.0.0.1"},+ },+ },+ {+ Name: "site-b",+ ClusterName: "production",+ IsCluster: true,+ ClusterEndpoints: []ClusterEndpoint{+ {NodeName: "pve1", Host: "https://pve1:8006", IP: "10.1.0.1"},+ },+ },+ })++ if changed {+ t.Fatalf("distinct same-name clusters must not be consolidated")+ }+ if len(instances) != 2 {+ t.Fatalf("instances = %d, want 2 distinct clusters", len(instances))+ }+}+func TestConsolidatePVEInstancesRemovesStandaloneCoveredByClusterEndpoint(t *testing.T) {instances, changed := ConsolidatePVEInstances([]PVEInstance{{@@ -147,6 +175,7 @@ func TestConsolidatePVEInstancesMergesDuplicateClusterAuthIntoPrimary(t *testingFingerprint: "fp-1",VerifySSL: true,ClusterEndpoints: []ClusterEndpoint{+ {NodeName: "n1", Host: "https://10.0.0.5:8006"},{NodeName: "n2", Host: "https://10.0.0.6:8006"},},},diff --git a/internal/models/models.go b/internal/models/models.goindex d092acb87b..87cccf6ba0 100644--- a/internal/models/models.go+++ b/internal/models/models.go@@ -3340,6 +3340,13 @@ func nodeLogicalKey(node Node) string {}if cluster := normalizeNodeIdentityPart(node.ClusterName); cluster != "" {+ // Cluster names are display labels, not globally unique provider+ // identities. Scope the primary key by connection instance and allow+ // the stronger endpoint/link aliases below to merge duplicate views of+ // the same physical node.+ if instance := normalizeNodeIdentityPart(node.Instance); instance != "" {+ return "cluster:" + cluster + ":instance:" + instance + ":" + name+ }return "cluster:" + cluster + ":" + name}if instance := normalizeNodeIdentityPart(node.Instance); instance != "" {@@ -3374,13 +3381,24 @@ func registerNodeAliases(}}-// nodeClusterIdentityConflicts reports whether two nodes belong to two-// different named clusters. Empty cluster names never conflict: a standalone-// or not-yet-classified view of a node may still merge into its cluster view.-func nodeClusterIdentityConflicts(a, b string) bool {- clusterA := normalizeNodeIdentityPart(a)- clusterB := normalizeNodeIdentityPart(b)- return clusterA != "" && clusterB != "" && clusterA != clusterB+// nodeProviderIdentityConflicts reports whether two classified cluster nodes+// belong to different provider scopes. Cluster names are display labels and+// can legitimately repeat; two non-empty connection instances therefore stay+// distinct even when the label and member hostname are identical. Empty+// cluster identity still permits a standalone/not-yet-classified view to merge+// into its canonical cluster view by stronger endpoint or linked-agent proof.+func nodeProviderIdentityConflicts(a, b Node) bool {+ clusterA := normalizeNodeIdentityPart(a.ClusterName)+ clusterB := normalizeNodeIdentityPart(b.ClusterName)+ if clusterA == "" || clusterB == "" {+ return false+ }+ if clusterA != clusterB {+ return true+ }+ instanceA := normalizeNodeIdentityPart(a.Instance)+ instanceB := normalizeNodeIdentityPart(b.Instance)+ return instanceA != "" && instanceB != "" && instanceA != instanceB}func resolveNodeMergeKey(@@ -3409,7 +3427,7 @@ func resolveNodeMergeKey(// Two clusters can reuse node names (pve01 in cluster A and cluster B),// so an endpoint alias is only trustworthy when the cluster identities// don't contradict each other.- if existing, exists := nodeMap[key]; exists && nodeClusterIdentityConflicts(existing.ClusterName, node.ClusterName) {+ if existing, exists := nodeMap[key]; exists && nodeProviderIdentityConflicts(existing, node) {continue}if resolved != "" && resolved != key {@@ -3777,7 +3795,7 @@ func (s *State) UpdateNodesForInstance(instanceName string, nodes []Node) {if linkedKey := linkedHostToKey[node.LinkedAgentID]; linkedKey != "" {// A shared agent identity must never collapse two different// named clusters into one node slot.- if existing, ok := nodeMap[linkedKey]; !ok || !nodeClusterIdentityConflicts(existing.ClusterName, node.ClusterName) {+ if existing, ok := nodeMap[linkedKey]; !ok || !nodeProviderIdentityConflicts(existing, node) {targetKey = linkedKey}}diff --git a/internal/models/state_additional_test.go b/internal/models/state_additional_test.goindex e67618acff..399d2eb999 100644--- a/internal/models/state_additional_test.go+++ b/internal/models/state_additional_test.go@@ -523,50 +523,6 @@ func TestUpdateNodesForInstanceDeduplicatesLogicalNodeByClusterName(t *testing.T}}-func TestUpdateNodesForInstancePrefersHealthyOnCrossInstanceClusterCollisionDifferentIDs(t *testing.T) {- now := time.Now()- state := &State{- Nodes: []Node{- {- ID: "node-from-b",- Name: "pve01",- Instance: "instance-b",- ClusterName: "cluster-a",- IsClusterMember: true,- Status: "online",- ConnectionHealth: "healthy",- LastSeen: now,- },- },- }-- state.UpdateNodesForInstance("instance-a", []Node{- {- ID: "node-from-a",- Name: "pve01",- Instance: "instance-a",- ClusterName: "cluster-a",- IsClusterMember: true,- Status: "unknown",- ConnectionHealth: "unknown",- LastSeen: now.Add(-time.Minute),- },- })-- if len(state.Nodes) != 1 {- t.Fatalf("nodes = %#v, want exactly one merged node", state.Nodes)- }- if state.Nodes[0].ID != "node-from-b" {- t.Fatalf("node id = %q, want node-from-b", state.Nodes[0].ID)- }- if state.Nodes[0].Instance != "instance-b" {- t.Fatalf("instance = %q, want instance-b", state.Nodes[0].Instance)- }- if state.Nodes[0].Status != "online" {- t.Fatalf("status = %q, want online", state.Nodes[0].Status)- }-}-func TestStateLinkHostAgentToNode(t *testing.T) {state := &State{Hosts: []Host{diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.goindex eb5f6b603d..a105904f6d 100644--- a/internal/monitoring/monitor.go+++ b/internal/monitoring/monitor.go@@ -1172,6 +1172,7 @@ type Monitor struct {dlqInsightMap map[string]*dlqInsightnodeLastOnline map[string]time.Time // Track last time each node was seen online (for grace period)nodePendingUpdatesCache map[string]pendingUpdatesCache // Cache pending updates per node (checked every 30 min)+ pveMembershipMisses map[string]int // Consecutive authoritative membership absences by instance/noderesourceStore ResourceStoreInterface // Optional unified resource store for polling optimizationsupplementalProviders map[unifiedresources.DataSource]MonitorSupplementalRecordsProviderrecoveryManager *recoverymanager.Manager // Optional recovery store manager for backup rollups@@ -1796,6 +1797,7 @@ func New(cfg *config.Config) (*Monitor, error) {dlqInsightMap: make(map[string]*dlqInsight),nodeLastOnline: make(map[string]time.Time),nodePendingUpdatesCache: make(map[string]pendingUpdatesCache),+ pveMembershipMisses: make(map[string]int),supplementalProviders: make(map[unifiedresources.DataSource]MonitorSupplementalRecordsProvider),}diff --git a/internal/monitoring/monitor_cluster_dedupe.go b/internal/monitoring/monitor_cluster_dedupe.goindex 8694cebd05..122e37e161 100644--- a/internal/monitoring/monitor_cluster_dedupe.go+++ b/internal/monitoring/monitor_cluster_dedupe.go@@ -110,6 +110,11 @@ func (m *Monitor) retirePVEInstanceRuntime(instanceName string) {delete(m.nodePendingUpdatesCache, nodeID)}}+ for membershipKey := range m.pveMembershipMisses {+ if strings.HasPrefix(membershipKey, strings.ToLower(strings.TrimSpace(instanceName))+"\x00") {+ delete(m.pveMembershipMisses, membershipKey)+ }+ }m.mu.Unlock()m.diagMu.Lock()diff --git a/internal/monitoring/monitor_extra_coverage_test.go b/internal/monitoring/monitor_extra_coverage_test.goindex 2f49adcf1f..76c4da1dfa 100644--- a/internal/monitoring/monitor_extra_coverage_test.go+++ b/internal/monitoring/monitor_extra_coverage_test.go@@ -204,8 +204,8 @@ func TestMonitor_ConsolidateDuplicateClusters_Extra(t *testing.T) {m := &Monitor{config: &config.Config{PVEInstances: []config.PVEInstance{- {Name: "c1", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []config.ClusterEndpoint{{NodeName: "n1"}}},- {Name: "c2", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []config.ClusterEndpoint{{NodeName: "n2"}}},+ {Name: "c1", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []config.ClusterEndpoint{{NodeName: "n1", Host: "https://10.0.0.1:8006"}}},+ {Name: "c2", ClusterName: "cluster-A", IsCluster: true, ClusterEndpoints: []config.ClusterEndpoint{{NodeName: "n1", Host: "https://10.0.0.1:8006"}, {NodeName: "n2", Host: "https://10.0.0.2:8006"}}},{Name: "c3", ClusterName: "cluster-B", IsCluster: true},},},diff --git a/internal/monitoring/monitor_host_agents_test.go b/internal/monitoring/monitor_host_agents_test.goindex 7d6f3a1855..3962bab1b5 100644--- a/internal/monitoring/monitor_host_agents_test.go+++ b/internal/monitoring/monitor_host_agents_test.go@@ -47,6 +47,52 @@ func TestMonitoringBroadcastCarriesEveryAvailabilityProjection(t *testing.T) {}}+func TestHostAgentCorrelationKeepsSameNamedProxmoxProvidersDistinct(t *testing.T) {+ now := time.Now()+ state := &models.State{+ Nodes: []models.Node{+ {+ ID: "node-from-b",+ Name: "pve01",+ Instance: "instance-b",+ ClusterName: "cluster-a",+ IsClusterMember: true,+ Host: "https://pve01:8006",+ LinkedAgentID: "shared-agent-id",+ Status: "online",+ ConnectionHealth: "healthy",+ LastSeen: now,+ },+ },+ }++ state.UpdateNodesForInstance("instance-a", []models.Node{+ {+ ID: "node-from-a",+ Name: "pve01",+ Instance: "instance-a",+ ClusterName: "cluster-a",+ IsClusterMember: true,+ Host: "https://pve01:8006",+ LinkedAgentID: "shared-agent-id",+ Status: "unknown",+ ConnectionHealth: "unknown",+ LastSeen: now.Add(-time.Minute),+ },+ })++ if len(state.Nodes) != 2 {+ t.Fatalf("nodes = %#v, want one node per provider instance", state.Nodes)+ }+ byInstance := make(map[string]models.Node, len(state.Nodes))+ for _, node := range state.Nodes {+ byInstance[node.Instance] = node+ }+ if byInstance["instance-a"].ID != "node-from-a" || byInstance["instance-b"].ID != "node-from-b" {+ t.Fatalf("nodes = %#v, want stable instance-scoped identities", state.Nodes)+ }+}+func TestNormalizeAgentMemoryCacheAwareFallbacks(t *testing.T) {const gib = int64(1024 * 1024 * 1024)diff --git a/internal/monitoring/monitor_polling_node_helpers.go b/internal/monitoring/monitor_polling_node_helpers.goindex b275f5e65f..3b32de71dd 100644--- a/internal/monitoring/monitor_polling_node_helpers.go+++ b/internal/monitoring/monitor_polling_node_helpers.go@@ -36,15 +36,12 @@ func resolveNodeConnectionInfo(instanceCfg *config.PVEInstance, discoveryCfg confunc (m *Monitor) determineNodeIDAndStatus(instanceName string, instanceCfg *config.PVEInstance, node proxmox.Node) (string, string) {// Apply grace period for node status to prevent flapping- // For clustered nodes, use clusterName-nodeName as the ID to deduplicate- // when the same cluster is registered via multiple entry points- // (e.g., agent installed with --enable-proxmox on multiple cluster nodes)- var nodeID string- if instanceCfg.IsCluster && instanceCfg.ClusterName != "" {- nodeID = instanceCfg.ClusterName + "-" + node.Node- } else {- nodeID = instanceName + "-" + node.Node- }+ // The configured instance is the canonical provider identity. Normally a+ // cluster name remains the stable scope used by earlier Pulse releases,+ // but two unrelated clusters are allowed to share that display name. In+ // that ambiguous case the instance name prevents cross-cluster resource+ // collisions without churning IDs for established unambiguous clusters.+ nodeID := m.pveNodeIdentityScope(instanceName, instanceCfg) + "-" + node.NodeeffectiveStatus := node.Statusnow := time.Now()gracePeriod := m.pveNodeOfflineGracePeriod()diff --git a/internal/monitoring/monitor_polling_storage.go b/internal/monitoring/monitor_polling_storage.goindex 22b8bcd2dd..fc30b0d30e 100644--- a/internal/monitoring/monitor_polling_storage.go+++ b/internal/monitoring/monitor_polling_storage.go@@ -156,7 +156,7 @@ func (m *Monitor) pollStorageWithNodes(ctx context.Context, instanceName string,// This must match what is set in each storage item's Instance fieldstorageInstanceName := instanceNameif instanceCfg != nil && instanceCfg.IsCluster && instanceCfg.ClusterName != "" {- storageInstanceName = instanceCfg.ClusterName+ storageInstanceName = m.pveNodeIdentityScope(instanceName, instanceCfg)}// Get cluster storage configuration first (single call)diff --git a/internal/monitoring/monitor_pve.go b/internal/monitoring/monitor_pve.goindex 9c2bbdcea7..2aeefae1a1 100644--- a/internal/monitoring/monitor_pve.go+++ b/internal/monitoring/monitor_pve.go@@ -634,22 +634,6 @@ func (m *Monitor) pollPVENodesParallel(return modelNodes, nodeEffectiveStatus, nodeDiskSources}-func (m *Monitor) preserveNodesWhenEmpty(instanceName string, modelNodes []models.Node, prevInstanceNodes []models.Node) []models.Node {- if len(modelNodes) > 0 || len(prevInstanceNodes) == 0 {- return modelNodes- }-- log.Warn().- Str("instance", instanceName).- Int("previousCount", len(prevInstanceNodes)).- Msg("No Proxmox nodes returned this cycle - preserving previous state")-- // Mark connection health as degraded to reflect polling failure- m.setProviderConnectionHealth(InstanceTypePVE, instanceName, false)-- return m.preserveOrExpireNodes(prevInstanceNodes)-}-// markPVEInstanceNodesUnreachable applies the node offline grace policy to an// instance whose poll failed outright (connection refused, timeout, all// cluster endpoints down). Without this, the early return on a poll error@@ -671,41 +655,34 @@ func (m *Monitor) markPVEInstanceNodesUnreachable(instanceName string) {m.state.UpdateNodesForInstance(instanceName, m.preserveOrExpireNodes(prevInstanceNodes))}-// placeholderNodesForInstance builds offline node entries from the instance-// configuration for an instance with no node state yet. Cluster configs carry-// their discovered member endpoints, so each member gets its own row with the-// same node ID a live poll would assign; a standalone instance gets a single-// row named after the configured instance. The next successful poll replaces-// these wholesale via UpdateNodesForInstance.+func (m *Monitor) placeholderNodeForInstance(instanceName string, instanceCfg *config.PVEInstance, nodeName string) models.Node {+ nodeID := m.pveNodeIdentityScope(instanceName, instanceCfg) + "-" + nodeName+ connectionHost, guestURL := resolveNodeConnectionInfo(instanceCfg, monitorDiscoveryConfig(m), nodeName)+ return models.Node{+ ID: nodeID,+ Name: nodeName,+ DisplayName: getNodeDisplayName(instanceCfg, nodeName),+ Instance: instanceName,+ Host: connectionHost,+ GuestURL: guestURL,+ Status: "offline",+ Type: "node",+ ConnectionHealth: "error",+ LoadAverage: []float64{},+ IsClusterMember: instanceCfg.IsCluster,+ ClusterName: instanceCfg.ClusterName,+ TemperatureMonitoringEnabled: instanceCfg.TemperatureMonitoringEnabled,+ }+}++// placeholderNodesForInstance builds offline node entries from the durable+// instance configuration when no live or cached node state is available.func (m *Monitor) placeholderNodesForInstance(instanceName string) []models.Node {instanceCfg := m.getInstanceConfig(instanceName)if instanceCfg == nil {return nil}- makeNode := func(nodeName string) models.Node {- nodeID := instanceName + "-" + nodeName- if instanceCfg.IsCluster && instanceCfg.ClusterName != "" {- nodeID = instanceCfg.ClusterName + "-" + nodeName- }- connectionHost, guestURL := resolveNodeConnectionInfo(instanceCfg, monitorDiscoveryConfig(m), nodeName)- return models.Node{- ID: nodeID,- Name: nodeName,- DisplayName: getNodeDisplayName(instanceCfg, nodeName),- Instance: instanceName,- Host: connectionHost,- GuestURL: guestURL,- Status: "offline",- Type: "node",- ConnectionHealth: "error",- LoadAverage: []float64{},- IsClusterMember: instanceCfg.IsCluster,- ClusterName: instanceCfg.ClusterName,- TemperatureMonitoringEnabled: instanceCfg.TemperatureMonitoringEnabled,- }- }-if instanceCfg.IsCluster && len(instanceCfg.ClusterEndpoints) > 0 {nodes := make([]models.Node, 0, len(instanceCfg.ClusterEndpoints))seen := make(map[string]struct{}, len(instanceCfg.ClusterEndpoints))@@ -718,7 +695,7 @@ func (m *Monitor) placeholderNodesForInstance(instanceName string) []models.Nodecontinue}seen[strings.ToLower(nodeName)] = struct{}{}- nodes = append(nodes, makeNode(nodeName))+ nodes = append(nodes, m.placeholderNodeForInstance(instanceName, instanceCfg, nodeName))}if len(nodes) > 0 {return nodes@@ -729,7 +706,7 @@ func (m *Monitor) placeholderNodesForInstance(instanceName string) []models.Nodeif nodeName == "" {nodeName = instanceName}- return []models.Node{makeNode(nodeName)}+ return []models.Node{m.placeholderNodeForInstance(instanceName, instanceCfg, nodeName)}}// preserveOrExpireNodes keeps recently seen nodes online through transient@@ -1437,7 +1414,19 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, cliedebugEnabled,)- modelNodes = m.preserveNodesWhenEmpty(instanceName, modelNodes, prevInstanceNodes)+ modelNodes = m.reconcilePVENodeInventory(+ ctx,+ instanceName,+ instanceCfg,+ client,+ modelNodes,+ prevInstanceNodes,+ )+ for _, node := range modelNodes {+ if _, observed := nodeEffectiveStatus[node.Name]; !observed {+ nodeEffectiveStatus[node.Name] = node.Status+ }+ }// Update state first so we have nodes availablem.state.UpdateNodesForInstance(instanceName, modelNodes)diff --git a/internal/monitoring/monitor_pve_cluster.go b/internal/monitoring/monitor_pve_cluster.goindex 771e20a0c4..76ec65699b 100644--- a/internal/monitoring/monitor_pve_cluster.go+++ b/internal/monitoring/monitor_pve_cluster.go@@ -4,6 +4,7 @@ import ("context""net""net/url"+ "sort""strings""time"@@ -15,6 +16,437 @@ import (var detectMonitorPVECluster = defaultDetectMonitorPVECluster+type pveClusterStatusGetter interface {+ GetClusterStatus(context.Context) ([]proxmox.ClusterStatus, error)+}++const pveMembershipRemovalConfirmations = 2++// pveNodeIdentityScope preserves the historical cluster-name node identity+// while it is unambiguous. If two configured clusters share a display name,+// the provider instance becomes the identity scope so unrelated nodes cannot+// collide in state, history, navigation, or resource projection.+func (m *Monitor) pveNodeIdentityScope(instanceName string, instanceCfg *config.PVEInstance) string {+ instanceName = strings.TrimSpace(instanceName)+ if instanceCfg == nil || !instanceCfg.IsCluster || strings.TrimSpace(instanceCfg.ClusterName) == "" {+ return instanceName+ }++ clusterName := strings.TrimSpace(instanceCfg.ClusterName)+ m.mu.RLock()+ defer m.mu.RUnlock()+ if m.config != nil {+ matches := 0+ for i := range m.config.PVEInstances {+ cfg := &m.config.PVEInstances[i]+ if cfg.IsCluster && strings.EqualFold(strings.TrimSpace(cfg.ClusterName), clusterName) {+ matches+++ if matches > 1 {+ return instanceName+ }+ }+ }+ }+ return clusterName+}++func clusterMembershipFromStatus(statuses []proxmox.ClusterStatus) (string, map[string]proxmox.ClusterStatus, bool) {+ clusterName := ""+ members := make(map[string]proxmox.ClusterStatus)+ for _, status := range statuses {+ switch strings.ToLower(strings.TrimSpace(status.Type)) {+ case "cluster":+ if clusterName == "" {+ clusterName = strings.TrimSpace(status.Name)+ if clusterName == "" {+ clusterName = strings.TrimSpace(status.ID)+ }+ }+ case "node":+ name := strings.TrimSpace(status.Name)+ if name != "" {+ members[strings.ToLower(name)] = status+ }+ }+ }+ return clusterName, members, clusterName != "" && len(members) > 0+}++func clusterMembershipRemovalAuthoritative(statuses []proxmox.ClusterStatus) bool {+ for _, status := range statuses {+ if strings.EqualFold(strings.TrimSpace(status.Type), "cluster") {+ return status.Quorate == 1+ }+ }+ return false+}++func clusterEndpointsFromStatus(+ clientConfig proxmox.ClientConfig,+ existing []config.ClusterEndpoint,+ statuses []proxmox.ClusterStatus,+) (string, []config.ClusterEndpoint, bool) {+ clusterName, members, authoritative := clusterMembershipFromStatus(statuses)+ if !authoritative {+ return "", nil, false+ }++ scheme, port := monitorClusterEndpointDefaults(clientConfig.Host)+ endpoints := make([]config.ClusterEndpoint, 0, len(members))+ for _, clusterNode := range members {+ lastSeen := time.Time{}+ for _, endpoint := range existing {+ if strings.EqualFold(strings.TrimSpace(endpoint.NodeName), strings.TrimSpace(clusterNode.Name)) {+ lastSeen = endpoint.LastSeen+ break+ }+ }+ if clusterNode.Online == 1 {+ lastSeen = time.Now()+ }+ endpoints = append(endpoints, config.ClusterEndpoint{+ NodeID: clusterNode.ID,+ NodeName: clusterNode.Name,+ Host: monitorBuildClusterEndpointHost(scheme, clusterNode.Name, port),+ IP: strings.TrimSpace(clusterNode.IP),+ GuestURL: monitorExistingClusterGuestURL(clusterNode.Name, existing),+ IPOverride: monitorExistingClusterIPOverride(clusterNode.Name, existing),+ Fingerprint: monitorExistingClusterFingerprint(clusterNode.Name, existing),+ Online: clusterNode.Online == 1,+ LastSeen: lastSeen,+ })+ }+ sort.Slice(endpoints, func(i, j int) bool {+ return strings.ToLower(endpoints[i].NodeName) < strings.ToLower(endpoints[j].NodeName)+ })+ return clusterName, endpoints, true+}++func pveNodeByName(nodes []models.Node) map[string]models.Node {+ byName := make(map[string]models.Node, len(nodes))+ for _, node := range nodes {+ name := strings.ToLower(strings.TrimSpace(node.Name))+ if name == "" {+ continue+ }+ if existing, ok := byName[name]; ok {+ byName[name] = preferNodeForInventory(existing, node)+ continue+ }+ byName[name] = node+ }+ return byName+}++func preferNodeForInventory(existing, candidate models.Node) models.Node {+ if strings.EqualFold(candidate.Status, "online") && !strings.EqualFold(existing.Status, "online") {+ return candidate+ }+ if candidate.LastSeen.After(existing.LastSeen) {+ return candidate+ }+ return existing+}++func pveMembershipMissKey(instanceName, nodeName string) string {+ return strings.ToLower(strings.TrimSpace(instanceName)) + "\x00" + strings.ToLower(strings.TrimSpace(nodeName))+}++func (m *Monitor) clearPVEMembershipMisses(instanceName string) {+ prefix := strings.ToLower(strings.TrimSpace(instanceName)) + "\x00"+ m.mu.Lock()+ for key := range m.pveMembershipMisses {+ if strings.HasPrefix(key, prefix) {+ delete(m.pveMembershipMisses, key)+ }+ }+ m.mu.Unlock()+}++// confirmPVEMembershipRemovals requires two consecutive successful,+// absence-authoritative membership reads before a last-known member is+// retired. Ordinary telemetry omissions and failed membership reads never+// advance this counter. The durable endpoint remains in config until the+// second confirmation, so a restart safely resets the in-memory confirmation+// window instead of turning uncertainty into deletion.+func (m *Monitor) confirmPVEMembershipRemovals(+ instanceName string,+ authoritative map[string]proxmox.ClusterStatus,+ current,+ previous []models.Node,+ instanceCfg *config.PVEInstance,+) (map[string]proxmox.ClusterStatus, map[string]struct{}) {+ effective := make(map[string]proxmox.ClusterStatus, len(authoritative))+ for key, member := range authoritative {+ effective[key] = member+ }++ candidates := pveNodeByName(current)+ for key, node := range pveNodeByName(previous) {+ if _, exists := candidates[key]; !exists {+ candidates[key] = node+ }+ }+ if instanceCfg != nil {+ for _, endpoint := range instanceCfg.ClusterEndpoints {+ name := strings.TrimSpace(endpoint.NodeName)+ key := strings.ToLower(name)+ if key == "" {+ continue+ }+ if _, exists := candidates[key]; !exists {+ candidates[key] = m.placeholderNodeForInstance(instanceName, instanceCfg, name)+ }+ }+ }++ pending := make(map[string]struct{})+ m.mu.Lock()+ if m.pveMembershipMisses == nil {+ m.pveMembershipMisses = make(map[string]int)+ }+ for key := range authoritative {+ delete(m.pveMembershipMisses, pveMembershipMissKey(instanceName, key))+ }+ for key, node := range candidates {+ if _, present := authoritative[key]; present {+ continue+ }+ missKey := pveMembershipMissKey(instanceName, key)+ m.pveMembershipMisses[missKey]+++ if m.pveMembershipMisses[missKey] >= pveMembershipRemovalConfirmations {+ delete(m.pveMembershipMisses, missKey)+ continue+ }+ online := 0+ if strings.EqualFold(strings.TrimSpace(node.Status), "online") {+ online = 1+ }+ effective[key] = proxmox.ClusterStatus{+ Type: "node",+ Name: node.Name,+ Online: online,+ }+ pending[key] = struct{}{}+ }+ m.mu.Unlock()+ return effective, pending+}++func retainPendingClusterEndpoints(+ discovered,+ existing []config.ClusterEndpoint,+ current,+ previous []models.Node,+ pending map[string]struct{},+) []config.ClusterEndpoint {+ if len(pending) == 0 {+ return discovered+ }+ byName := make(map[string]config.ClusterEndpoint, len(discovered)+len(pending))+ for _, endpoint := range discovered {+ byName[strings.ToLower(strings.TrimSpace(endpoint.NodeName))] = endpoint+ }+ for _, endpoint := range existing {+ key := strings.ToLower(strings.TrimSpace(endpoint.NodeName))+ if _, keep := pending[key]; keep {+ byName[key] = endpoint+ }+ }+ for key, node := range pveNodeByName(append(append([]models.Node{}, current...), previous...)) {+ if _, keep := pending[key]; !keep {+ continue+ }+ if _, exists := byName[key]; exists {+ continue+ }+ byName[key] = config.ClusterEndpoint{+ NodeName: node.Name,+ Host: node.Host,+ Online: strings.EqualFold(strings.TrimSpace(node.Status), "online"),+ LastSeen: node.LastSeen,+ }+ }+ out := make([]config.ClusterEndpoint, 0, len(byName))+ for _, endpoint := range byName {+ out = append(out, endpoint)+ }+ sort.Slice(out, func(i, j int) bool {+ return strings.ToLower(out[i].NodeName) < strings.ToLower(out[j].NodeName)+ })+ return out+}++func (m *Monitor) reconcileUncertainPVENodeInventory(+ instanceName string,+ instanceCfg *config.PVEInstance,+ current,+ previous []models.Node,+) []models.Node {+ reconciled := pveNodeByName(current)+ missingPrevious := make([]models.Node, 0, len(previous))+ for _, node := range previous {+ name := strings.ToLower(strings.TrimSpace(node.Name))+ if name == "" {+ continue+ }+ if _, present := reconciled[name]; present {+ continue+ }+ missingPrevious = append(missingPrevious, node)+ }+ for _, node := range m.preserveOrExpireNodes(missingPrevious) {+ reconciled[strings.ToLower(strings.TrimSpace(node.Name))] = node+ }+ if instanceCfg != nil {+ for _, endpoint := range instanceCfg.ClusterEndpoints {+ name := strings.TrimSpace(endpoint.NodeName)+ key := strings.ToLower(name)+ if name == "" {+ continue+ }+ if _, present := reconciled[key]; present {+ continue+ }+ reconciled[key] = m.placeholderNodeForInstance(instanceName, instanceCfg, name)+ }+ }+ return sortedPVENodeInventory(reconciled)+}++func sortedPVENodeInventory(nodes map[string]models.Node) []models.Node {+ out := make([]models.Node, 0, len(nodes))+ for _, node := range nodes {+ out = append(out, node)+ }+ sort.Slice(out, func(i, j int) bool {+ left := strings.ToLower(strings.TrimSpace(out[i].Name))+ right := strings.ToLower(strings.TrimSpace(out[j].Name))+ if left == right {+ return out[i].ID < out[j].ID+ }+ return left < right+ })+ return out+}++// reconcilePVENodeInventory separates membership from telemetry. /nodes is a+// live metrics snapshot and may be partial when a member is powered off or one+// endpoint is unreachable. A valid /cluster/status response is the only+// absence-authoritative membership source; otherwise Pulse preserves the+// durable endpoint/last-known union with honest offline or unknown state.+func (m *Monitor) reconcilePVENodeInventory(+ ctx context.Context,+ instanceName string,+ instanceCfg *config.PVEInstance,+ client PVEClientInterface,+ current,+ previous []models.Node,+) []models.Node {+ if instanceCfg == nil || !instanceCfg.IsCluster {+ if len(current) > 0 || len(previous) == 0 {+ return current+ }+ m.setProviderConnectionHealth(InstanceTypePVE, instanceName, false)+ return m.preserveOrExpireNodes(previous)+ }+ if len(current) == 0 {+ m.setProviderConnectionHealth(InstanceTypePVE, instanceName, false)+ }++ getter, ok := client.(pveClusterStatusGetter)+ if !ok {+ m.clearPVEMembershipMisses(instanceName)+ return m.reconcileUncertainPVENodeInventory(instanceName, instanceCfg, current, previous)+ }+ statuses, err := getter.GetClusterStatus(ctx)+ if err != nil {+ m.clearPVEMembershipMisses(instanceName)+ log.Warn().+ Err(err).+ Str("instance", instanceName).+ Msg("Cluster membership unavailable - retaining last-known Proxmox nodes")+ return m.reconcileUncertainPVENodeInventory(instanceName, instanceCfg, current, previous)+ }+ if !clusterMembershipRemovalAuthoritative(statuses) {+ m.clearPVEMembershipMisses(instanceName)+ log.Warn().+ Str("instance", instanceName).+ Msg("Cluster membership is not quorate - retaining last-known Proxmox nodes")+ return m.reconcileUncertainPVENodeInventory(instanceName, instanceCfg, current, previous)+ }+ clusterName, members, authoritative := clusterMembershipFromStatus(statuses)+ if !authoritative {+ m.clearPVEMembershipMisses(instanceName)+ log.Warn().+ Str("instance", instanceName).+ Msg("Cluster membership response incomplete - retaining last-known Proxmox nodes")+ return m.reconcileUncertainPVENodeInventory(instanceName, instanceCfg, current, previous)+ }+ if configuredName := strings.TrimSpace(instanceCfg.ClusterName); configuredName != "" &&+ !strings.EqualFold(configuredName, clusterName) {+ m.clearPVEMembershipMisses(instanceName)+ log.Warn().+ Str("instance", instanceName).+ Str("configuredCluster", configuredName).+ Str("observedCluster", clusterName).+ Msg("Cluster identity changed during membership read - retaining last-known Proxmox nodes")+ return m.reconcileUncertainPVENodeInventory(instanceName, instanceCfg, current, previous)+ }+ members, pendingRemovals := m.confirmPVEMembershipRemovals(+ instanceName,+ members,+ current,+ previous,+ instanceCfg,+ )++ if discoveredName, endpoints, ok := clusterEndpointsFromStatus(config.CreateProxmoxConfig(instanceCfg), instanceCfg.ClusterEndpoints, statuses); ok {+ endpoints = retainPendingClusterEndpoints(+ endpoints,+ instanceCfg.ClusterEndpoints,+ current,+ previous,+ pendingRemovals,+ )+ m.refreshClusterEndpoints(instanceName, instanceCfg, discoveredName, endpoints)+ }++ currentByName := pveNodeByName(current)+ previousByName := pveNodeByName(previous)+ reconciled := make(map[string]models.Node, len(members))+ for key, membership := range members {+ node, present := currentByName[key]+ if !present {+ node, present = previousByName[key]+ }+ if !present {+ node = m.placeholderNodeForInstance(instanceName, instanceCfg, membership.Name)+ }++ if membership.Online == 0 {+ node.Status = "offline"+ node.ConnectionHealth = "error"+ node.CPU = 0+ node.Uptime = 0+ } else if _, observed := currentByName[key]; !observed {+ node.Status = "unknown"+ node.ConnectionHealth = "degraded"+ node.CPU = 0+ node.Uptime = 0+ }+ reconciled[key] = node+ }++ log.Info().+ Str("instance", instanceName).+ Str("cluster", clusterName).+ Int("observedNodes", len(current)).+ Int("membershipNodes", len(reconciled)).+ Msg("Reconciled Proxmox node telemetry against authoritative cluster membership")+ return sortedPVENodeInventory(reconciled)+}+func (m *Monitor) detectClusterMembership(ctx context.Context, instanceName string, instanceCfg *config.PVEInstance, client PVEClientInterface) {_ = client@@ -292,38 +724,11 @@ func defaultDetectMonitorPVECluster(clientConfig proxmox.ClientConfig, existingEreturn false, "", nil}- clusterName := ""- clusterNodes := make([]proxmox.ClusterStatus, 0, len(clusterStatus))- for _, status := range clusterStatus {- switch status.Type {- case "cluster":- clusterName = strings.TrimSpace(status.Name)- case "node":- clusterNodes = append(clusterNodes, status)- }- }- if len(clusterNodes) <= 1 || clusterName == "" {+ clusterName, clusterEndpoints, authoritative := clusterEndpointsFromStatus(clientConfig, existingEndpoints, clusterStatus)+ if !authoritative || len(clusterEndpoints) <= 1 {return false, "", nil}-- scheme, port := monitorClusterEndpointDefaults(clientConfig.Host)- endpoints := make([]config.ClusterEndpoint, 0, len(clusterNodes))- for _, clusterNode := range clusterNodes {- endpoint := config.ClusterEndpoint{- NodeID: clusterNode.ID,- NodeName: clusterNode.Name,- Host: monitorBuildClusterEndpointHost(scheme, clusterNode.Name, port),- IP: strings.TrimSpace(clusterNode.IP),- GuestURL: monitorExistingClusterGuestURL(clusterNode.Name, existingEndpoints),- IPOverride: monitorExistingClusterIPOverride(clusterNode.Name, existingEndpoints),- Fingerprint: monitorExistingClusterFingerprint(clusterNode.Name, existingEndpoints),- Online: clusterNode.Online == 1,- LastSeen: time.Now(),- }- endpoints = append(endpoints, endpoint)- }-- return true, clusterName, endpoints+ return true, clusterName, clusterEndpoints}func monitorClusterEndpointDefaults(rawHost string) (string, string) {diff --git a/internal/monitoring/monitor_pve_cluster_refresh_test.go b/internal/monitoring/monitor_pve_cluster_refresh_test.goindex 649cff8fb8..87d4737596 100644--- a/internal/monitoring/monitor_pve_cluster_refresh_test.go+++ b/internal/monitoring/monitor_pve_cluster_refresh_test.go@@ -2,6 +2,7 @@ package monitoringimport ("context"+ "fmt""testing""time"@@ -116,6 +117,95 @@ func TestDetectClusterMembership_NoRefreshWhenEndpointsUnchanged(t *testing.T) {}}+func TestReconcilePVENodeInventoryRequiresRepeatedAuthoritativeRemoval(t *testing.T) {+ cfg := &config.Config{PVEInstances: []config.PVEInstance{{+ Name: "cluster-api",+ Host: "https://pve-a:8006",+ IsCluster: true,+ ClusterName: "production",+ ClusterEndpoints: []config.ClusterEndpoint{+ {NodeName: "pve-a", Host: "https://pve-a:8006"},+ {NodeName: "pve-b", Host: "https://pve-b:8006"},+ },+ }}}+ m := newUnreachableTestMonitor(t, cfg)+ previous := []models.Node{+ {ID: "production-pve-a", Name: "pve-a", Instance: "cluster-api", Status: "online", LastSeen: time.Now()},+ {ID: "production-pve-b", Name: "pve-b", Instance: "cluster-api", Status: "offline"},+ }+ client := &membershipPVEClient{statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 1},+ {Type: "node", ID: "node/a", Name: "pve-a", Online: 1},+ }}++ first := m.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ client,+ previous[:1],+ previous,+ )+ if len(first) != 2 || len(cfg.PVEInstances[0].ClusterEndpoints) != 2 {+ t.Fatalf("first authoritative omission retired node: nodes=%+v endpoints=%+v", first, cfg.PVEInstances[0].ClusterEndpoints)+ }++ // A process restart resets the volatile confirmation counter while the+ // durable endpoint keeps the member visible.+ restarted := newUnreachableTestMonitor(t, cfg)+ afterRestart := restarted.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ client,+ first[:1],+ first,+ )+ if len(afterRestart) != 2 {+ t.Fatalf("restart converted one omission into removal: %+v", afterRestart)+ }++ // An uncertain read breaks the consecutive authoritative sequence.+ uncertain := restarted.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ &membershipPVEClient{statusErr: fmt.Errorf("temporary membership failure")},+ afterRestart[:1],+ afterRestart,+ )+ if len(uncertain) != 2 {+ t.Fatalf("uncertain read retired pending member: %+v", uncertain)+ }++ firstAfterUncertain := restarted.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ client,+ uncertain[:1],+ uncertain,+ )+ if len(firstAfterUncertain) != 2 {+ t.Fatalf("first absence after uncertainty retired member: %+v", firstAfterUncertain)+ }++ confirmed := restarted.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ client,+ firstAfterUncertain[:1],+ firstAfterUncertain,+ )+ if len(confirmed) != 1 || confirmed[0].Name != "pve-a" {+ t.Fatalf("confirmed removal = %+v, want only pve-a", confirmed)+ }+ if len(cfg.PVEInstances[0].ClusterEndpoints) != 1 || cfg.PVEInstances[0].ClusterEndpoints[0].NodeName != "pve-a" {+ t.Fatalf("confirmed removal did not reconcile durable endpoints: %+v", cfg.PVEInstances[0].ClusterEndpoints)+ }+}+func TestMergeRefreshedClusterEndpoints_InheritsMissingFields(t *testing.T) {reachable := truechecked := time.Now().Add(-time.Minute)diff --git a/internal/monitoring/monitor_pve_unreachable_test.go b/internal/monitoring/monitor_pve_unreachable_test.goindex b959291426..176617cdd3 100644--- a/internal/monitoring/monitor_pve_unreachable_test.go+++ b/internal/monitoring/monitor_pve_unreachable_test.go@@ -96,6 +96,16 @@ func (c *unreachablePVEClient) GetNodes(ctx context.Context) ([]proxmox.Node, erreturn nil, fmt.Errorf("connection refused")}+type membershipPVEClient struct {+ stubPVEClient+ statuses []proxmox.ClusterStatus+ statusErr error+}++func (c *membershipPVEClient) GetClusterStatus(context.Context) ([]proxmox.ClusterStatus, error) {+ return c.statuses, c.statusErr+}+func newUnreachableTestMonitor(t *testing.T, cfg *config.Config) *Monitor {t.Helper()m := &Monitor{@@ -241,3 +251,207 @@ func TestPlaceholderNodesForInstanceCluster(t *testing.T) {}}}++func TestReconcilePVENodeInventoryPreservesCanonicalMembership(t *testing.T) {+ lastSeen := time.Now().Add(-2 * time.Hour).UTC()+ cfg := &config.Config{+ PVEInstances: []config.PVEInstance{{+ Name: "cluster-api",+ Host: "https://pve-a:8006",+ IsCluster: true,+ ClusterName: "production",+ ClusterEndpoints: []config.ClusterEndpoint{+ {NodeID: "node/a", NodeName: "pve-a", Host: "https://pve-a:8006", Online: true, LastSeen: lastSeen},+ {NodeID: "node/b", NodeName: "pve-b", Host: "https://pve-b:8006", Online: true, LastSeen: lastSeen},+ },+ }},+ }+ m := newUnreachableTestMonitor(t, cfg)+ instanceCfg := &cfg.PVEInstances[0]+ client := &membershipPVEClient{statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 1},+ {Type: "node", ID: "node/a", Name: "pve-a", Online: 1},+ {Type: "node", ID: "node/b", Name: "pve-b", Online: 0},+ }}+ previous := []models.Node{+ {+ ID: "production-pve-a",+ Name: "pve-a",+ Instance: "cluster-api",+ ClusterName: "production",+ Status: "online",+ ConnectionHealth: "healthy",+ LastSeen: lastSeen,+ },+ {+ ID: "production-pve-b",+ Name: "pve-b",+ Instance: "cluster-api",+ ClusterName: "production",+ Host: "https://pve-b:8006",+ Status: "online",+ ConnectionHealth: "healthy",+ CPU: 0.8,+ Uptime: 3600,+ LastSeen: lastSeen,+ LinkedAgentID: "agent-pve-b",+ },+ }+ current := []models.Node{previous[0]}++ got := m.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ instanceCfg,+ client,+ current,+ previous,+ )+ if len(got) != 2 {+ t.Fatalf("reconciled nodes = %d, want 2: %+v", len(got), got)+ }+ byName := pveNodeByName(got)+ offline := byName["pve-b"]+ if offline.ID != "production-pve-b" {+ t.Fatalf("offline node ID = %q, want stable canonical ID", offline.ID)+ }+ if offline.Status != "offline" || offline.ConnectionHealth != "error" {+ t.Fatalf("offline node state = (%q, %q), want offline/error", offline.Status, offline.ConnectionHealth)+ }+ if offline.CPU != 0 || offline.Uptime != 0 {+ t.Fatalf("offline node live metrics = (cpu=%v uptime=%d), want zeroed", offline.CPU, offline.Uptime)+ }+ if !offline.LastSeen.Equal(lastSeen) || offline.LinkedAgentID != "agent-pve-b" {+ t.Fatalf("offline node lost last-known identity evidence: %+v", offline)+ }+ if len(instanceCfg.ClusterEndpoints) != 2 {+ t.Fatalf("cluster endpoints = %d, want 2 canonical members", len(instanceCfg.ClusterEndpoints))+ }+}++func TestReconcilePVENodeInventoryTreatsPartialAndNonQuorateReadsAsUncertain(t *testing.T) {+ tests := []struct {+ name string+ statuses []proxmox.ClusterStatus+ statusErr error+ }{+ {+ name: "membership API unavailable",+ statusErr: fmt.Errorf("temporary connection failure"),+ },+ {+ name: "membership response incomplete",+ statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 1},+ },+ },+ {+ name: "cluster has no quorum",+ statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 0},+ {Type: "node", Name: "pve-a", Online: 1},+ },+ },+ {+ name: "cluster identity changed",+ statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "different-cluster", Quorate: 1},+ {Type: "node", Name: "pve-a", Online: 1},+ },+ },+ }+ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ cfg := &config.Config{PVEInstances: []config.PVEInstance{{+ Name: "cluster-api",+ IsCluster: true,+ ClusterName: "production",+ ClusterEndpoints: []config.ClusterEndpoint{+ {NodeName: "pve-a"},+ {NodeName: "pve-b"},+ },+ }}}+ m := newUnreachableTestMonitor(t, cfg)+ previous := []models.Node{+ {ID: "production-pve-a", Name: "pve-a", Instance: "cluster-api", Status: "online", LastSeen: time.Now()},+ {ID: "production-pve-b", Name: "pve-b", Instance: "cluster-api", Status: "offline"},+ }+ got := m.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ &membershipPVEClient{statuses: tt.statuses, statusErr: tt.statusErr},+ previous[:1],+ previous,+ )+ if len(got) != 2 {+ t.Fatalf("uncertain membership returned %d nodes, want last-known union: %+v", len(got), got)+ }+ if got[1].Name != "pve-b" || got[1].Status != "offline" {+ t.Fatalf("unobserved member = %+v, want pve-b retained offline", got[1])+ }+ if len(cfg.PVEInstances[0].ClusterEndpoints) != 2 {+ t.Fatalf("uncertain membership rewrote endpoints: %+v", cfg.PVEInstances[0].ClusterEndpoints)+ }+ })+ }+}++func TestReconcilePVENodeInventoryAddsNewAuthoritativeMemberImmediately(t *testing.T) {+ cfg := &config.Config{PVEInstances: []config.PVEInstance{{+ Name: "cluster-api",+ Host: "https://pve-a:8006",+ IsCluster: true,+ ClusterName: "production",+ ClusterEndpoints: []config.ClusterEndpoint{+ {NodeName: "pve-a", Host: "https://pve-a:8006"},+ },+ }}}+ m := newUnreachableTestMonitor(t, cfg)+ previous := []models.Node{{+ ID: "production-pve-a",+ Name: "pve-a",+ Instance: "cluster-api",+ ClusterName: "production",+ Status: "online",+ LastSeen: time.Now(),+ }}+ client := &membershipPVEClient{statuses: []proxmox.ClusterStatus{+ {Type: "cluster", Name: "production", Quorate: 1},+ {Type: "node", ID: "node/a", Name: "pve-a", Online: 1},+ {Type: "node", ID: "node/c", Name: "pve-c", IP: "10.0.0.3", Online: 1},+ }}++ got := m.reconcilePVENodeInventory(+ context.Background(),+ "cluster-api",+ &cfg.PVEInstances[0],+ client,+ previous,+ previous,+ )+ if len(got) != 2 {+ t.Fatalf("membership addition returned %d nodes, want 2: %+v", len(got), got)+ }+ added := pveNodeByName(got)["pve-c"]+ if added.ID != "production-pve-c" || added.Status != "unknown" || added.ConnectionHealth != "degraded" {+ t.Fatalf("new member = %+v, want immediate stable unknown/degraded placeholder", added)+ }+ if len(cfg.PVEInstances[0].ClusterEndpoints) != 2 {+ t.Fatalf("new member was not persisted to endpoints: %+v", cfg.PVEInstances[0].ClusterEndpoints)+ }+}++func TestPVENodeIdentityScopeSeparatesSameNameClusters(t *testing.T) {+ cfg := &config.Config{PVEInstances: []config.PVEInstance{+ {Name: "site-a", IsCluster: true, ClusterName: "production"},+ {Name: "site-b", IsCluster: true, ClusterName: "production"},+ }}+ m := &Monitor{config: cfg, state: models.NewState()}++ a := m.placeholderNodeForInstance("site-a", &cfg.PVEInstances[0], "pve-1")+ b := m.placeholderNodeForInstance("site-b", &cfg.PVEInstances[1], "pve-1")+ if a.ID != "site-a-pve-1" || b.ID != "site-b-pve-1" || a.ID == b.ID {+ t.Fatalf("same-name cluster node IDs collided: a=%q b=%q", a.ID, b.ID)+ }+}diff --git a/internal/unifiedresources/adapters.go b/internal/unifiedresources/adapters.goindex 2986fa30b9..c21c1b9f5b 100644--- a/internal/unifiedresources/adapters.go+++ b/internal/unifiedresources/adapters.go@@ -24,7 +24,7 @@ func resourceFromProxmoxNode(node models.Node, linkedHost *models.Host) (ResourcendpointHost := extractHostname(node.Host)identity := ResourceIdentity{Hostnames: uniqueStrings([]string{node.Name}),- ClusterName: node.ClusterName,+ ClusterName: proxmoxNodeIdentityClusterName(node),}if endpointHost != "" {if parsed := net.ParseIP(endpointHost); parsed != nil {@@ -91,6 +91,29 @@ func resourceFromProxmoxNode(node models.Node, linkedHost *models.Host) (Resourcreturn resource, identity}+// proxmoxNodeIdentityClusterName keeps the historical cluster+hostname+// canonical identity while that pair is unambiguous. Monitoring switches a+// node's source ID to instance+hostname when equal cluster display names exist.+// In that case the display label is not a safe generic identity key, so the+// registry falls back to the unique Proxmox source ID unless a linked agent+// contributes stronger machine identity.+func proxmoxNodeIdentityClusterName(node models.Node) string {+ clusterName := strings.TrimSpace(node.ClusterName)+ instance := strings.TrimSpace(node.Instance)+ nodeName := strings.TrimSpace(node.Name)+ if instance == "" || nodeName == "" || strings.EqualFold(instance, clusterName) {+ return clusterName+ }+ if strings.EqualFold(strings.TrimSpace(node.ID), proxmoxNodeSourceID(instance, nodeName)) {+ return ""+ }+ return clusterName+}++func proxmoxNodeUsesProviderScopedIdentity(node models.Node) bool {+ return strings.TrimSpace(node.ClusterName) != "" && proxmoxNodeIdentityClusterName(node) == ""+}+func identityFromHost(host models.Host) ResourceIdentity {ips, macs := collectInterfaceIDs(host.NetworkInterfaces)if host.ReportIP != "" {diff --git a/internal/unifiedresources/monitor_adapter_read_state_test.go b/internal/unifiedresources/monitor_adapter_read_state_test.goindex 4ae8722cc2..61f06c8f48 100644--- a/internal/unifiedresources/monitor_adapter_read_state_test.go+++ b/internal/unifiedresources/monitor_adapter_read_state_test.go@@ -379,6 +379,9 @@ func TestMonitorAdapterRecordsSupplementalChangeTimeline(t *testing.T) {t.Fatalf("expected 1 resource after initial ingest, got %d", len(resources))}resourceID := resources[0].ID+ if got := MonitoredSystemCount(adapter); got != 1 {+ t.Fatalf("initial monitored-system count = %d, want 1", got)+ }changes, err := store.GetRecentChanges(resourceID, time.Time{}, 10)if err != nil {@@ -415,6 +418,85 @@ func TestMonitorAdapterRecordsSupplementalChangeTimeline(t *testing.T) {}}+func TestMonitorAdapterKeepsOfflineProxmoxMemberWithoutRemovalChurn(t *testing.T) {+ store := NewMemoryStore()+ adapter := NewMonitorAdapter(NewRegistry(store))+ seen := time.Date(2026, 7, 24, 8, 0, 0, 0, time.UTC)+ node := models.Node{+ ID: "production-pve-b",+ Name: "pve-b",+ Instance: "cluster-api",+ Status: "online",+ Type: "node",+ IsClusterMember: true,+ ClusterName: "production",+ LastSeen: seen,+ ConnectionHealth: "healthy",+ }++ adapter.PopulateFromSnapshot(models.StateSnapshot{+ Nodes: []models.Node{node},+ LastUpdate: seen,+ })+ resources := adapter.GetAll()+ if len(resources) != 1 {+ t.Fatalf("initial resources = %d, want 1", len(resources))+ }+ resourceID := resources[0].ID++ node.Status = "offline"+ node.ConnectionHealth = "error"+ node.CPU = 0+ node.Uptime = 0+ adapter.PopulateFromSnapshot(models.StateSnapshot{+ Nodes: []models.Node{node},+ LastUpdate: seen.Add(time.Minute),+ })+ resources = adapter.GetAll()+ if len(resources) != 1 || resources[0].ID != resourceID || resources[0].Status == StatusOnline {+ t.Fatalf("offline membership projection = %+v, want stable non-online resource %q", resources, resourceID)+ }+ if resources[0].Proxmox == nil || resources[0].Proxmox.ConnectionHealth != "error" {+ t.Fatalf("offline membership lost provider reachability truth: %+v", resources[0].Proxmox)+ }+ if got := MonitoredSystemCount(adapter); got != 1 {+ t.Fatalf("offline member monitored-system count = %d, want 1", got)+ }++ changes, err := store.GetRecentChanges(resourceID, time.Time{}, 20)+ if err != nil {+ t.Fatalf("GetRecentChanges before removal: %v", err)+ }+ for _, change := range changes {+ if change.Metadata != nil && change.Metadata["changeType"] == "resource_removed" {+ t.Fatalf("offline transition emitted resource removal: %+v", change)+ }+ }++ // The monitor only emits this empty snapshot after its explicit,+ // repeatedly-confirmed membership reconciliation retires the node.+ adapter.PopulateFromSnapshot(models.StateSnapshot{LastUpdate: seen.Add(2 * time.Minute)})+ if resources = adapter.GetAll(); len(resources) != 0 {+ t.Fatalf("confirmed removal left %d canonical resources: %+v", len(resources), resources)+ }+ if got := MonitoredSystemCount(adapter); got != 0 {+ t.Fatalf("confirmed removal monitored-system count = %d, want 0", got)+ }+ changes, err = store.GetRecentChanges(resourceID, time.Time{}, 20)+ if err != nil {+ t.Fatalf("GetRecentChanges after removal: %v", err)+ }+ foundRemoval := false+ for _, change := range changes {+ if change.Metadata != nil && change.Metadata["changeType"] == "resource_removed" {+ foundRemoval = true+ }+ }+ if !foundRemoval {+ t.Fatalf("confirmed removal did not emit resource_removed: %+v", changes)+ }+}+func TestMonitorAdapterAvailabilityChecksSurviveRebuildAndRecordDeletionByCheckID(t *testing.T) {store := NewMemoryStore()adapter := NewMonitorAdapter(NewRegistry(store))diff --git a/internal/unifiedresources/proxmox_node_links.go b/internal/unifiedresources/proxmox_node_links.goindex 6d96937f7e..0710fbcdae 100644--- a/internal/unifiedresources/proxmox_node_links.go+++ b/internal/unifiedresources/proxmox_node_links.go@@ -133,7 +133,9 @@ func inferLinkedHostsForProxmoxNodes(nodes []models.Node, hostByID map[string]*mif inferredHostID == "" {for hostID := range trustedHostIDs {host := hostByID[hostID]- if host == nil || !proxmoxNodeCorroboratesHost(node, *host) {+ if host == nil ||+ proxmoxNodeUsesProviderScopedIdentity(node) ||+ !proxmoxNodeCorroboratesHost(node, *host) {continue}if inferredHostID != "" && inferredHostID != hostID {@@ -161,6 +163,13 @@ func proxmoxNodeLinkKeys(node models.Node) []string {}keys := make([]string, 0, 4)+ if proxmoxNodeUsesProviderScopedIdentity(node) {+ instance := strings.TrimSpace(strings.ToLower(node.Instance))+ if instance == "" {+ return nil+ }+ return []string{"provider:" + instance + ":" + name}+ }if cluster := strings.TrimSpace(strings.ToLower(node.ClusterName)); cluster != "" {keys = append(keys, "cluster:"+cluster+":"+name)}@@ -182,6 +191,9 @@ func trustedProxmoxNodeHostLink(node models.Node, host models.Host) bool {if strings.TrimSpace(host.LinkedNodeID) == strings.TrimSpace(node.ID) && strings.TrimSpace(node.ID) != "" {return true}+ if proxmoxNodeUsesProviderScopedIdentity(node) {+ return false+ }return proxmoxNodeCorroboratesHost(node, host)}diff --git a/internal/unifiedresources/registry_test.go b/internal/unifiedresources/registry_test.goindex 35bca312eb..2d1bf45ec9 100644--- a/internal/unifiedresources/registry_test.go+++ b/internal/unifiedresources/registry_test.go@@ -103,6 +103,63 @@ func TestResourceRegistry_GetByReferenceResolvesSourceIDAndCanonicalAlias(t *tes}}+func TestMonitorAdapterKeepsSameNamedProxmoxProvidersDistinct(t *testing.T) {+ adapter := NewMonitorAdapter(NewRegistry(NewMemoryStore()))+ seen := time.Date(2026, 7, 24, 8, 0, 0, 0, time.UTC)+ adapter.PopulateFromSnapshot(models.StateSnapshot{+ Nodes: []models.Node{+ {+ ID: "site-a-pve-1",+ Name: "pve-1",+ Instance: "site-a",+ Status: "online",+ Type: "node",+ IsClusterMember: true,+ ClusterName: "production",+ LastSeen: seen,+ LinkedAgentID: "shared-agent-id",+ },+ {+ ID: "site-b-pve-1",+ Name: "pve-1",+ Instance: "site-b",+ Status: "offline",+ Type: "node",+ IsClusterMember: true,+ ClusterName: "production",+ LastSeen: seen,+ LinkedAgentID: "shared-agent-id",+ },+ },+ Hosts: []models.Host{{+ ID: "shared-agent-id",+ Hostname: "pve-1",+ MachineID: "machine-site-a",+ LinkedNodeID: "site-a-pve-1",+ LastSeen: seen,+ }},+ LastUpdate: seen,+ })++ resources := adapter.GetAll()+ if len(resources) != 2 {+ t.Fatalf("same-name provider resources = %d, want 2: %+v", len(resources), resources)+ }+ byInstance := make(map[string]Resource, len(resources))+ for _, resource := range resources {+ if resource.Proxmox != nil {+ byInstance[resource.Proxmox.Instance] = resource+ }+ }+ if byInstance["site-a"].ID == "" || byInstance["site-b"].ID == "" ||+ byInstance["site-a"].ID == byInstance["site-b"].ID {+ t.Fatalf("provider-scoped canonical identities collided: %+v", resources)+ }+ if got := MonitoredSystemCount(adapter); got != 2 {+ t.Fatalf("same-name provider monitored-system count = %d, want 2", got)+ }+}+func TestResourceRegistryAvailabilityLinkedResourceResolvesSourceReference(t *testing.T) {rr := NewRegistry(nil)now := time.Now().UTC()diff --git a/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts b/tests/integration/tests/65-offline-proxmox-node-visibility.spec.tsindex f231ee1008..a4575f943c 100644--- a/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts+++ b/tests/integration/tests/65-offline-proxmox-node-visibility.spec.ts@@ -1,9 +1,9 @@-import fs from 'node:fs';-import path from 'node:path';-import { fileURLToPath } from 'node:url';-import { expect, test as base } from '@playwright/test';+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";+import { expect, test as base, type Page } from "@playwright/test";-import { createAuthenticatedStorageState } from './helpers';+import { createAuthenticatedStorageState } from "./helpers";const __dirname = path.dirname(fileURLToPath(import.meta.url));@@ -11,60 +11,120 @@ type WorkerFixtures = {authStorageStatePath: string;};+const offlineNode = {+ id: "proxmox:core-fabric:pve5",+ type: "agent",+ name: "pve5",+ canonicalIdentity: {+ displayName: "Disaster Recovery B",+ hostname: "pve5",+ platformId: "core-fabric",+ },+ sources: ["proxmox"],+ status: "offline",+ uptime: 2_419_200,+ lastSeen: "2026-07-24T08:00:00Z",+ metrics: {+ cpu: { percent: 47 },+ memory: { percent: 61, used: 61_000, total: 100_000 },+ disk: { percent: 72, used: 72_000, total: 100_000 },+ },+ proxmox: {+ instance: "core-fabric",+ clusterName: "Core Fabric",+ nodeName: "pve5",+ host: "https://pve5:8006",+ connectionHealth: "error",+ pveVersion: "7.4-18",+ temperature: 71,+ },+};++async function routeOfflineProxmoxInventory(page: Page) {+ // The browser assertion owns presentation, while the Go lifecycle tests own+ // membership reconciliation. Suppress live websocket inventory here and+ // provide one deterministic canonical REST snapshot so startup timing,+ // cache state, and unrelated mock-estate changes cannot weaken the UI proof.+ await page.routeWebSocket("**/ws*", () => {});+ await page.route("**/api/resources**", async (route) => {+ const requestUrl = new URL(route.request().url());+ if (requestUrl.pathname !== "/api/resources") {+ await route.continue();+ return;+ }+ await route.fulfill({+ status: 200,+ contentType: "application/json",+ body: JSON.stringify({+ data: [offlineNode],+ meta: { page: 1, limit: 100, total: 1, totalPages: 1 },+ links: { next: null },+ }),+ });+ });+}+const test = base.extend<{}, WorkerFixtures>({storageState: async ({ authStorageStatePath }, use) => {await use(authStorageStatePath);},- authStorageStatePath: [async ({ browser }, use, workerInfo) => {- const storageStatePath = path.resolve(- __dirname,- '..',- '..',- 'tmp',- 'playwright-auth',- `offline-proxmox-node-${workerInfo.project.name}.json`,- );- fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });- await createAuthenticatedStorageState(browser, storageStatePath);- try {- await use(storageStatePath);- } finally {- fs.rmSync(storageStatePath, { force: true });- }- }, { scope: 'worker' }],+ authStorageStatePath: [+ async ({ browser }, use, workerInfo) => {+ const storageStatePath = path.resolve(+ __dirname,+ "..",+ "..",+ "tmp",+ "playwright-auth",+ `offline-proxmox-node-${workerInfo.project.name}.json`,+ );+ fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });+ await createAuthenticatedStorageState(browser, storageStatePath);+ try {+ await use(storageStatePath);+ } finally {+ fs.rmSync(storageStatePath, { force: true });+ }+ },+ { scope: "worker" },+ ],});-// The mock scenario deterministically forces pve5 (Disaster Recovery B)-// offline, which is exactly the state this guard exists for: an offline-// node must stay listed on its platform page instead of silently vanishing-// from the fleet view. Platform pages render websocket state, so the guard-// asserts against the mock dataset rather than REST stubs.-test.describe('Offline Proxmox node visibility', () => {+// Browser-level contract for the provider-first migration: a known but+// unreachable PVE node stays listed on its platform page instead of silently+// vanishing, and cached metrics are not presented as live.+test.describe("Offline Proxmox node visibility", () => {test.setTimeout(180_000);- test('keeps an offline Proxmox node visible on the Proxmox platform surface', async ({+ test("keeps an offline Proxmox node visible on desktop and mobile surfaces", async ({page,- }, testInfo) => {- test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');-- await page.goto('/proxmox', { waitUntil: 'domcontentloaded' });- await expect(page.getByTestId('proxmox-page')).toBeVisible();+ }) => {+ await routeOfflineProxmoxInventory(page);+ await page.goto("/proxmox", { waitUntil: "domcontentloaded" });+ await expect(page.getByTestId("proxmox-page")).toBeVisible();const offlineRow = page.locator('[data-testid="proxmox-page"] tr')- .filter({ hasText: 'Disaster Recovery B' })+ .filter({ hasText: "Disaster Recovery B" }).first();+ await expect(offlineRow).toBeVisible({ timeout: 60_000 });await offlineRow.scrollIntoViewIfNeeded();- await expect(offlineRow).toBeVisible();// Offline presentation: live metrics are dashed out, but the node keeps// its identity and management affordances.- await expect(offlineRow).toContainText('—');+ await expect(offlineRow).toContainText("Offline");+ await expect(offlineRow).toContainText("—");+ await expect(offlineRow).not.toContainText("71°C");+ await expect(offlineRow).not.toContainText("28d 0h");await expect(- offlineRow.getByRole('link', { name: 'Open web interface for Disaster Recovery B' }),+ offlineRow.getByRole("link", {+ name: "Open web interface for Disaster Recovery B",+ }),).toBeVisible();await expect(- offlineRow.getByRole('button', { name: 'Expand details for Disaster Recovery B' }),+ offlineRow.getByRole("button", {+ name: "Expand details for Disaster Recovery B",+ }),).toBeVisible();});});