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
Carry vSphere cluster services
rcourtman6c7d64ae439e
diff --git a/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_RESOURCE_PROJECTION_SPEC.md b/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_RESOURCE_PROJECTION_SPEC.mdindex 014d469182..1898bdb9d0 100644--- a/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_RESOURCE_PROJECTION_SPEC.md+++ b/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_RESOURCE_PROJECTION_SPEC.md@@ -1,6 +1,6 @@# VMware vCenter Phase-1 Resource Projection Spec-Last updated: 2026-03-30+Last updated: 2026-05-22Status: PLANNEDGovernance surfaces:- `status.json.candidate_lanes.platform-admission-execution`@@ -25,8 +25,9 @@ Phase-1 VMware support is only valid if all of these stay true:3. ESXi hosts project as canonical `agent`4. virtual machines project as canonical `vm`5. datastores project as canonical `storage`-6. datacenter, cluster, folder, resource pool, and `vCenter` itself remain- topology or relationship metadata, not top-level Pulse resources+6. datacenter, cluster, cluster HA/DRS service state, folder, resource pool,+ and `vCenter` itself remain topology or relationship metadata, not+ top-level Pulse resources7. `physical-disk`, `system-container`, `app-container`, and recoveryartifacts remain out of phase 1@@ -60,7 +61,7 @@ distinct `vCenter` environments.| `Datastore` | `storage` | yes | yes | inventory, capacity/free-space, accessibility, relationships || `vCenter` | none | no | no | connection and poll authority only || `Datacenter` | none | metadata only | no | placement and topology context |-| `ClusterComputeResource` | none | metadata only | no | placement and grouping context |+| `ClusterComputeResource` | none | metadata only | no | placement, grouping, HA/DRS service context || `Folder` | none | metadata only | no | inventory placement context || `ResourcePool` | none | metadata only | no | workload placement context || snapshot tree | none | read-side VM detail only | no | not a recovery artifact |@@ -88,6 +89,10 @@ Phase-1 projection rule:4. cluster, datacenter, folder, and resource-pool context stay inVMware-specific platform metadata or relationships under that canonical`agent`+5. when `GET /api/vcenter/cluster` exposes HA/DRS service state for the+ resolved cluster, that state may be copied onto the host's `vmware` facet as+ read-only monitoring context, not as a cluster resource or host control+ capabilityRequired secondary identity capture when available:@@ -131,6 +136,10 @@ Phase-1 projection rule:5. host placement, folder placement, resource-pool membership, and datastoreattachments stay as relationships or platform metadata under the canonical`vm`+6. when `GET /api/vcenter/cluster` exposes HA/DRS service state for the+ resolved cluster, that state may be copied onto the VM's `vmware` facet as+ read-only placement context, not as VM identity, scheduling authority, or+ recovery postureSnapshot boundary:@@ -179,6 +188,10 @@ These VMware concepts remain metadata or relationships in phase 1:6. datastore cluster / storage pod7. network objects+Cluster HA and DRS flags are properties of the cluster placement context. They+may be rendered on canonical hosts and VMs whose placement resolves to that+cluster, but the cluster itself remains topology metadata in phase 1.+That means phase-1 VMware work must not add:1. `esxi-host`@@ -298,3 +311,5 @@ not compensate by inventing provider-local resource types or sidecar products.[Alarm Manager Get Alarm](https://developer.broadcom.com/xapis/virtual-infrastructure-json-api/latest/sdk/vim25/release/AlarmManager/moId/GetAlarm/post/)11. host-plus-child performance:[Performance Manager Query Perf Composite](https://developer.broadcom.com/xapis/virtual-infrastructure-json-api/latest/sdk/vim25/release/PerformanceManager/moId/QueryPerfComposite/post/)+12. cluster inventory and HA/DRS service state:+ [Vcenter Cluster list](https://developer.broadcom.com/xapis/vsphere-automation-api/latest/api/vcenter/cluster/get/)diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 900b269e59..26fc414a86 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -736,7 +736,7 @@ a separate Docker-only or TrueNAS-local inventory path.27. Keep alert-side recovery drill-ins on that same shared route-helper contract. When alert investigation surfaces such as resource-incident panels expose recovery follow-up links for TrueNAS or future API-backed platforms, they must route through the canonical `frontend-modern/src/routing/resourceLinks.ts` recovery builder instead of freezing alert-local recovery URLs or introducing another provider-shaped recovery handoff vocabulary.28. Keep VMware onboarding runtime and recovery semantics separate on that same adjacent platform-connections contract. When `internal/api/router.go`, `internal/api/router_routes_registration.go`, or `internal/api/vmware_handlers.go` evolve VMware connection CRUD, poller-owned `poll` / `observed` summary payloads, saved-test refresh, or observed datastore/VM snapshot visibility, storage and recovery may consume the resulting shared context but must not treat those onboarding/runtime payloads as canonical recovery artifacts, restore capability, or recovery-local control transport.29. Keep VMware datastore projection on the shared unified-resource and storage-source contracts. When `frontend-modern/src/hooks/useUnifiedResources.ts` or shared `internal/api/router.go` wiring starts surfacing VMware-backed canonical `storage` resources, storage and recovery may expose those datastores through the owned `vmware-vsphere` source/platform vocabulary for inventory, capacity, and handoff flows only; they must not reinterpret that projection as VMware recovery support, restore semantics, or a provider-local protection surface.-30. Keep VMware placement, guest-detail, VM snapshot-tree, VM virtual-hardware configuration, VMware Tools, VM hardware Ethernet, and VM hardware disk enrichment descriptive on that same shared unified-resource contract. When `internal/vmware/provider.go`, `internal/unifiedresources/types.go`, and `frontend-modern/src/hooks/useUnifiedResources.ts` project datacenter, cluster, folder, runtime-host, datastore-attachment, guest-hostname, guest-IP, `vmware.currentSnapshotId`, `vmware.snapshotTree`, snapshot creation/state/quiesce/current markers, child snapshot metadata, `vmware.hardware`, virtual hardware version, hardware upgrade policy/version/status/error, boot type/order/retry/setup-mode flags, CPU cores-per-socket and hot-add/remove flags, memory hot-add settings, `vmware.tools`, Tools run state, version status, version number/string, install type, upgrade policy, auto-update support, install-attempt count, guest reboot requests, `vmware.networkAdapters`, adapter MAC address/type, backing network id/name, backing type, connection state, start-connected / guest-control flags, `vmware.virtualDisks`, virtual disk label/type, IDE/SCSI/SATA/NVMe placement, VMDK path, backing type, datastore name, or capacity onto canonical VMware `agent` / `vm` / `storage` resources, storage and recovery may use that detail for labeling, navigation, and VM investigation context only; they must not promote those topology, guest, snapshot-tree, virtual-hardware, VMware Tools, vNIC, or virtual disk fields into recovery ownership, restore targeting, protection grouping, compliance scoring, or a VMware-local recovery taxonomy without a separately governed slice.+30. Keep VMware placement, cluster service state, guest-detail, VM snapshot-tree, VM virtual-hardware configuration, VMware Tools, VM hardware Ethernet, and VM hardware disk enrichment descriptive on that same shared unified-resource contract. When `internal/vmware/provider.go`, `internal/unifiedresources/types.go`, and `frontend-modern/src/hooks/useUnifiedResources.ts` project datacenter, cluster, `vmware.clusterHaEnabled`, `vmware.clusterDrsEnabled`, folder, runtime-host, datastore-attachment, guest-hostname, guest-IP, `vmware.currentSnapshotId`, `vmware.snapshotTree`, snapshot creation/state/quiesce/current markers, child snapshot metadata, `vmware.hardware`, virtual hardware version, hardware upgrade policy/version/status/error, boot type/order/retry/setup-mode flags, CPU cores-per-socket and hot-add/remove flags, memory hot-add settings, `vmware.tools`, Tools run state, version status, version number/string, install type, upgrade policy, auto-update support, install-attempt count, guest reboot requests, `vmware.networkAdapters`, adapter MAC address/type, backing network id/name, backing type, connection state, start-connected / guest-control flags, `vmware.virtualDisks`, virtual disk label/type, IDE/SCSI/SATA/NVMe placement, VMDK path, backing type, datastore name, or capacity onto canonical VMware `agent` / `vm` / `storage` resources, storage and recovery may use that detail for labeling, navigation, and VM investigation context only; they must not promote those topology, cluster-service, guest, snapshot-tree, virtual-hardware, VMware Tools, vNIC, or virtual disk fields into recovery ownership, restore targeting, protection grouping, compliance scoring, or a VMware-local recovery taxonomy without a separately governed slice.31. Keep VMware datastore classification neutral on the shared storage adapter contract. When `frontend-modern/src/features/storageBackups/resourceStorageMapping.ts`, `frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts`, and `frontend-modern/src/features/storageBackups/storageAdapters.ts` evolve canonical storage-record mapping, VMware-backed datastores must continue to land on the shared storage route as inventory-only datastores with neutral protection fallback, not as backup repositories, backup targets, or recovery-protected resources.That same shared storage adapter boundary also owns canonical platformfamily vocabulary through the governed platform manifest.@@ -3157,20 +3157,21 @@ Storage and recovery must not infer VMware restore support, recovery rollups,or VMware-local protection semantics from the presence of those datastores orVM snapshot-read context on the shared pages.That same shared adapter floor also now carries richer VMware placement,-guest-detail, VM virtual-hardware, and VMware Tools metadata through the+cluster-service, guest-detail, VM virtual-hardware, and VMware Tools metadata through thecanonical `agent` / `vm` / `storage` resources that storage and recovery caninspect on shared pages.`internal/vmware/provider.go`, `internal/unifiedresources/types.go`, and`frontend-modern/src/hooks/useUnifiedResources.ts` may expose datacenter,-cluster, folder, runtime-host, datastore-attachment, guest-hostname, and-guest-IP detail plus VM virtual-hardware version, boot, CPU/memory hot-add,-VMware Tools run-state, version, policy, install-attempt, error, and-guest-reboot context as inventory context, but those fields stay descriptive-only. Storage and recovery must not treat topology labels, datastore-attachments, guest identity, virtual-hardware posture, or VMware Tools posture-as recovery ownership, restore targeting, protection grouping, or a new-VMware-local storage/recovery taxonomy until a separately governed slice-explicitly promotes them into recovery contracts.+cluster, cluster HA/DRS service state, folder, runtime-host,+datastore-attachment, guest-hostname, and guest-IP detail plus VM+virtual-hardware version, boot, CPU/memory hot-add, VMware Tools run-state,+version, policy, install-attempt, error, and guest-reboot context as inventory+context, but those fields stay descriptive only. Storage and recovery must not+treat topology labels, cluster-service flags, datastore attachments, guest+identity, virtual-hardware posture, or VMware Tools posture as recovery+ownership, restore targeting, protection grouping, or a new VMware-local+storage/recovery taxonomy until a separately governed slice explicitly promotes+them into recovery contracts.That same storage/recovery surface now also owns physical-disk live I/Opresentation through the canonical chart boundary. Storage disk drawers mayshow read, write, busy, and SMART history, but they must route every chartdiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex b4f3af245d..2c9ffc4771 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -1150,11 +1150,12 @@ resource kinds, or a parallel VMware incident model.That same topology contract now also has a concrete projection seam.`internal/vmware/provider.go` must preserve VMware placement and identitydetail on the shared `vmware` facet only: hosts may carry datacenter,-compute-resource, cluster, folder, and attached-datastore metadata; VMs may-carry runtime-host, folder, resource-pool, datastore, guest-identity, VM+compute-resource, cluster, cluster HA/DRS service state, folder, and+attached-datastore metadata; VMs may carry runtime-host, cluster HA/DRS+service state, folder, resource-pool, datastore, guest-identity, VMvirtual-hardware configuration, VMware Tools runtime status, and VM hardware-Ethernet adapter plus VM hardware disk metadata plus canonical parentage to the-owning ESXi `agent`; datastores may+Ethernet adapter plus VM hardware disk metadata plus canonical parentage to+the owning ESXi `agent`; datastores maycarry datacenter/folder placement plus shared storage-node and workloadconsumer metadata through `storage.nodes`, `storage.consumerCount`, and`storage.topConsumers`. VMs may also carry VI JSON snapshot-tree context under@@ -1185,6 +1186,11 @@ CPU cores-per-socket and CPU hot-add/remove flags, and memory hot-addincrement/limit settings. Those fields are API-native read-only VMconfiguration facts; they must not become Pulse VM-control authority, workloadidentity aliases, recovery protection posture, or a separate hardware resource.+Cluster HA and DRS state belongs under `vmware.clusterHaEnabled` and+`vmware.clusterDrsEnabled` for hosts and VMs whose placement resolves to that+cluster. It is API-native monitoring context from the vCenter cluster summary,+not a synthetic cluster resource, lifecycle command surface, scheduling policy+model, or recovery/protection signal.Those enrichments must remain subordinate to shared `agent`, `vm`, and`storage` resources rather than becoming a VMware-only topology graph, recoveryartifact, canonical identity alias, or separate provider detail drawerdiff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsxindex c4f022200e..5a22c14cd7 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx@@ -304,6 +304,8 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {powerState: 'poweredOn',datacenterName: 'Lab DC',clusterName: 'Compute Cluster',+ clusterHaEnabled: true,+ clusterDrsEnabled: false,resourcePoolName: 'Production',runtimeHostName: 'esxi-01.lab.local',datastoreNames: ['shared-vsan'],@@ -410,6 +412,8 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {powerState: 'poweredOn',datacenterName: 'Lab DC',clusterName: 'Compute Cluster',+ clusterHaEnabled: true,+ clusterDrsEnabled: false,resourcePoolName: 'Production',runtimeHostName: 'esxi-01.lab.local',datastoreNames: ['shared-vsan'],@@ -540,6 +544,8 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {expect(within(section).getByText('Snapshot tree')).toBeInTheDocument();expect(within(section).getByText('vc.lab.local')).toBeInTheDocument();expect(within(section).getByText('Compute Cluster')).toBeInTheDocument();+ expect(within(section).getByText('Cluster services')).toBeInTheDocument();+ expect(within(section).getByText('HA enabled · DRS disabled')).toBeInTheDocument();expect(within(section).getByText('esxi-01.lab.local')).toBeInTheDocument();expect(within(section).getByText('ubuntu64Guest')).toBeInTheDocument();expect(within(section).getByText('Hardware version')).toBeInTheDocument();diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.tsindex 354ed69492..e86bacba35 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts@@ -6,6 +6,33 @@ import {import type { ResourceVMwareMeta } from '@/types/resource';describe('resourceDetailDrawerVmwareModel', () => {+ it('surfaces vCenter cluster service state in placement context', () => {+ const vmware: ResourceVMwareMeta = {+ datacenterName: 'Lab DC',+ clusterName: 'Compute Cluster',+ clusterHaEnabled: true,+ clusterDrsEnabled: false,+ computeResourceName: 'Compute Cluster',+ resourcePoolName: 'Production',+ runtimeHostName: 'esxi-01.lab.local',+ datastoreNames: ['shared-vsan'],+ };++ const placement = buildVMwareDetailSections('vm', vmware).find(+ (section) => section.id === 'placement',+ );++ expect(placement?.rows).toEqual([+ { label: 'Datacenter', value: 'Lab DC' },+ { label: 'Cluster', value: 'Compute Cluster' },+ { label: 'Cluster services', value: 'HA enabled · DRS disabled' },+ { label: 'Compute resource', value: 'Compute Cluster' },+ { label: 'Resource pool', value: 'Production' },+ { label: 'Runtime host', value: 'esxi-01.lab.local' },+ { label: 'Datastores', value: 'shared-vsan' },+ ]);+ });+it('surfaces vSphere snapshot trees as read-only VM detail context', () => {const vmware: ResourceVMwareMeta = {connectionName: 'Lab VC',diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.tsindex 99a1721866..3f3529ba8a 100644--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts@@ -8,6 +8,7 @@ import type {ResourceVMwareTools,ResourceVMwareVirtualDisk,} from '@/types/resource';+import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';export type ResourceDetailDrawerVMwareRowTone = 'default' | 'accent' | 'warning';@@ -620,6 +621,10 @@ export const buildVMwareDetailSections = (label: 'Cluster',value: asTrimmedString(vmware.clusterName),},+ {+ label: 'Cluster services',+ value: formatVmwareClusterServices(vmware),+ },{label: 'Compute resource',value: asTrimmedString(vmware.computeResourceName),diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsxindex 08c0e2d826..394a66dcf6 100644--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx@@ -10,6 +10,7 @@ import { SearchInput } from '@/components/shared/SearchInput';import { TableCard } from '@/components/shared/TableCard';import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';import type { Resource, ResourceStatus } from '@/types/resource';+import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';import { getPlatformColumnAlign, type PlatformTableColumnKind } from './columnAlignment';export type { PlatformTableFilterOption };@@ -209,6 +210,7 @@ const matchesPlatformSearch = (resource: Resource, search: string): boolean => {resource.vmware?.vcenterHost,resource.vmware?.runtimeHostName,resource.vmware?.clusterName,+ formatVmwareClusterServices(resource.vmware),resource.vmware?.datastoreNames?.join(' '),...(resource.tags ?? []),]diff --git a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx b/frontend-modern/src/features/vmware/VsphereHostsTable.tsxindex 548e71eff2..282b178b3c 100644--- a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx@@ -14,6 +14,7 @@ import {} from '@/components/shared/Table';import { getSimpleStatusIndicator } from '@/utils/status';import { asTrimmedString } from '@/utils/stringUtils';+import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';import {PLATFORM_TABLE_BODY_CLASS,@@ -159,13 +160,19 @@ export const VsphereHostsTable: Component<{<TableHead class={`${getPlatformTableHeadClassForKind('name')} md:w-[18%]`}>Host</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[11%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[11%]`}+ >Datacenter</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[12%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[12%]`}+ >Cluster</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[9%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[9%]`}+ >Power</TableHead><TableHead class={`${getPlatformTableHeadClassForKind('metric-bar')} md:w-[13%]`}>@@ -174,13 +181,19 @@ export const VsphereHostsTable: Component<{<TableHead class={`${getPlatformTableHeadClassForKind('metric-bar')} md:w-[13%]`}>Memory</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden md:table-cell md:w-[9%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden md:table-cell md:w-[9%]`}+ >Datastores</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('numeric-value')} md:w-[5%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('numeric-value')} md:w-[5%]`}+ >VMs</TableHead>- <TableHead class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[10%]`}>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[10%]`}+ >vCenter</TableHead></TableRow>@@ -192,6 +205,7 @@ export const VsphereHostsTable: Component<{const name = () => asTrimmedString(host.name) || host.id;const datacenter = () => asTrimmedString(meta()?.datacenterName) || '—';const cluster = () => asTrimmedString(meta()?.clusterName) || '—';+ const clusterServices = () => formatVmwareClusterServices(meta());const vcenter = () => asTrimmedString(meta()?.vcenterHost) || '—';const datastoreCount = () =>meta()?.datastoreIds?.length ?? meta()?.datastoreNames?.length ?? 0;@@ -240,10 +254,18 @@ export const VsphereHostsTable: Component<{</TableCell><TableCellclass={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}+ title={[cluster(), clusterServices()].filter(Boolean).join(' | ')}>- {cluster()}+ <span class="block truncate">{cluster()}</span>+ <Show when={clusterServices()}>+ <span class="block truncate text-[10px] text-muted">+ {clusterServices()}+ </span>+ </Show></TableCell>- <TableCell class={`${getPlatformTableCellClassForKind('text')} hidden md:table-cell`}>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} hidden md:table-cell`}+ ><div class="flex items-center gap-2"><StatusDotsize="sm"diff --git a/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx b/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsxindex 7bf003b572..5d3cbe29b1 100644--- a/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx@@ -16,6 +16,7 @@ import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';import { formatBytes } from '@/utils/format';import { getSimpleStatusIndicator } from '@/utils/status';import { asTrimmedString } from '@/utils/stringUtils';+import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';import {PLATFORM_TABLE_BODY_CLASS,PLATFORM_TABLE_CARD_CLASS,@@ -511,6 +512,7 @@ export const VsphereVirtualMachinesTable: Component<{asTrimmedString(meta()?.clusterName) ||asTrimmedString(meta()?.computeResourceName) ||'-';+ const clusterServices = () => formatVmwareClusterServices(meta());const pool = () => asTrimmedString(meta()?.resourcePoolName) || '-';const guest = createMemo(() => formatGuest(vm));const network = createMemo(() => networkSummary(meta()?.networkAdapters));@@ -599,9 +601,14 @@ export const VsphereVirtualMachinesTable: Component<{</TableCell><TableCellclass={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}- title={cluster()}+ title={[cluster(), clusterServices()].filter(Boolean).join(' | ')}><span class="block truncate">{cluster()}</span>+ <Show when={clusterServices()}>+ <span class="block truncate text-[10px] text-muted">+ {clusterServices()}+ </span>+ </Show></TableCell><TableCellclass={`${getPlatformTableCellClassForKind('text')} hidden text-base-content lg:table-cell`}diff --git a/frontend-modern/src/features/vmware/vmwarePageModel.ts b/frontend-modern/src/features/vmware/vmwarePageModel.tsindex f9e944d778..71114a2c8b 100644--- a/frontend-modern/src/features/vmware/vmwarePageModel.ts+++ b/frontend-modern/src/features/vmware/vmwarePageModel.ts@@ -1,4 +1,5 @@import { resolveResourcePlatformType } from '@/utils/sourcePlatforms';+import { formatVmwareClusterServices } from '@/utils/vmwareDisplay';import type { Resource, ResourceChange, ResourceIncident, ResourceType } from '@/types/resource';export type VmwarePageTabId = 'overview' | 'storage' | 'health' | 'activity';@@ -697,6 +698,7 @@ const vmwareVirtualMachineSearchHaystack = (resource: Resource): string =>resource.vmware?.managedObjectId,resource.vmware?.datacenterName,resource.vmware?.clusterName,+ formatVmwareClusterServices(resource.vmware),resource.vmware?.computeResourceName,resource.vmware?.folderName,resource.vmware?.resourcePoolName,diff --git a/frontend-modern/src/types/__tests__/resource.test.ts b/frontend-modern/src/types/__tests__/resource.test.tsindex b5cde7c5fc..82b015c0ca 100644--- a/frontend-modern/src/types/__tests__/resource.test.ts+++ b/frontend-modern/src/types/__tests__/resource.test.ts@@ -255,6 +255,8 @@ describe('Resource Helper Functions', () => {entityType: 'vm',datacenterName: 'DC1',clusterName: 'Production Cluster',+ clusterHaEnabled: true,+ clusterDrsEnabled: false,folderName: 'Workloads',resourcePoolName: 'Tier 1',runtimeHostName: 'esxi-01.lab.local',@@ -355,6 +357,8 @@ describe('Resource Helper Functions', () => {expect(vmware.overallStatus).toBe('yellow');expect(vmware.clusterName).toBe('Production Cluster');+ expect(vmware.clusterHaEnabled).toBe(true);+ expect(vmware.clusterDrsEnabled).toBe(false);expect(vmware.runtimeHostName).toBe('esxi-01.lab.local');expect(vmware.datastoreNames).toEqual(['primary-vmfs']);expect(vmware.guestIpAddresses).toEqual(['10.0.0.21']);diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex 46c1da33b8..961a66cf45 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -937,6 +937,8 @@ export interface ResourceVMwareMeta {computeResourceName?: string;clusterId?: string;clusterName?: string;+ clusterHaEnabled?: boolean;+ clusterDrsEnabled?: boolean;folderId?: string;folderName?: string;resourcePoolId?: string;diff --git a/frontend-modern/src/utils/vmwareDisplay.ts b/frontend-modern/src/utils/vmwareDisplay.tsnew file mode 100644index 0000000000..190a28bb96--- /dev/null+++ b/frontend-modern/src/utils/vmwareDisplay.ts@@ -0,0 +1,12 @@+import type { ResourceVMwareMeta } from '@/types/resource';++export const formatVmwareClusterServices = (meta: ResourceVMwareMeta | undefined): string => {+ const parts: string[] = [];+ if (meta?.clusterHaEnabled !== undefined) {+ parts.push(`HA ${meta.clusterHaEnabled ? 'enabled' : 'disabled'}`);+ }+ if (meta?.clusterDrsEnabled !== undefined) {+ parts.push(`DRS ${meta.clusterDrsEnabled ? 'enabled' : 'disabled'}`);+ }+ return parts.join(' · ');+};diff --git a/internal/unifiedresources/clone.go b/internal/unifiedresources/clone.goindex cb1bc9a0bc..2049b51fbb 100644--- a/internal/unifiedresources/clone.go+++ b/internal/unifiedresources/clone.go@@ -264,6 +264,8 @@ func cloneVMwareData(in *VMwareData) *VMwareData {out := *inout.DatastoreIDs = cloneStringSlice(in.DatastoreIDs)out.DatastoreNames = cloneStringSlice(in.DatastoreNames)+ out.ClusterHAEnabled = cloneBoolPtr(in.ClusterHAEnabled)+ out.ClusterDRSEnabled = cloneBoolPtr(in.ClusterDRSEnabled)out.DatastoreAccessible = cloneBoolPtr(in.DatastoreAccessible)out.MultipleHostAccess = cloneBoolPtr(in.MultipleHostAccess)out.GuestIPAddresses = cloneStringSlice(in.GuestIPAddresses)diff --git a/internal/unifiedresources/clone_test.go b/internal/unifiedresources/clone_test.goindex d8ccc36961..42caa76c1b 100644--- a/internal/unifiedresources/clone_test.go+++ b/internal/unifiedresources/clone_test.go@@ -159,6 +159,8 @@ func TestCloneResource_MutateVMwareDetailSlices(t *testing.T) {installAttempts := int64(1)toolsVersionNumber := int64(12352)guestRebootRequested := true+ clusterHAEnabled := true+ clusterDRSEnabled := falseinstantCloneFrozen := falsebootDelayMilliseconds := int64(5000)bootRetry := true@@ -167,6 +169,8 @@ func TestCloneResource_MutateVMwareDetailSlices(t *testing.T) {original := &Resource{ID: "vmware-vm-1",VMware: &VMwareData{+ ClusterHAEnabled: &clusterHAEnabled,+ ClusterDRSEnabled: &clusterDRSEnabled,SnapshotTree: []VMwareSnapshotData{{Snapshot: "snapshot-201",Name: "pre-upgrade",@@ -227,6 +231,8 @@ func TestCloneResource_MutateVMwareDetailSlices(t *testing.T) {cloned.VMware.VirtualDisks[0].DatastoreName = "mutated-datastore"*cloned.VMware.VirtualDisks[0].SCSIUnit = 2*cloned.VMware.VirtualDisks[0].CapacityBytes = 1+ *cloned.VMware.ClusterHAEnabled = false+ *cloned.VMware.ClusterDRSEnabled = true*cloned.VMware.Tools.AutoUpdateSupported = false*cloned.VMware.Tools.VersionNumber = 1cloned.VMware.Tools.GuestRebootComponents[0] = "mutated"@@ -259,6 +265,12 @@ func TestCloneResource_MutateVMwareDetailSlices(t *testing.T) {if *original.VMware.VirtualDisks[0].CapacityBytes != 107374182400 {t.Fatalf("mutating cloned VMware disk capacity should not affect original: %+v", original.VMware.VirtualDisks[0].CapacityBytes)}+ if original.VMware.ClusterHAEnabled == nil || !*original.VMware.ClusterHAEnabled {+ t.Fatalf("mutating cloned VMware cluster HA flag should not affect original: %+v", original.VMware.ClusterHAEnabled)+ }+ if original.VMware.ClusterDRSEnabled == nil || *original.VMware.ClusterDRSEnabled {+ t.Fatalf("mutating cloned VMware cluster DRS flag should not affect original: %+v", original.VMware.ClusterDRSEnabled)+ }if original.VMware.Tools.AutoUpdateSupported == nil || !*original.VMware.Tools.AutoUpdateSupported {t.Fatalf("mutating cloned VMware Tools auto-update flag should not affect original: %+v", original.VMware.Tools.AutoUpdateSupported)}diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.goindex 9cd660bc83..52a4dc2e54 100644--- a/internal/unifiedresources/code_standards_test.go+++ b/internal/unifiedresources/code_standards_test.go@@ -2007,6 +2007,8 @@ func TestCloneVMwareDataKeepsNestedRuntimeDetailsIsolated(t *testing.T) {"out.SnapshotTree = cloneVMwareSnapshotDataSlice(in.SnapshotTree)","out.NetworkAdapters = cloneVMwareNetworkAdapterDataSlice(in.NetworkAdapters)","out.VirtualDisks = cloneVMwareVirtualDiskDataSlice(in.VirtualDisks)",+ "out.ClusterHAEnabled = cloneBoolPtr(in.ClusterHAEnabled)",+ "out.ClusterDRSEnabled = cloneBoolPtr(in.ClusterDRSEnabled)","out.Tools = cloneVMwareToolsData(in.Tools)","out.Hardware = cloneVMwareVMHardwareData(in.Hardware)","out[i].CreatedAt = cloneTimePtr(in[i].CreatedAt)",diff --git a/internal/unifiedresources/registry.go b/internal/unifiedresources/registry.goindex 6d30201cd6..95e301a3f1 100644--- a/internal/unifiedresources/registry.go+++ b/internal/unifiedresources/registry.go@@ -1748,6 +1748,12 @@ func mergeVMwareData(existing *VMwareData, incoming *VMwareData) *VMwareData {if incoming.ClusterName != "" {merged.ClusterName = incoming.ClusterName}+ if incoming.ClusterHAEnabled != nil {+ merged.ClusterHAEnabled = cloneBoolPtr(incoming.ClusterHAEnabled)+ }+ if incoming.ClusterDRSEnabled != nil {+ merged.ClusterDRSEnabled = cloneBoolPtr(incoming.ClusterDRSEnabled)+ }if incoming.FolderID != "" {merged.FolderID = incoming.FolderID}diff --git a/internal/unifiedresources/registry_test.go b/internal/unifiedresources/registry_test.goindex ab5f977470..40b39d242f 100644--- a/internal/unifiedresources/registry_test.go+++ b/internal/unifiedresources/registry_test.go@@ -761,9 +761,13 @@ func TestMergeVMwareDataMergesSignalFieldsWithoutDroppingExistingIdentity(t *tesSnapshotCount: 1,}accessible := false+ clusterHA := true+ clusterDRS := falsebootRetry := trueincoming := &VMwareData{ClusterName: "Cluster A",+ ClusterHAEnabled: &clusterHA,+ ClusterDRSEnabled: &clusterDRS,RuntimeHostName: "esxi-01.lab.local",DatastoreNames: []string{"backup-nfs"},DatastoreAccessible: &accessible,@@ -820,6 +824,12 @@ func TestMergeVMwareDataMergesSignalFieldsWithoutDroppingExistingIdentity(t *tesif got := merged.RuntimeHostName; got != "esxi-01.lab.local" {t.Fatalf("runtime host name = %q, want esxi-01.lab.local", got)}+ if merged.ClusterHAEnabled == nil || !*merged.ClusterHAEnabled {+ t.Fatalf("cluster HA enabled = %#v, want true", merged.ClusterHAEnabled)+ }+ if merged.ClusterDRSEnabled == nil || *merged.ClusterDRSEnabled {+ t.Fatalf("cluster DRS enabled = %#v, want false", merged.ClusterDRSEnabled)+ }if got := merged.DatastoreNames; !reflect.DeepEqual(got, []string{"primary-vmfs", "backup-nfs"}) {t.Fatalf("datastore names = %#v", got)}diff --git a/internal/unifiedresources/types.go b/internal/unifiedresources/types.goindex a6ffe9234d..31881cb251 100644--- a/internal/unifiedresources/types.go+++ b/internal/unifiedresources/types.go@@ -1007,6 +1007,8 @@ type VMwareData struct {ComputeResourceName string `json:"computeResourceName,omitempty"`ClusterID string `json:"clusterId,omitempty"`ClusterName string `json:"clusterName,omitempty"`+ ClusterHAEnabled *bool `json:"clusterHaEnabled,omitempty"`+ ClusterDRSEnabled *bool `json:"clusterDrsEnabled,omitempty"`FolderID string `json:"folderId,omitempty"`FolderName string `json:"folderName,omitempty"`ResourcePoolID string `json:"resourcePoolId,omitempty"`diff --git a/internal/vmware/client_test.go b/internal/vmware/client_test.goindex 07ae24d73e..87d6677e41 100644--- a/internal/vmware/client_test.go+++ b/internal/vmware/client_test.go@@ -43,6 +43,9 @@ func TestClientCollectInventoryEnrichesSignals(t *testing.T) {if host.ClusterName != "Prod Compute" || host.DatacenterName != "DC1" {t.Fatalf("expected host placement enrichment, got cluster=%q datacenter=%q", host.ClusterName, host.DatacenterName)}+ if host.ClusterHAEnabled == nil || !*host.ClusterHAEnabled || host.ClusterDRSEnabled == nil || *host.ClusterDRSEnabled {+ t.Fatalf("expected host cluster service enrichment HA=true DRS=false, got ha=%+v drs=%+v", host.ClusterHAEnabled, host.ClusterDRSEnabled)+ }if len(host.DatastoreNames) != 1 || host.DatastoreNames[0] != "nvme-primary" {t.Fatalf("expected host datastore names, got %+v", host.DatastoreNames)}@@ -69,6 +72,9 @@ func TestClientCollectInventoryEnrichesSignals(t *testing.T) {if vm.RuntimeHostName != "esxi-01.lab.local" || vm.ResourcePoolName != "Tier 1" {t.Fatalf("expected VM placement enrichment, got host=%q pool=%q", vm.RuntimeHostName, vm.ResourcePoolName)}+ if vm.ClusterHAEnabled == nil || !*vm.ClusterHAEnabled || vm.ClusterDRSEnabled == nil || *vm.ClusterDRSEnabled {+ t.Fatalf("expected VM cluster service enrichment HA=true DRS=false, got ha=%+v drs=%+v", vm.ClusterHAEnabled, vm.ClusterDRSEnabled)+ }if vm.InstanceUUID != "vm-instance-201" || vm.BIOSUUID != "vm-bios-201" {t.Fatalf("expected VM identity enrichment, got instance=%q bios=%q", vm.InstanceUUID, vm.BIOSUUID)}@@ -184,6 +190,7 @@ func TestClientCollectInventoryPreservesBaseInventoryWhenOptionalEnrichmentDegraserver := newVMwareTestServer(t, vmwareTestServerConfig{denyHostOverallStatus: true,unavailableVMGuestInfo: true,+ denyClusterInventory: true,})defer server.Close()@@ -208,15 +215,18 @@ func TestClientCollectInventoryPreservesBaseInventoryWhenOptionalEnrichmentDegraif len(snapshot.Hosts) != 1 || len(snapshot.VMs) != 1 || len(snapshot.Datastores) != 1 {t.Fatalf("unexpected inventory sizes: hosts=%d vms=%d datastores=%d", len(snapshot.Hosts), len(snapshot.VMs), len(snapshot.Datastores))}- if len(snapshot.EnrichmentIssues) != 2 {- t.Fatalf("expected 2 enrichment issues, got %+v", snapshot.EnrichmentIssues)+ if len(snapshot.EnrichmentIssues) != 3 {+ t.Fatalf("expected 3 enrichment issues, got %+v", snapshot.EnrichmentIssues)}if snapshot.EnrichmentIssues[0].Category != "permission" || snapshot.EnrichmentIssues[0].Stage != "signals" {t.Fatalf("unexpected first enrichment issue: %+v", snapshot.EnrichmentIssues[0])}- if snapshot.EnrichmentIssues[1].Category != "unavailable" || snapshot.EnrichmentIssues[1].Stage != "topology" {+ if snapshot.EnrichmentIssues[1].Category != "permission" || snapshot.EnrichmentIssues[1].Stage != "topology" || snapshot.EnrichmentIssues[1].EntityType != "cluster" {t.Fatalf("unexpected second enrichment issue: %+v", snapshot.EnrichmentIssues[1])}+ if snapshot.EnrichmentIssues[2].Category != "unavailable" || snapshot.EnrichmentIssues[2].Stage != "topology" {+ t.Fatalf("unexpected third enrichment issue: %+v", snapshot.EnrichmentIssues[2])+ }host := snapshot.Hosts[0]if host.OverallStatus != "" {@@ -228,6 +238,9 @@ func TestClientCollectInventoryPreservesBaseInventoryWhenOptionalEnrichmentDegraif host.ClusterName != "Prod Compute" || host.DatacenterName != "DC1" {t.Fatalf("expected host placement enrichment to survive degraded signal read, got cluster=%q datacenter=%q", host.ClusterName, host.DatacenterName)}+ if host.ClusterHAEnabled != nil || host.ClusterDRSEnabled != nil {+ t.Fatalf("expected cluster services to stay empty after degraded cluster inventory read, got ha=%+v drs=%+v", host.ClusterHAEnabled, host.ClusterDRSEnabled)+ }vm := snapshot.VMs[0]if vm.GuestHostname != "" || len(vm.GuestIPAddresses) != 0 {@@ -248,6 +261,9 @@ func TestClientCollectInventoryPreservesBaseInventoryWhenOptionalEnrichmentDegraif vm.RuntimeHostName != "esxi-01.lab.local" || vm.ResourcePoolName != "Tier 1" {t.Fatalf("expected other topology enrichment to survive degraded guest read, got host=%q pool=%q", vm.RuntimeHostName, vm.ResourcePoolName)}+ if vm.ClusterHAEnabled != nil || vm.ClusterDRSEnabled != nil {+ t.Fatalf("expected VM cluster services to stay empty after degraded cluster inventory read, got ha=%+v drs=%+v", vm.ClusterHAEnabled, vm.ClusterDRSEnabled)+ }}func TestClientTestConnectionRequiresSignalFloor(t *testing.T) {@@ -352,6 +368,7 @@ func TestClientResolveVIJSONReleaseClassifiesUnsupportedVersionFloor(t *testing.type vmwareTestServerConfig struct {omitHostOverallStatus booldenyHostOverallStatus bool+ denyClusterInventory boolunavailableVMGuestInfo bool}@@ -405,6 +422,19 @@ func newVMwareTestServer(t *testing.T, cfg vmwareTestServerConfig) *httptest.SerCapacity: 100,}})})+ mux.HandleFunc("/api/vcenter/cluster", func(w http.ResponseWriter, r *http.Request) {+ requireAutomationSession(t, r)+ if cfg.denyClusterInventory {+ http.Error(w, "forbidden", http.StatusForbidden)+ return+ }+ writeJSON(w, []map[string]any{{+ "cluster": "domain-c101",+ "name": "Prod Compute",+ "ha_enabled": true,+ "drs_enabled": false,+ }})+ })mux.HandleFunc("/api/vcenter/vm/vm-201", func(w http.ResponseWriter, r *http.Request) {requireAutomationSession(t, r)writeJSON(w, map[string]any{diff --git a/internal/vmware/client_topology.go b/internal/vmware/client_topology.goindex 286db7f4cc..3154375e8a 100644--- a/internal/vmware/client_topology.go+++ b/internal/vmware/client_topology.go@@ -230,12 +230,21 @@ func (c *Client) enrichInventoryTopology(datastoreNamesByID[strings.TrimSpace(datastore.Datastore)] = firstNonEmptyTrimmed(datastore.Name, datastore.Datastore)}+ var issues []InventoryEnrichmentIssue+ clusters, err := c.collectClusterInventory(ctx, automationSessionID)+ if issue, ok := classifyInventoryEnrichmentIssue("topology", "cluster", "", err); ok {+ issues = append(issues, *issue)+ } else if err != nil && !isAutomationNotFound(err) && !isAutomationUnavailable(err) {+ return nil, err+ }+ snapshot.Clusters = clusters+ clusterDetailsByID := inventoryClusterDetailsByID(clusters)+cache := newVMwareTopologyCache()sem := make(chan struct{}, vmwareSignalEnrichmentConcurrency)var wg sync.WaitGroupvar firstErr errorvar firstErrMu sync.Mutex- var issues []InventoryEnrichmentIssuevar issuesMu sync.MutexrecordIssues := func(values []InventoryEnrichmentIssue) {@@ -267,7 +276,7 @@ func (c *Client) enrichInventoryTopology(for i := range snapshot.Hosts {i := irun(func() error {- host, hostIssues, err := c.enrichHostTopology(ctx, release, sessionID, snapshot.Hosts[i], cache, datastoreNamesByID)+ host, hostIssues, err := c.enrichHostTopology(ctx, release, sessionID, snapshot.Hosts[i], cache, datastoreNamesByID, clusterDetailsByID)if err != nil {return err}@@ -289,6 +298,7 @@ func (c *Client) enrichInventoryTopology(cache,hostNamesByID,datastoreNamesByID,+ clusterDetailsByID,)if err != nil {return err@@ -315,7 +325,7 @@ func (c *Client) enrichInventoryTopology(wg.Wait()firstErrMu.Lock()- err := firstErr+ err = firstErrfirstErrMu.Unlock()if err != nil {return nil, err@@ -333,6 +343,7 @@ func (c *Client) enrichHostTopology(host InventoryHost,cache *vmwareTopologyCache,datastoreNamesByID map[string]string,+ clusterDetailsByID map[string]InventoryCluster,) (InventoryHost, []InventoryEnrichmentIssue, error) {var issues []InventoryEnrichmentIssuerecordIssue := func(issue *InventoryEnrichmentIssue) {@@ -349,6 +360,7 @@ func (c *Client) enrichHostTopology(return host, nil, err}applyPlacementToHost(&host, placement)+ applyClusterServicesToHost(&host, clusterDetailsByID)datastoreRefs, err := c.collectEntityReferenceList(ctx, release, sessionID, "HostSystem", host.Host, "datastore", "host datastore attachments")if issue, ok := classifyInventoryEnrichmentIssue("topology", "host", host.Host, err); ok {@@ -371,6 +383,7 @@ func (c *Client) enrichVMTopology(cache *vmwareTopologyCache,hostNamesByID map[string]string,datastoreNamesByID map[string]string,+ clusterDetailsByID map[string]InventoryCluster,) (InventoryVM, []InventoryEnrichmentIssue, error) {var issues []InventoryEnrichmentIssuerecordIssue := func(issue *InventoryEnrichmentIssue) {@@ -514,9 +527,42 @@ func (c *Client) enrichVMTopology(vm.DatastoreNames = namesForReferences(datastoreRefs, datastoreNamesByID)applyPlacementToVM(&vm, placement)+ applyClusterServicesToVM(&vm, clusterDetailsByID)return vm, issues, nil}+func (c *Client) collectClusterInventory(+ ctx context.Context,+ automationSessionID string,+) ([]InventoryCluster, error) {+ if strings.TrimSpace(automationSessionID) == "" {+ return nil, nil+ }++ var payload []InventoryCluster+ if err := c.listAutomationResources(ctx, automationSessionID, "/api/vcenter/cluster", "cluster inventory", &payload); err != nil {+ return nil, err+ }++ clusters := make([]InventoryCluster, 0, len(payload))+ for _, cluster := range payload {+ id := strings.TrimSpace(cluster.Cluster)+ if id == "" {+ continue+ }+ clusters = append(clusters, InventoryCluster{+ Cluster: id,+ Name: strings.TrimSpace(cluster.Name),+ HAEnabled: cloneBoolPointer(cluster.HAEnabled),+ DRSEnabled: cloneBoolPointer(cluster.DRSEnabled),+ })+ }+ sort.Slice(clusters, func(i, j int) bool {+ return vmwareSortKey(clusters[i].Cluster, clusters[i].Name) < vmwareSortKey(clusters[j].Cluster, clusters[j].Name)+ })+ return clusters, nil+}+func (c *Client) enrichDatastoreTopology(ctx context.Context,release string,@@ -1133,6 +1179,23 @@ func applyPlacementToHost(host *InventoryHost, placement vmwarePlacement) {host.FolderName = firstNonEmptyTrimmed(host.FolderName, placement.FolderName)}+func applyClusterServicesToHost(host *InventoryHost, clustersByID map[string]InventoryCluster) {+ if host == nil || len(clustersByID) == 0 {+ return+ }+ cluster, ok := clustersByID[strings.TrimSpace(host.ClusterID)]+ if !ok {+ return+ }+ host.ClusterName = firstNonEmptyTrimmed(host.ClusterName, cluster.Name)+ if cluster.HAEnabled != nil {+ host.ClusterHAEnabled = cloneBoolPointer(cluster.HAEnabled)+ }+ if cluster.DRSEnabled != nil {+ host.ClusterDRSEnabled = cloneBoolPointer(cluster.DRSEnabled)+ }+}+func applyPlacementToVM(vm *InventoryVM, placement vmwarePlacement) {if vm == nil {return@@ -1147,6 +1210,23 @@ func applyPlacementToVM(vm *InventoryVM, placement vmwarePlacement) {vm.FolderName = firstNonEmptyTrimmed(vm.FolderName, placement.FolderName)}+func applyClusterServicesToVM(vm *InventoryVM, clustersByID map[string]InventoryCluster) {+ if vm == nil || len(clustersByID) == 0 {+ return+ }+ cluster, ok := clustersByID[strings.TrimSpace(vm.ClusterID)]+ if !ok {+ return+ }+ vm.ClusterName = firstNonEmptyTrimmed(vm.ClusterName, cluster.Name)+ if cluster.HAEnabled != nil {+ vm.ClusterHAEnabled = cloneBoolPointer(cluster.HAEnabled)+ }+ if cluster.DRSEnabled != nil {+ vm.ClusterDRSEnabled = cloneBoolPointer(cluster.DRSEnabled)+ }+}+func applyPlacementToDatastore(datastore *InventoryDatastore, placement vmwarePlacement) {if datastore == nil {return@@ -1187,6 +1267,26 @@ func mergePlacement(dst *vmwarePlacement, src vmwarePlacement) {}}+func inventoryClusterDetailsByID(clusters []InventoryCluster) map[string]InventoryCluster {+ if len(clusters) == 0 {+ return nil+ }+ out := make(map[string]InventoryCluster, len(clusters))+ for _, cluster := range clusters {+ id := strings.TrimSpace(cluster.Cluster)+ if id == "" {+ continue+ }+ out[id] = InventoryCluster{+ Cluster: id,+ Name: strings.TrimSpace(cluster.Name),+ HAEnabled: cloneBoolPointer(cluster.HAEnabled),+ DRSEnabled: cloneBoolPointer(cluster.DRSEnabled),+ }+ }+ return out+}+func idsForReferences(refs []viJSONReference) []string {ids := make([]string, 0, len(refs))for _, ref := range refs {diff --git a/internal/vmware/fixtures.go b/internal/vmware/fixtures.goindex fdeb125ab0..e1a560d4c3 100644--- a/internal/vmware/fixtures.go+++ b/internal/vmware/fixtures.go@@ -13,6 +13,7 @@ func DefaultFixtures() InventorySnapshot {snapshot := defaultFixturesPrimaryCluster(collectedAt, accessible, multipleHostAccess)appendEdgeClusterFixtures(&snapshot, collectedAt, accessible, multipleHostAccess)+ applyInventoryClusterServices(&snapshot)return snapshot}@@ -21,12 +22,20 @@ func defaultFixturesPrimaryCluster(accessible bool,multipleHostAccess bool,) InventorySnapshot {+ primaryHA := true+ primaryDRS := truereturn InventorySnapshot{ConnectionID: "vc-mock-1",ConnectionName: "Lab vCenter",VCenterHost: "vcsa.lab.local",VIRelease: "8.0.3",CollectedAt: collectedAt,+ Clusters: []InventoryCluster{{+ Cluster: "domain-c101",+ Name: "Production Cluster",+ HAEnabled: &primaryHA,+ DRSEnabled: &primaryDRS,+ }},Hosts: []InventoryHost{{Host: "host-101",@@ -604,6 +613,15 @@ func appendEdgeClusterFixtures(edgeFolderDSLbl = "Edge Datastores")+ edgeHA := true+ edgeDRS := false+ snapshot.Clusters = append(snapshot.Clusters, InventoryCluster{+ Cluster: edgeClusterID,+ Name: edgeClusterName,+ HAEnabled: &edgeHA,+ DRSEnabled: &edgeDRS,+ })+edgeDatastoreIDs := []string{"datastore-301", "datastore-302", "datastore-303", "datastore-304"}edgeDatastoreNames := []string{"edge-nvme-tier", "edge-warm-nfs", "edge-vsan", "edge-cold-iscsi"}@@ -802,6 +820,19 @@ func appendEdgeClusterFixtures(}}+func applyInventoryClusterServices(snapshot *InventorySnapshot) {+ if snapshot == nil {+ return+ }+ clustersByID := inventoryClusterDetailsByID(snapshot.Clusters)+ for i := range snapshot.Hosts {+ applyClusterServicesToHost(&snapshot.Hosts[i], clustersByID)+ }+ for i := range snapshot.VMs {+ applyClusterServicesToVM(&snapshot.VMs[i], clustersByID)+ }+}+func guestOSFamily(name string) string {if name == "" {return ""diff --git a/internal/vmware/provider.go b/internal/vmware/provider.goindex a9e6956394..f27ef837ee 100644--- a/internal/vmware/provider.go+++ b/internal/vmware/provider.go@@ -173,6 +173,16 @@ type InventoryEnrichmentIssue struct {Message string `json:"message,omitempty"`}+// InventoryCluster is the vCenter Automation API cluster summary. Pulse keeps+// clusters as read-only topology metadata on hosts and VMs, not top-level+// resources.+type InventoryCluster struct {+ Cluster string `json:"cluster"`+ Name string `json:"name"`+ HAEnabled *bool `json:"ha_enabled,omitempty"`+ DRSEnabled *bool `json:"drs_enabled,omitempty"`+}+// InventoryHost is the canonical phase-1 host summary returned by the vCenter// Automation API list endpoint.type InventoryHost struct {@@ -187,6 +197,8 @@ type InventoryHost struct {ComputeResourceName string `json:"compute_resource_name,omitempty"`ClusterID string `json:"cluster_id,omitempty"`ClusterName string `json:"cluster_name,omitempty"`+ ClusterHAEnabled *bool `json:"cluster_ha_enabled,omitempty"`+ ClusterDRSEnabled *bool `json:"cluster_drs_enabled,omitempty"`FolderID string `json:"folder_id,omitempty"`FolderName string `json:"folder_name,omitempty"`DatastoreIDs []string `json:"datastore_ids,omitempty"`@@ -212,6 +224,8 @@ type InventoryVM struct {ComputeResourceName string `json:"compute_resource_name,omitempty"`ClusterID string `json:"cluster_id,omitempty"`ClusterName string `json:"cluster_name,omitempty"`+ ClusterHAEnabled *bool `json:"cluster_ha_enabled,omitempty"`+ ClusterDRSEnabled *bool `json:"cluster_drs_enabled,omitempty"`FolderID string `json:"folder_id,omitempty"`FolderName string `json:"folder_name,omitempty"`ResourcePoolID string `json:"resource_pool_id,omitempty"`@@ -276,6 +290,7 @@ type InventorySnapshot struct {Hosts []InventoryHostVMs []InventoryVMDatastores []InventoryDatastore+ Clusters []InventoryClusterEnrichmentIssues []InventoryEnrichmentIssue}@@ -498,6 +513,8 @@ func vmwareRecordsFromSnapshot(snapshot *InventorySnapshot, now func() time.TimeComputeResourceName: strings.TrimSpace(host.ComputeResourceName),ClusterID: strings.TrimSpace(host.ClusterID),ClusterName: strings.TrimSpace(host.ClusterName),+ ClusterHAEnabled: cloneBoolPointer(host.ClusterHAEnabled),+ ClusterDRSEnabled: cloneBoolPointer(host.ClusterDRSEnabled),FolderID: strings.TrimSpace(host.FolderID),FolderName: strings.TrimSpace(host.FolderName),ConnectionState: strings.TrimSpace(host.ConnectionState),@@ -560,6 +577,8 @@ func vmwareRecordsFromSnapshot(snapshot *InventorySnapshot, now func() time.TimeComputeResourceName: strings.TrimSpace(vm.ComputeResourceName),ClusterID: strings.TrimSpace(vm.ClusterID),ClusterName: strings.TrimSpace(vm.ClusterName),+ ClusterHAEnabled: cloneBoolPointer(vm.ClusterHAEnabled),+ ClusterDRSEnabled: cloneBoolPointer(vm.ClusterDRSEnabled),FolderID: strings.TrimSpace(vm.FolderID),FolderName: strings.TrimSpace(vm.FolderName),ResourcePoolID: strings.TrimSpace(vm.ResourcePoolID),@@ -698,6 +717,9 @@ func sortInventorySnapshot(snapshot *InventorySnapshot) {sort.Slice(snapshot.Datastores, func(i, j int) bool {return vmwareSortKey(snapshot.Datastores[i].Datastore, snapshot.Datastores[i].Name) < vmwareSortKey(snapshot.Datastores[j].Datastore, snapshot.Datastores[j].Name)})+ sort.Slice(snapshot.Clusters, func(i, j int) bool {+ return vmwareSortKey(snapshot.Clusters[i].Cluster, snapshot.Clusters[i].Name) < vmwareSortKey(snapshot.Clusters[j].Cluster, snapshot.Clusters[j].Name)+ })sort.Slice(snapshot.EnrichmentIssues, func(i, j int) bool {return inventoryEnrichmentIssueSortKey(snapshot.EnrichmentIssues[i]) <inventoryEnrichmentIssueSortKey(snapshot.EnrichmentIssues[j])@@ -712,6 +734,7 @@ func cloneInventorySnapshot(in *InventorySnapshot) *InventorySnapshot {out.Hosts = cloneInventoryHosts(in.Hosts)out.VMs = cloneInventoryVMs(in.VMs)out.Datastores = cloneInventoryDatastores(in.Datastores)+ out.Clusters = cloneInventoryClusters(in.Clusters)out.EnrichmentIssues = cloneInventoryEnrichmentIssues(in.EnrichmentIssues)return &out}@@ -723,6 +746,8 @@ func cloneInventoryHosts(in []InventoryHost) []InventoryHost {out := make([]InventoryHost, len(in))for i := range in {out[i] = in[i]+ out[i].ClusterHAEnabled = cloneBoolPointer(in[i].ClusterHAEnabled)+ out[i].ClusterDRSEnabled = cloneBoolPointer(in[i].ClusterDRSEnabled)out[i].DatastoreIDs = cloneStringSlice(in[i].DatastoreIDs)out[i].DatastoreNames = cloneStringSlice(in[i].DatastoreNames)out[i].TriggeredAlarms = cloneInventoryAlarms(in[i].TriggeredAlarms)@@ -740,6 +765,8 @@ func cloneInventoryVMs(in []InventoryVM) []InventoryVM {out := make([]InventoryVM, len(in))for i := range in {out[i] = in[i]+ out[i].ClusterHAEnabled = cloneBoolPointer(in[i].ClusterHAEnabled)+ out[i].ClusterDRSEnabled = cloneBoolPointer(in[i].ClusterDRSEnabled)out[i].DatastoreIDs = cloneStringSlice(in[i].DatastoreIDs)out[i].DatastoreNames = cloneStringSlice(in[i].DatastoreNames)out[i].GuestIPAddresses = cloneStringSlice(in[i].GuestIPAddresses)@@ -776,6 +803,19 @@ func cloneInventoryDatastores(in []InventoryDatastore) []InventoryDatastore {return out}+func cloneInventoryClusters(in []InventoryCluster) []InventoryCluster {+ if in == nil {+ return nil+ }+ out := make([]InventoryCluster, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].HAEnabled = cloneBoolPointer(in[i].HAEnabled)+ out[i].DRSEnabled = cloneBoolPointer(in[i].DRSEnabled)+ }+ return out+}+func cloneInventoryAlarms(in []InventoryAlarm) []InventoryAlarm {if in == nil {return nildiff --git a/internal/vmware/provider_test.go b/internal/vmware/provider_test.goindex 6be4b040b3..e8b99836d5 100644--- a/internal/vmware/provider_test.go+++ b/internal/vmware/provider_test.go@@ -30,6 +30,8 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {ComputeResourceName: "Prod Compute",ClusterID: "domain-c101",ClusterName: "Prod Compute",+ ClusterHAEnabled: boolPtr(true),+ ClusterDRSEnabled: boolPtr(false),FolderID: "group-h4",FolderName: "Prod Hosts",DatastoreIDs: []string{"datastore-11"},@@ -70,6 +72,8 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {ComputeResourceName: "Prod Compute",ClusterID: "domain-c101",ClusterName: "Prod Compute",+ ClusterHAEnabled: boolPtr(true),+ ClusterDRSEnabled: boolPtr(false),FolderID: "group-v7",FolderName: "Production VMs",ResourcePoolID: "resgroup-22",@@ -246,6 +250,12 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {if got := hostRecord.Resource.VMware.ClusterName; got != "Prod Compute" {t.Fatalf("host cluster name = %q, want Prod Compute", got)}+ if got := hostRecord.Resource.VMware.ClusterHAEnabled; got == nil || !*got {+ t.Fatalf("host cluster HA enabled = %+v, want true", got)+ }+ if got := hostRecord.Resource.VMware.ClusterDRSEnabled; got == nil || *got {+ t.Fatalf("host cluster DRS enabled = %+v, want false", got)+ }if got := hostRecord.Resource.VMware.DatastoreNames; len(got) != 1 || got[0] != "nvme-primary" {t.Fatalf("host datastore names = %#v, want [nvme-primary]", got)}@@ -287,6 +297,12 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {if got := vmRecord.Resource.VMware.ActiveAlarmSummary; got != "VM replication fault (red)" {t.Fatalf("vm active alarm summary = %q, want %q", got, "VM replication fault (red)")}+ if got := vmRecord.Resource.VMware.ClusterHAEnabled; got == nil || !*got {+ t.Fatalf("vm cluster HA enabled = %+v, want true", got)+ }+ if got := vmRecord.Resource.VMware.ClusterDRSEnabled; got == nil || *got {+ t.Fatalf("vm cluster DRS enabled = %+v, want false", got)+ }if got := vmRecord.Resource.VMware.SnapshotCount; got != 2 {t.Fatalf("vm snapshot count = %d, want 2", got)}