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 VM network adapters
rcourtman6a7936ba4e8f
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex c0616981cf..550c54a0af 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, and VM snapshot-tree 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, or child snapshot metadata 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, or snapshot-tree 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, guest-detail, VM snapshot-tree, and VM hardware Ethernet 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.networkAdapters`, adapter MAC address/type, backing network id/name, backing type, connection state, or start-connected / guest-control flags 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, or vNIC 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.diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex aab00d03ed..811caf80cd 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -1151,14 +1151,20 @@ 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, and guest-identity-metadata plus canonical parentage to the owning ESXi `agent`; datastores may+carry runtime-host, folder, resource-pool, datastore, guest-identity, and VM+hardware Ethernet adapter 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`vmware.currentSnapshotId` and `vmware.snapshotTree`, including snapshotmanaged-object reference, display name, description, creation time, powerstate, quiesce flag, current marker, replay support, and child snapshots.+VM hardware Ethernet adapter context belongs under+`vmware.networkAdapters`, including vCenter adapter id, label, emulation+type, MAC address/type, PCI slot, backing type, backing network id/name,+distributed switch/port or opaque-network references, connection state,+start-connected, guest-control, Wake-on-LAN, and UPT compatibility flags.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 9dc33ffd86..e620ba01c3 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@@ -310,6 +310,18 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {guestOsFamily: 'ubuntu64Guest',guestHostname: 'app-01.lab.local',guestIpAddresses: ['192.0.2.50'],+ networkAdapters: [+ {+ nic: '4000',+ label: 'Network adapter 1',+ type: 'VMXNET3',+ macAddress: '00:50:56:aa:bb:cc',+ networkName: 'VM Network',+ state: 'CONNECTED',+ startConnected: true,+ allowGuestControl: true,+ },+ ],activeAlarmCount: 1,activeAlarmSummary: 'Host fan degraded',recentTaskCount: 1,@@ -352,6 +364,18 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {guestOsFamily: 'ubuntu64Guest',guestHostname: 'app-01.lab.local',guestIpAddresses: ['192.0.2.50'],+ networkAdapters: [+ {+ nic: '4000',+ label: 'Network adapter 1',+ type: 'VMXNET3',+ macAddress: '00:50:56:aa:bb:cc',+ networkName: 'VM Network',+ state: 'CONNECTED',+ startConnected: true,+ allowGuestControl: true,+ },+ ],activeAlarmCount: 1,activeAlarmSummary: 'Host fan degraded',recentTaskCount: 1,@@ -387,7 +411,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {expect(getByTestId('resource-vmware-details-section')).toBeInTheDocument();expect(- getByText('Lab VC · Read-only vCenter context · 2 snapshots · 1 alarm · 1 task'),+ getByText('Lab VC · Read-only vCenter context · 2 snapshots · 1 vNIC · 1 alarm · 1 task'),).toBeInTheDocument();expect(queryByText('Compute Cluster')).toBeNull();expect(queryByText('Create snapshot (success)')).toBeNull();@@ -402,12 +426,15 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {expect(within(section).getByText('State')).toBeInTheDocument();expect(within(section).getByText('Placement')).toBeInTheDocument();expect(within(section).getByText('Guest')).toBeInTheDocument();+ expect(within(section).getByText('Network')).toBeInTheDocument();expect(within(section).getByText('Signals')).toBeInTheDocument();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('esxi-01.lab.local')).toBeInTheDocument();expect(within(section).getByText('ubuntu64Guest')).toBeInTheDocument();+ expect(within(section).getByText('Network adapter 1')).toBeInTheDocument();+ expect(within(section).getByText(/VMXNET3 · VM Network/)).toBeInTheDocument();expect(within(section).getByText(/Create snapshot \(success\)/)).toBeInTheDocument();expect(within(section).getByText(/Host fan degraded/)).toBeInTheDocument();expect(within(section).getByText('2 snapshots')).toBeInTheDocument();diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.tsindex c2477ab969..81778a46d5 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.test.ts@@ -9,6 +9,21 @@ describe('resourceDetailDrawerVmwareModel', () => {it('surfaces vSphere snapshot trees as read-only VM detail context', () => {const vmware: ResourceVMwareMeta = {connectionName: 'Lab VC',+ networkAdapters: [+ {+ nic: '4000',+ label: 'Network adapter 1',+ type: 'VMXNET3',+ macType: 'GENERATED',+ macAddress: '00:50:56:aa:bb:cc',+ backingType: 'STANDARD_PORTGROUP',+ networkId: 'network-101',+ networkName: 'VM Network',+ state: 'CONNECTED',+ startConnected: true,+ allowGuestControl: true,+ },+ ],snapshotTree: [{snapshot: 'snapshot-201',@@ -31,9 +46,21 @@ describe('resourceDetailDrawerVmwareModel', () => {};expect(buildVMwareDetailsSummary('vm', vmware)).toBe(- 'Lab VC · Read-only vCenter context · 2 snapshots',+ 'Lab VC · Read-only vCenter context · 2 snapshots · 1 vNIC',+ );++ const network = buildVMwareDetailSections('vm', vmware).find(+ (section) => section.id === 'network',);+ expect(network?.rows).toEqual([+ {+ label: 'Network adapter 1',+ value: 'VMXNET3 · VM Network · 00:50:56:aa:bb:cc · CONNECTED · starts connected · guest control',+ tone: 'default',+ },+ ]);+const snapshots = buildVMwareDetailSections('vm', vmware).find((section) => section.id === 'snapshots',);diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.tsindex 7f90a442c5..7c1893537f 100644--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts@@ -1,4 +1,9 @@-import type { ResourceType, ResourceVMwareMeta, ResourceVMwareSnapshot } from '@/types/resource';+import type {+ ResourceType,+ ResourceVMwareMeta,+ ResourceVMwareNetworkAdapter,+ ResourceVMwareSnapshot,+} from '@/types/resource';export type ResourceDetailDrawerVMwareRowTone = 'default' | 'accent' | 'warning';@@ -9,7 +14,7 @@ export type ResourceDetailDrawerVMwareRow = {};export type ResourceDetailDrawerVMwareSection = {- id: 'state' | 'placement' | 'guest' | 'signals' | 'snapshots';+ id: 'state' | 'placement' | 'guest' | 'network' | 'signals' | 'snapshots';label: string;rows: ResourceDetailDrawerVMwareRow[];};@@ -72,6 +77,60 @@ const flattenSnapshotRows = (return rows;};+const adapterDisplayName = (adapter: ResourceVMwareNetworkAdapter): string =>+ asTrimmedString(adapter.label) ||+ asTrimmedString(adapter.nic) ||+ asTrimmedString(adapter.macAddress) ||+ 'Network adapter';++const adapterNetworkName = (adapter: ResourceVMwareNetworkAdapter): string =>+ asTrimmedString(adapter.networkName) ||+ asTrimmedString(adapter.networkId) ||+ asTrimmedString(adapter.opaqueNetworkId) ||+ asTrimmedString(adapter.hostDevice) ||+ asTrimmedString(adapter.backingType);++const adapterConnectionLabel = (adapter: ResourceVMwareNetworkAdapter): string => {+ const parts = [+ asTrimmedString(adapter.state),+ adapter.startConnected === undefined+ ? ''+ : adapter.startConnected+ ? 'starts connected'+ : 'does not start connected',+ adapter.allowGuestControl === undefined+ ? ''+ : adapter.allowGuestControl+ ? 'guest control'+ : 'no guest control',+ ].filter(Boolean);+ return parts.join(' · ');+};++const adapterValue = (adapter: ResourceVMwareNetworkAdapter): string => {+ const parts = [+ asTrimmedString(adapter.type),+ adapterNetworkName(adapter),+ asTrimmedString(adapter.macAddress),+ adapterConnectionLabel(adapter),+ ].filter(Boolean);+ return parts.join(' · ');+};++const adapterTone = (adapter: ResourceVMwareNetworkAdapter): ResourceDetailDrawerVMwareRowTone =>+ asTrimmedString(adapter.state).toLowerCase() === 'not_connected' ? 'warning' : 'default';++const networkAdapterRows = (+ adapters: ResourceVMwareNetworkAdapter[] | undefined,+): ResourceDetailDrawerVMwareRow[] =>+ (adapters ?? [])+ .map((adapter) => ({+ label: adapterDisplayName(adapter),+ value: adapterValue(adapter),+ tone: adapterTone(adapter),+ }))+ .filter((row) => row.value);+const vmwareEntityLabel = (entityType?: string): string => {const normalized = asTrimmedString(entityType).toLowerCase();switch (normalized) {@@ -139,6 +198,10 @@ export const buildVMwareDetailsSummary = (if (resourceType === 'vm' && snapshotCount > 0) {parts.push(formatCount(snapshotCount, 'snapshot'));}+ const networkAdapterCount = vmware.networkAdapters?.length ?? 0;+ if (resourceType === 'vm' && networkAdapterCount > 0) {+ parts.push(formatCount(networkAdapterCount, 'vNIC'));+ }if ((vmware.activeAlarmCount ?? 0) > 0) {parts.push(formatCount(vmware.activeAlarmCount ?? 0, 'alarm'));}@@ -265,6 +328,8 @@ export const buildVMwareDetailSections = (},]);+ const networkRows = resourceType === 'vm' ? networkAdapterRows(vmware.networkAdapters) : [];+const signalRows = filterNonEmptyRows([{label: 'Alarms',@@ -299,6 +364,7 @@ export const buildVMwareDetailSections = ({ id: 'state', label: 'State', rows: stateRows },{ id: 'placement', label: 'Placement', rows: placementRows },{ id: 'guest', label: 'Guest', rows: guestRows },+ { id: 'network', label: 'Network', rows: networkRows },{ id: 'signals', label: 'Signals', rows: signalRows },{ id: 'snapshots', label: 'Snapshot tree', rows: snapshotRows },];diff --git a/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx b/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsxindex 1af01e8aea..31f5de4065 100644--- a/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereVirtualMachinesTable.tsx@@ -33,7 +33,11 @@ import {createPlatformResourceLabelResolver,getPlatformResourceDetailRowClass,} from '@/features/platformPage/PlatformResourceDetailTableRow';-import type { Resource, ResourceVMwareSnapshot } from '@/types/resource';+import type {+ Resource,+ ResourceVMwareNetworkAdapter,+ ResourceVMwareSnapshot,+} from '@/types/resource';import {filterVmwareVirtualMachines,mapVmwareVirtualMachineStatus,@@ -136,6 +140,35 @@ const flattenSnapshotNames = (snapshots: ResourceVMwareSnapshot[] | undefined):return names;};+const networkAdapterName = (adapter: ResourceVMwareNetworkAdapter): string =>+ asTrimmedString(adapter.networkName) ||+ asTrimmedString(adapter.networkId) ||+ asTrimmedString(adapter.opaqueNetworkId) ||+ asTrimmedString(adapter.hostDevice) ||+ asTrimmedString(adapter.macAddress) ||+ asTrimmedString(adapter.label) ||+ '';++const networkAdapterTitle = (adapter: ResourceVMwareNetworkAdapter): string =>+ [+ asTrimmedString(adapter.label),+ asTrimmedString(adapter.type),+ networkAdapterName(adapter),+ asTrimmedString(adapter.macAddress),+ asTrimmedString(adapter.state),+ ]+ .filter(Boolean)+ .join(' · ');++const networkSummary = (+ adapters: ResourceVMwareNetworkAdapter[] | undefined,+): { label: string; title: string } => {+ const names = (adapters ?? []).map(networkAdapterName).filter(Boolean);+ const summary = summarizeValues(names, '-', 1);+ const title = (adapters ?? []).map(networkAdapterTitle).filter(Boolean).join(' | ');+ return { label: summary.label, title: title || summary.title };+};+const formatGuest = (resource: Resource): { label: string; detail: string; title: string } => {const family = asTrimmedString(resource.vmware?.guestOsFamily);const host = asTrimmedString(resource.vmware?.guestHostname);@@ -265,7 +298,7 @@ export const VsphereVirtualMachinesTable: Component<{><TableCard class={PLATFORM_TABLE_CARD_CLASS}><TableCardHeader title="Virtual Machines" />- <Table class="min-w-full table-fixed text-xs md:min-w-[1440px]">+ <Table class="min-w-full table-fixed text-xs md:min-w-[1520px]"><TableHeader><TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}><TableHead class={`${getPlatformTableHeadClassForKind('name')} md:w-[18%]`}>@@ -285,15 +318,20 @@ export const VsphereVirtualMachinesTable: Component<{Cluster</TableHead><TableHead- class={`${getPlatformTableHeadClassForKind('text')} hidden lg:table-cell md:w-[10%]`}+ class={`${getPlatformTableHeadClassForKind('text')} hidden lg:table-cell md:w-[8%]`}>Pool</TableHead><TableHead- class={`${getPlatformTableHeadClassForKind('text')} hidden lg:table-cell md:w-[12%]`}+ class={`${getPlatformTableHeadClassForKind('text')} hidden lg:table-cell md:w-[10%]`}>Guest</TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden xl:table-cell md:w-[9%]`}+ >+ Network+ </TableHead><TableHead class={`${getPlatformTableHeadClassForKind('metric-bar')} md:w-[9%]`}>CPU</TableHead>@@ -316,11 +354,11 @@ export const VsphereVirtualMachinesTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={groups()}>- {(group) => (- <>- <TableRow class="bg-surface-alt/70 text-[11px] font-semibold text-base-content">- <TableCell colSpan={11} class="px-2 py-1">+ <For each={groups()}>+ {(group) => (+ <>+ <TableRow class="bg-surface-alt/70 text-[11px] font-semibold text-base-content">+ <TableCell colSpan={12} class="px-2 py-1"><span>{group.label}</span><Show when={group.cluster}><span class="ml-2 rounded border border-border bg-surface px-1.5 py-0.5 text-[10px] font-medium text-muted">@@ -345,6 +383,7 @@ export const VsphereVirtualMachinesTable: Component<{'-';const pool = () => asTrimmedString(meta()?.resourcePoolName) || '-';const guest = createMemo(() => formatGuest(vm));+ const network = createMemo(() => networkSummary(meta()?.networkAdapters));const datastores = createMemo(() =>summarizeValues(meta()?.datastoreNames ?? [], '-', 1),);@@ -449,6 +488,12 @@ export const VsphereVirtualMachinesTable: Component<{</span></Show></TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content xl:table-cell`}+ title={network().title}+ >+ <span class="block truncate">{network().label}</span>+ </TableCell><TableCellclass={`${getPlatformTableCellClassForKind('metric-bar')} w-[20%] md:w-auto`}>@@ -496,7 +541,7 @@ export const VsphereVirtualMachinesTable: Component<{resource={vm}open={isExpanded()}detailRowId={detailRowId()}- colSpan={11}+ colSpan={12}resolveResourceLabel={resolveResourceLabel}onClose={() => drawer.close(vm)}/>diff --git a/frontend-modern/src/features/vmware/__tests__/VsphereVirtualMachinesTable.test.tsx b/frontend-modern/src/features/vmware/__tests__/VsphereVirtualMachinesTable.test.tsxindex d1480d671e..f000badb12 100644--- a/frontend-modern/src/features/vmware/__tests__/VsphereVirtualMachinesTable.test.tsx+++ b/frontend-modern/src/features/vmware/__tests__/VsphereVirtualMachinesTable.test.tsx@@ -34,6 +34,15 @@ const makeVM = (overrides: Partial<Resource> & Pick<Resource, 'id'>): Resource =guestOsFamily: 'LINUX',guestHostname: 'warehouse-api-01.internal',guestIpAddresses: ['10.42.10.21'],+ networkAdapters: [+ {+ label: 'Network adapter 1',+ type: 'VMXNET3',+ macAddress: '00:50:56:aa:bb:cc',+ networkName: 'VM Network',+ state: 'CONNECTED',+ },+ ],datastoreNames: ['nvme-primary', 'backup-nfs'],snapshotTree: [{@@ -88,6 +97,7 @@ describe('VsphereVirtualMachinesTable', () => {expect(within(table).getByText('Host')).toBeInTheDocument();expect(within(table).getByText('Pool')).toBeInTheDocument();expect(within(table).getByText('Guest')).toBeInTheDocument();+ expect(within(table).getByText('Network')).toBeInTheDocument();expect(within(table).getByText('Snapshots')).toBeInTheDocument();expect(within(table).getByText('Health')).toBeInTheDocument();expect(within(table).queryByRole('columnheader', { name: 'ID' })).not.toBeInTheDocument();@@ -96,6 +106,7 @@ describe('VsphereVirtualMachinesTable', () => {expect(screen.getAllByText('esxi-01.lab.local')).toHaveLength(2);expect(screen.getByText('Tier 1')).toBeInTheDocument();expect(screen.getByText('warehouse-api-01.internal')).toBeInTheDocument();+ expect(screen.getByText('VM Network')).toBeInTheDocument();expect(screen.getByText('nvme-primary +1')).toBeInTheDocument();expect(screen.getByText('Healthy')).toBeInTheDocument();expect(screen.getByTitle('pre-upgrade, post-upgrade (current)')).toHaveTextContent('2');diff --git a/frontend-modern/src/features/vmware/vmwarePageModel.ts b/frontend-modern/src/features/vmware/vmwarePageModel.tsindex 38cb856ffc..a045d998d2 100644--- a/frontend-modern/src/features/vmware/vmwarePageModel.ts+++ b/frontend-modern/src/features/vmware/vmwarePageModel.ts@@ -704,6 +704,23 @@ const vmwareVirtualMachineSearchHaystack = (resource: Resource): string =>resource.vmware?.guestHostname,resource.vmware?.guestIpAddresses?.join(' '),resource.vmware?.datastoreNames?.join(' '),+ resource.vmware?.networkAdapters+ ?.map((adapter) =>+ [+ adapter.label,+ adapter.type,+ adapter.macAddress,+ adapter.backingType,+ adapter.networkId,+ adapter.networkName,+ adapter.opaqueNetworkId,+ adapter.hostDevice,+ adapter.state,+ ]+ .filter(Boolean)+ .join(' '),+ )+ .join(' '),resource.vmware?.activeAlarmSummary,resource.vmware?.recentTaskSummary,...(resource.tags ?? []),diff --git a/frontend-modern/src/types/__tests__/resource.test.ts b/frontend-modern/src/types/__tests__/resource.test.tsindex c77de0f060..a151af531b 100644--- a/frontend-modern/src/types/__tests__/resource.test.ts+++ b/frontend-modern/src/types/__tests__/resource.test.ts@@ -269,6 +269,20 @@ describe('Resource Helper Functions', () => {recentTaskSummary: 'Clone VM task finished',snapshotCount: 3,currentSnapshotId: 'snapshot-103',+ networkAdapters: [+ {+ nic: '4000',+ label: 'Network adapter 1',+ type: 'VMXNET3',+ macAddress: '00:50:56:aa:bb:cc',+ backingType: 'STANDARD_PORTGROUP',+ networkId: 'network-101',+ networkName: 'VM Network',+ state: 'CONNECTED',+ startConnected: true,+ allowGuestControl: true,+ },+ ],snapshotTree: [{snapshot: 'snapshot-101',@@ -297,6 +311,7 @@ describe('Resource Helper Functions', () => {expect(vmware.recentTaskSummary).toBe('Clone VM task finished');expect(vmware.snapshotCount).toBe(3);expect(vmware.currentSnapshotId).toBe('snapshot-103');+ expect(vmware.networkAdapters?.[0]?.networkName).toBe('VM Network');expect(vmware.snapshotTree?.[0]?.children?.[0]?.current).toBe(true);});});diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex 4b25a9ead3..7fe7d8a4dd 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -838,6 +838,29 @@ export interface ResourceVMwareSnapshot {children?: ResourceVMwareSnapshot[];}+export interface ResourceVMwareNetworkAdapter {+ nic?: string;+ label?: string;+ type?: string;+ macType?: string;+ macAddress?: string;+ pciSlotNumber?: number;+ backingType?: string;+ networkId?: string;+ networkName?: string;+ distributedSwitchUuid?: string;+ distributedPort?: string;+ opaqueNetworkType?: string;+ opaqueNetworkId?: string;+ hostDevice?: string;+ state?: string;+ startConnected?: boolean;+ allowGuestControl?: boolean;+ wakeOnLanEnabled?: boolean;+ uptCompatibilityEnabled?: boolean;+ uptV2CompatibilityEnabled?: boolean;+}+export interface ResourceVMwareMeta {connectionId?: string;connectionName?: string;@@ -881,6 +904,7 @@ export interface ResourceVMwareMeta {snapshotCount?: number;currentSnapshotId?: string;snapshotTree?: ResourceVMwareSnapshot[];+ networkAdapters?: ResourceVMwareNetworkAdapter[];}export interface ResourceAvailabilityMeta {diff --git a/internal/unifiedresources/canonical_identity_test.go b/internal/unifiedresources/canonical_identity_test.goindex 832b8ce717..011afa5e78 100644--- a/internal/unifiedresources/canonical_identity_test.go+++ b/internal/unifiedresources/canonical_identity_test.go@@ -491,6 +491,19 @@ func TestRefreshCanonicalIdentityIgnoresVMwarePlacementDetailAliases(t *testing.InstanceUUID: "vm-instance-uuid-1",BIOSUUID: "vm-bios-uuid-1",CurrentSnapshotID: "snapshot-202",+ NetworkAdapters: []VMwareNetworkAdapterData{{+ NIC: "4000",+ Label: "Network adapter 1",+ Type: "VMXNET3",+ MACType: "GENERATED",+ MACAddress: "00:50:56:aa:bb:cc",+ BackingType: "STANDARD_PORTGROUP",+ NetworkID: "network-101",+ NetworkName: "VM Network",+ State: "CONNECTED",+ StartConnected: true,+ AllowGuestControl: true,+ }},SnapshotTree: []VMwareSnapshotData{{Snapshot: "snapshot-201",Name: "pre-upgrade",@@ -550,6 +563,15 @@ func TestRefreshCanonicalIdentityIgnoresVMwarePlacementDetailAliases(t *testing."post-upgrade","Before application upgrade","poweredOn",+ "4000",+ "Network adapter 1",+ "VMXNET3",+ "GENERATED",+ "00:50:56:aa:bb:cc",+ "STANDARD_PORTGROUP",+ "network-101",+ "VM Network",+ "CONNECTED",}for _, disallowed := range disallowedAliases {for _, alias := range resource.Canonical.Aliases {diff --git a/internal/unifiedresources/clone.go b/internal/unifiedresources/clone.goindex 5fc2b006ad..c11a3e26f7 100644--- a/internal/unifiedresources/clone.go+++ b/internal/unifiedresources/clone.go@@ -267,9 +267,36 @@ func cloneVMwareData(in *VMwareData) *VMwareData {out.DatastoreAccessible = cloneBoolPtr(in.DatastoreAccessible)out.MultipleHostAccess = cloneBoolPtr(in.MultipleHostAccess)out.GuestIPAddresses = cloneStringSlice(in.GuestIPAddresses)+ out.SnapshotTree = cloneVMwareSnapshotDataSlice(in.SnapshotTree)+ out.NetworkAdapters = cloneVMwareNetworkAdapterDataSlice(in.NetworkAdapters)return &out}+func cloneVMwareSnapshotDataSlice(in []VMwareSnapshotData) []VMwareSnapshotData {+ if in == nil {+ return nil+ }+ out := make([]VMwareSnapshotData, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].CreatedAt = cloneTimePtr(in[i].CreatedAt)+ out[i].Children = cloneVMwareSnapshotDataSlice(in[i].Children)+ }+ return out+}++func cloneVMwareNetworkAdapterDataSlice(in []VMwareNetworkAdapterData) []VMwareNetworkAdapterData {+ if in == nil {+ return nil+ }+ out := make([]VMwareNetworkAdapterData, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].PCISlotNumber = cloneInt64Ptr(in[i].PCISlotNumber)+ }+ return out+}+func clonePMGRelayDomainMetaSlice(in []PMGRelayDomainMeta) []PMGRelayDomainMeta {if in == nil {return nildiff --git a/internal/unifiedresources/clone_test.go b/internal/unifiedresources/clone_test.goindex e0fd14da87..13e8cd6511 100644--- a/internal/unifiedresources/clone_test.go+++ b/internal/unifiedresources/clone_test.go@@ -149,6 +149,55 @@ func TestCloneResource_MutateParentBySource(t *testing.T) {}}+func TestCloneResource_MutateVMwareDetailSlices(t *testing.T) {+ createdAt := time.Date(2026, time.March, 30, 18, 15, 0, 0, time.UTC)+ pciSlot := int64(160)+ original := &Resource{+ ID: "vmware-vm-1",+ VMware: &VMwareData{+ SnapshotTree: []VMwareSnapshotData{{+ Snapshot: "snapshot-201",+ Name: "pre-upgrade",+ CreatedAt: &createdAt,+ Children: []VMwareSnapshotData{{+ Snapshot: "snapshot-202",+ Name: "post-upgrade",+ }},+ }},+ NetworkAdapters: []VMwareNetworkAdapterData{{+ NIC: "4000",+ Label: "Network adapter 1",+ NetworkName: "VM Network",+ MACAddress: "00:50:56:aa:bb:cc",+ PCISlotNumber: &pciSlot,+ }},+ },+ }++ cloned := cloneResource(original)+ cloned.VMware.SnapshotTree[0].Name = "mutated"+ cloned.VMware.SnapshotTree[0].Children[0].Name = "mutated-child"+ *cloned.VMware.SnapshotTree[0].CreatedAt = createdAt.Add(time.Hour)+ cloned.VMware.NetworkAdapters[0].NetworkName = "mutated-network"+ *cloned.VMware.NetworkAdapters[0].PCISlotNumber = 161++ if original.VMware.SnapshotTree[0].Name != "pre-upgrade" {+ t.Fatalf("mutating cloned VMware snapshot should not affect original: %+v", original.VMware.SnapshotTree)+ }+ if original.VMware.SnapshotTree[0].Children[0].Name != "post-upgrade" {+ t.Fatalf("mutating cloned VMware child snapshot should not affect original: %+v", original.VMware.SnapshotTree)+ }+ if !original.VMware.SnapshotTree[0].CreatedAt.Equal(createdAt) {+ t.Fatalf("mutating cloned VMware snapshot time should not affect original: %+v", original.VMware.SnapshotTree[0].CreatedAt)+ }+ if original.VMware.NetworkAdapters[0].NetworkName != "VM Network" {+ t.Fatalf("mutating cloned VMware adapter should not affect original: %+v", original.VMware.NetworkAdapters)+ }+ if *original.VMware.NetworkAdapters[0].PCISlotNumber != 160 {+ t.Fatalf("mutating cloned VMware adapter PCI slot should not affect original: %+v", original.VMware.NetworkAdapters[0].PCISlotNumber)+ }+}+// --- cloneProxmoxData ---func TestCloneProxmoxData_Nil(t *testing.T) {diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.goindex 232dcd9377..7edbea699c 100644--- a/internal/unifiedresources/code_standards_test.go+++ b/internal/unifiedresources/code_standards_test.go@@ -1992,3 +1992,27 @@ func TestBroadcastStateUsesSharedCanonicalResourceContract(t *testing.T) {}}}++func TestCloneVMwareDataKeepsNestedRuntimeDetailsIsolated(t *testing.T) {+ repoRoot := filepath.Join("..", "..")+ clonePath := filepath.Join(repoRoot, "internal", "unifiedresources", "clone.go")++ cloneSource, err := os.ReadFile(clonePath)+ if err != nil {+ t.Fatalf("failed to read %s: %v", clonePath, err)+ }+ source := string(cloneSource)++ requiredSnippets := []string{+ "out.SnapshotTree = cloneVMwareSnapshotDataSlice(in.SnapshotTree)",+ "out.NetworkAdapters = cloneVMwareNetworkAdapterDataSlice(in.NetworkAdapters)",+ "out[i].CreatedAt = cloneTimePtr(in[i].CreatedAt)",+ "out[i].Children = cloneVMwareSnapshotDataSlice(in[i].Children)",+ "out[i].PCISlotNumber = cloneInt64Ptr(in[i].PCISlotNumber)",+ }+ for _, snippet := range requiredSnippets {+ if !strings.Contains(source, snippet) {+ t.Fatalf("%s: VMware clone isolation must include %q", filepath.ToSlash(clonePath), snippet)+ }+ }+}diff --git a/internal/unifiedresources/types.go b/internal/unifiedresources/types.goindex 71d99f53a6..f4ae966fbf 100644--- a/internal/unifiedresources/types.go+++ b/internal/unifiedresources/types.go@@ -995,48 +995,49 @@ type PMGData struct {// VMwareData contains VMware vSphere metadata for canonical agent, vm, and// storage resources projected from one vCenter connection.type VMwareData struct {- ConnectionID string `json:"connectionId,omitempty"`- ConnectionName string `json:"connectionName,omitempty"`- VCenterHost string `json:"vcenterHost,omitempty"`- ManagedObjectID string `json:"managedObjectId,omitempty"`- EntityType string `json:"entityType,omitempty"`- HostUUID string `json:"hostUuid,omitempty"`- DatacenterID string `json:"datacenterId,omitempty"`- DatacenterName string `json:"datacenterName,omitempty"`- ComputeResourceID string `json:"computeResourceId,omitempty"`- ComputeResourceName string `json:"computeResourceName,omitempty"`- ClusterID string `json:"clusterId,omitempty"`- ClusterName string `json:"clusterName,omitempty"`- FolderID string `json:"folderId,omitempty"`- FolderName string `json:"folderName,omitempty"`- ResourcePoolID string `json:"resourcePoolId,omitempty"`- ResourcePoolName string `json:"resourcePoolName,omitempty"`- RuntimeHostID string `json:"runtimeHostId,omitempty"`- RuntimeHostName string `json:"runtimeHostName,omitempty"`- ConnectionState string `json:"connectionState,omitempty"`- PowerState string `json:"powerState,omitempty"`- OverallStatus string `json:"overallStatus,omitempty"`- CPUCount int `json:"cpuCount,omitempty"`- MemorySizeMiB int64 `json:"memorySizeMib,omitempty"`- DatastoreType string `json:"datastoreType,omitempty"`- DatastoreIDs []string `json:"datastoreIds,omitempty"`- DatastoreNames []string `json:"datastoreNames,omitempty"`- DatastoreURL string `json:"datastoreUrl,omitempty"`- DatastoreAccessible *bool `json:"datastoreAccessible,omitempty"`- MultipleHostAccess *bool `json:"multipleHostAccess,omitempty"`- MaintenanceMode string `json:"maintenanceMode,omitempty"`- InstanceUUID string `json:"instanceUuid,omitempty"`- BIOSUUID string `json:"biosUuid,omitempty"`- GuestOSFamily string `json:"guestOsFamily,omitempty"`- GuestHostname string `json:"guestHostname,omitempty"`- GuestIPAddresses []string `json:"guestIpAddresses,omitempty"`- ActiveAlarmCount int `json:"activeAlarmCount,omitempty"`- ActiveAlarmSummary string `json:"activeAlarmSummary,omitempty"`- RecentTaskCount int `json:"recentTaskCount,omitempty"`- RecentTaskSummary string `json:"recentTaskSummary,omitempty"`- SnapshotCount int `json:"snapshotCount,omitempty"`- CurrentSnapshotID string `json:"currentSnapshotId,omitempty"`- SnapshotTree []VMwareSnapshotData `json:"snapshotTree,omitempty"`+ ConnectionID string `json:"connectionId,omitempty"`+ ConnectionName string `json:"connectionName,omitempty"`+ VCenterHost string `json:"vcenterHost,omitempty"`+ ManagedObjectID string `json:"managedObjectId,omitempty"`+ EntityType string `json:"entityType,omitempty"`+ HostUUID string `json:"hostUuid,omitempty"`+ DatacenterID string `json:"datacenterId,omitempty"`+ DatacenterName string `json:"datacenterName,omitempty"`+ ComputeResourceID string `json:"computeResourceId,omitempty"`+ ComputeResourceName string `json:"computeResourceName,omitempty"`+ ClusterID string `json:"clusterId,omitempty"`+ ClusterName string `json:"clusterName,omitempty"`+ FolderID string `json:"folderId,omitempty"`+ FolderName string `json:"folderName,omitempty"`+ ResourcePoolID string `json:"resourcePoolId,omitempty"`+ ResourcePoolName string `json:"resourcePoolName,omitempty"`+ RuntimeHostID string `json:"runtimeHostId,omitempty"`+ RuntimeHostName string `json:"runtimeHostName,omitempty"`+ ConnectionState string `json:"connectionState,omitempty"`+ PowerState string `json:"powerState,omitempty"`+ OverallStatus string `json:"overallStatus,omitempty"`+ CPUCount int `json:"cpuCount,omitempty"`+ MemorySizeMiB int64 `json:"memorySizeMib,omitempty"`+ DatastoreType string `json:"datastoreType,omitempty"`+ DatastoreIDs []string `json:"datastoreIds,omitempty"`+ DatastoreNames []string `json:"datastoreNames,omitempty"`+ DatastoreURL string `json:"datastoreUrl,omitempty"`+ DatastoreAccessible *bool `json:"datastoreAccessible,omitempty"`+ MultipleHostAccess *bool `json:"multipleHostAccess,omitempty"`+ MaintenanceMode string `json:"maintenanceMode,omitempty"`+ InstanceUUID string `json:"instanceUuid,omitempty"`+ BIOSUUID string `json:"biosUuid,omitempty"`+ GuestOSFamily string `json:"guestOsFamily,omitempty"`+ GuestHostname string `json:"guestHostname,omitempty"`+ GuestIPAddresses []string `json:"guestIpAddresses,omitempty"`+ ActiveAlarmCount int `json:"activeAlarmCount,omitempty"`+ ActiveAlarmSummary string `json:"activeAlarmSummary,omitempty"`+ RecentTaskCount int `json:"recentTaskCount,omitempty"`+ RecentTaskSummary string `json:"recentTaskSummary,omitempty"`+ SnapshotCount int `json:"snapshotCount,omitempty"`+ CurrentSnapshotID string `json:"currentSnapshotId,omitempty"`+ SnapshotTree []VMwareSnapshotData `json:"snapshotTree,omitempty"`+ NetworkAdapters []VMwareNetworkAdapterData `json:"networkAdapters,omitempty"`}// VMwareSnapshotData contains one node in the vSphere VM snapshot tree. It is@@ -1054,6 +1055,31 @@ type VMwareSnapshotData struct {Children []VMwareSnapshotData `json:"children,omitempty"`}+// VMwareNetworkAdapterData contains vCenter VM hardware Ethernet adapter facts+// as read-only workload context, not a Pulse network-control model.+type VMwareNetworkAdapterData struct {+ NIC string `json:"nic,omitempty"`+ Label string `json:"label,omitempty"`+ Type string `json:"type,omitempty"`+ MACType string `json:"macType,omitempty"`+ MACAddress string `json:"macAddress,omitempty"`+ PCISlotNumber *int64 `json:"pciSlotNumber,omitempty"`+ BackingType string `json:"backingType,omitempty"`+ NetworkID string `json:"networkId,omitempty"`+ NetworkName string `json:"networkName,omitempty"`+ DistributedSwitchUUID string `json:"distributedSwitchUuid,omitempty"`+ DistributedPort string `json:"distributedPort,omitempty"`+ OpaqueNetworkType string `json:"opaqueNetworkType,omitempty"`+ OpaqueNetworkID string `json:"opaqueNetworkId,omitempty"`+ HostDevice string `json:"hostDevice,omitempty"`+ State string `json:"state,omitempty"`+ StartConnected bool `json:"startConnected"`+ AllowGuestControl bool `json:"allowGuestControl"`+ WakeOnLANEnabled bool `json:"wakeOnLanEnabled"`+ UPTCompatibility bool `json:"uptCompatibilityEnabled,omitempty"`+ UPTV2Compatibility bool `json:"uptV2CompatibilityEnabled,omitempty"`+}+// TrueNASData contains TrueNAS-specific metadata for TrueNAS resources.type TrueNASData struct {Hostname string `json:"hostname,omitempty"`diff --git a/internal/vmware/client_test.go b/internal/vmware/client_test.goindex 666b537d30..498a83c93b 100644--- a/internal/vmware/client_test.go+++ b/internal/vmware/client_test.go@@ -75,6 +75,22 @@ func TestClientCollectInventoryEnrichesSignals(t *testing.T) {if vm.GuestHostname != "app-01.internal" || len(vm.GuestIPAddresses) != 1 || vm.GuestIPAddresses[0] != "10.0.0.21" {t.Fatalf("expected VM guest identity enrichment, got host=%q ips=%v", vm.GuestHostname, vm.GuestIPAddresses)}+ if len(vm.NetworkAdapters) != 1 {+ t.Fatalf("expected one VM network adapter, got %+v", vm.NetworkAdapters)+ }+ adapter := vm.NetworkAdapters[0]+ if adapter.NIC != "4000" || adapter.Label != "Network adapter 1" || adapter.Type != "VMXNET3" {+ t.Fatalf("unexpected VM network adapter identity: %+v", adapter)+ }+ if adapter.MACAddress != "00:50:56:aa:bb:cc" || adapter.NetworkName != "VM Network" || adapter.State != "CONNECTED" {+ t.Fatalf("unexpected VM network adapter backing/state: %+v", adapter)+ }+ if adapter.PCISlotNumber == nil || *adapter.PCISlotNumber != 160 {+ t.Fatalf("expected VM network adapter PCI slot, got %+v", adapter.PCISlotNumber)+ }+ if !adapter.StartConnected || !adapter.AllowGuestControl || !adapter.WakeOnLANEnabled {+ t.Fatalf("expected VM network adapter connection flags, got %+v", adapter)+ }if vm.SnapshotCount != 2 {t.Fatalf("vm snapshot count = %d, want 2", vm.SnapshotCount)}@@ -168,6 +184,9 @@ func TestClientCollectInventoryPreservesBaseInventoryWhenOptionalEnrichmentDegraif vm.GuestHostname != "" || len(vm.GuestIPAddresses) != 0 {t.Fatalf("expected guest identity to stay empty after degraded topology read, got host=%q ips=%v", vm.GuestHostname, vm.GuestIPAddresses)}+ if len(vm.NetworkAdapters) != 1 || vm.NetworkAdapters[0].NetworkName != "VM Network" {+ t.Fatalf("expected network adapter enrichment to survive degraded guest read, got %+v", vm.NetworkAdapters)+ }if 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)}@@ -349,6 +368,33 @@ func newVMwareTestServer(t *testing.T, cfg vmwareTestServerConfig) *httptest.Ser"ip_address": "10.0.0.21",})})+ mux.HandleFunc("/api/vcenter/vm/vm-201/hardware/ethernet", func(w http.ResponseWriter, r *http.Request) {+ requireAutomationSession(t, r)+ writeJSON(w, []map[string]any{{"nic": "4000"}})+ })+ mux.HandleFunc("/api/vcenter/vm/vm-201/hardware/ethernet/4000", func(w http.ResponseWriter, r *http.Request) {+ requireAutomationSession(t, r)+ writeJSON(w, map[string]any{+ "label": "Network adapter 1",+ "type": "VMXNET3",+ "upt_compatibility_enabled": true,+ "upt_v2_compatibility_enabled": false,+ "mac_type": "GENERATED",+ "mac_address": "00:50:56:aa:bb:cc",+ "pci_slot_number": 160,+ "wake_on_lan_enabled": true,+ "backing": map[string]any{+ "type": "STANDARD_PORTGROUP",+ "network": "network-101",+ "network_name": "VM Network",+ "distributed_switch_uuid": "",+ "distributed_port": "",+ },+ "state": "CONNECTED",+ "start_connected": true,+ "allow_guest_control": true,+ })+ })mux.HandleFunc("/sdk/vim25/9.0.0.0/ServiceInstance/ServiceInstance/content", func(w http.ResponseWriter, r *http.Request) {writeJSON(w, map[string]any{diff --git a/internal/vmware/client_topology.go b/internal/vmware/client_topology.goindex 0ef198d258..8050057e98 100644--- a/internal/vmware/client_topology.go+++ b/internal/vmware/client_topology.go@@ -3,6 +3,7 @@ package vmwareimport ("context""fmt"+ "net/url""sort""strings""sync"@@ -23,6 +24,36 @@ type vcenterVMGuestIdentity struct {IPAddr string `json:"ip_address"`}+type vcenterVMHardwareEthernetSummary struct {+ NIC string `json:"nic"`+}++type vcenterVMHardwareEthernetBacking struct {+ Type string `json:"type"`+ Network string `json:"network"`+ NetworkName string `json:"network_name"`+ HostDevice string `json:"host_device"`+ DistributedSwitchUUID string `json:"distributed_switch_uuid"`+ DistributedPort string `json:"distributed_port"`+ OpaqueNetworkType string `json:"opaque_network_type"`+ OpaqueNetworkID string `json:"opaque_network_id"`+}++type vcenterVMHardwareEthernetInfo struct {+ Label string `json:"label"`+ Type string `json:"type"`+ UPTCompatibility bool `json:"upt_compatibility_enabled"`+ UPTV2Compatibility bool `json:"upt_v2_compatibility_enabled"`+ MACType string `json:"mac_type"`+ MACAddress string `json:"mac_address"`+ PCISlotNumber *int64 `json:"pci_slot_number"`+ WakeOnLANEnabled bool `json:"wake_on_lan_enabled"`+ Backing vcenterVMHardwareEthernetBacking `json:"backing"`+ State string `json:"state"`+ StartConnected bool `json:"start_connected"`+ AllowGuestControl bool `json:"allow_guest_control"`+}+type viJSONVirtualMachineRuntimeInfo struct {Host *viJSONReference `json:"host"`}@@ -272,6 +303,14 @@ func (c *Client) enrichVMTopology(}}+ networkAdapters, err := c.collectVMEthernetAdapters(ctx, automationSessionID, vm.VM)+ if issue, ok := classifyInventoryEnrichmentIssue("topology", "vm", vm.VM, err); ok {+ recordIssue(issue)+ } else if err != nil && !isAutomationNotFound(err) && !isAutomationUnavailable(err) {+ return vm, nil, err+ }+ vm.NetworkAdapters = networkAdapters+var placement vmwarePlacementparentRef, err := c.collectEntityReference(ctx, release, sessionID, "VirtualMachine", vm.VM, "parent", "vm parent placement")@@ -447,6 +486,63 @@ func (c *Client) collectVMGuestIdentity(return &payload, nil}+func (c *Client) collectVMEthernetAdapters(+ ctx context.Context,+ automationSessionID string,+ vmID string,+) ([]InventoryVMNetworkAdapter, error) {+ vmID = strings.TrimSpace(vmID)+ if vmID == "" || strings.TrimSpace(automationSessionID) == "" {+ return nil, nil+ }++ escapedVMID := url.PathEscape(vmID)+ var summaries []vcenterVMHardwareEthernetSummary+ path := fmt.Sprintf("/api/vcenter/vm/%s/hardware/ethernet", escapedVMID)+ if err := c.getAutomationJSON(ctx, automationSessionID, path, "vm ethernet adapter list", &summaries); err != nil {+ return nil, err+ }+ if len(summaries) == 0 {+ return nil, nil+ }++ adapters := make([]InventoryVMNetworkAdapter, 0, len(summaries))+ for _, summary := range summaries {+ nic := strings.TrimSpace(summary.NIC)+ if nic == "" {+ continue+ }+ var info vcenterVMHardwareEthernetInfo+ path := fmt.Sprintf("/api/vcenter/vm/%s/hardware/ethernet/%s", escapedVMID, url.PathEscape(nic))+ if err := c.getAutomationJSON(ctx, automationSessionID, path, "vm ethernet adapter", &info); err != nil {+ return nil, err+ }+ adapters = append(adapters, InventoryVMNetworkAdapter{+ NIC: nic,+ Label: strings.TrimSpace(info.Label),+ Type: strings.TrimSpace(info.Type),+ MACType: strings.TrimSpace(info.MACType),+ MACAddress: strings.TrimSpace(info.MACAddress),+ PCISlotNumber: cloneInt64Pointer(info.PCISlotNumber),+ BackingType: strings.TrimSpace(info.Backing.Type),+ NetworkID: strings.TrimSpace(info.Backing.Network),+ NetworkName: strings.TrimSpace(info.Backing.NetworkName),+ DistributedSwitchUUID: strings.TrimSpace(info.Backing.DistributedSwitchUUID),+ DistributedPort: strings.TrimSpace(info.Backing.DistributedPort),+ OpaqueNetworkType: strings.TrimSpace(info.Backing.OpaqueNetworkType),+ OpaqueNetworkID: strings.TrimSpace(info.Backing.OpaqueNetworkID),+ HostDevice: strings.TrimSpace(info.Backing.HostDevice),+ State: strings.TrimSpace(info.State),+ StartConnected: info.StartConnected,+ AllowGuestControl: info.AllowGuestControl,+ WakeOnLANEnabled: info.WakeOnLANEnabled,+ UPTCompatibility: info.UPTCompatibility,+ UPTV2Compatibility: info.UPTV2Compatibility,+ })+ }+ return adapters, nil+}+func (c *Client) collectVMRuntimeHostReference(ctx context.Context,release string,diff --git a/internal/vmware/fixtures.go b/internal/vmware/fixtures.goindex 880e1a5b25..1d437aa7e2 100644--- a/internal/vmware/fixtures.go+++ b/internal/vmware/fixtures.go@@ -208,6 +208,7 @@ func defaultFixturesPrimaryCluster(OverallStatus: "green",SnapshotCount: 1,CurrentSnapshotID: "snapshot-201",+ NetworkAdapters: fixtureVMNetworkAdapters("vm-201", "VM Network", true),SnapshotTree: []InventoryVMSnapshot{{Snapshot: "snapshot-201",Name: "pre-deploy-checkpoint",@@ -264,6 +265,7 @@ func defaultFixturesPrimaryCluster(OverallStatus: "yellow",SnapshotCount: 3,CurrentSnapshotID: "snapshot-213",+ NetworkAdapters: fixtureVMNetworkAdapters("vm-202", "Database Network", true),SnapshotTree: []InventoryVMSnapshot{{Snapshot: "snapshot-211",Name: "baseline",@@ -338,6 +340,7 @@ func defaultFixturesPrimaryCluster(GuestIPAddresses: []string{"10.42.10.44"},OverallStatus: "green",SnapshotCount: 1,+ NetworkAdapters: fixtureVMNetworkAdapters("vm-203", "Web Network", true),Metrics: &InventoryMetrics{CPUPercent: float64Ptr(22.1),MemoryPercent: float64Ptr(51.2),@@ -376,6 +379,7 @@ func defaultFixturesPrimaryCluster(GuestIPAddresses: []string{"10.42.20.15"},OverallStatus: "green",SnapshotCount: 2,+ NetworkAdapters: fixtureVMNetworkAdapters("vm-204", "Platform Network", true),Metrics: &InventoryMetrics{CPUPercent: float64Ptr(27.8),MemoryPercent: float64Ptr(59.6),@@ -414,6 +418,7 @@ func defaultFixturesPrimaryCluster(GuestIPAddresses: []string{"10.42.30.18"},OverallStatus: "green",SnapshotCount: 0,+ NetworkAdapters: fixtureVMNetworkAdapters("vm-205", "Utility Network", true),Metrics: &InventoryMetrics{CPUPercent: float64Ptr(16.8),MemoryPercent: float64Ptr(46.1),@@ -716,6 +721,7 @@ func appendEdgeClusterFixtures(GuestHostname: v.Guest,GuestIPAddresses: guestIPs,OverallStatus: v.Status,+ NetworkAdapters: fixtureVMNetworkAdapters(v.ID, edgeVMNetworkName(v.Tier), v.PowerState == "POWERED_ON"),}if v.PowerState == "POWERED_ON" {vm.Metrics = &InventoryMetrics{@@ -787,6 +793,51 @@ func guestOSFamily(name string) string {}}+func edgeVMNetworkName(tier string) string {+ switch tier {+ case "Stateful":+ return "Edge Stateful"+ case "Archive":+ return "Edge Archive"+ case "Workstations":+ return "Edge Workstations"+ case "Observability":+ return "Edge Observability"+ default:+ return "Edge App"+ }+}++func fixtureVMNetworkAdapters(vmID, networkName string, connected bool) []InventoryVMNetworkAdapter {+ state := "NOT_CONNECTED"+ if connected {+ state = "CONNECTED"+ }+ return []InventoryVMNetworkAdapter{{+ NIC: "4000",+ Label: "Network adapter 1",+ Type: "VMXNET3",+ MACType: "GENERATED",+ MACAddress: fixtureVMMACAddress(vmID),+ PCISlotNumber: int64Ptr(160),+ BackingType: "STANDARD_PORTGROUP",+ NetworkID: "network-" + vmID,+ NetworkName: networkName,+ State: state,+ StartConnected: true,+ AllowGuestControl: true,+ WakeOnLANEnabled: true,+ }}+}++func fixtureVMMACAddress(vmID string) string {+ var value int+ for _, r := range vmID {+ value += int(r)+ }+ return fmt.Sprintf("00:50:56:%02x:%02x:%02x", (value>>8)&0xff, value&0xff, (value+37)&0xff)+}+func inventorySnapshotTime(value time.Time) *time.Time {timestamp := value.UTC()return ×tampdiff --git a/internal/vmware/provider.go b/internal/vmware/provider.goindex 601c087573..6ed2e7c625 100644--- a/internal/vmware/provider.go+++ b/internal/vmware/provider.go@@ -53,6 +53,31 @@ type InventoryVMSnapshot struct {Children []InventoryVMSnapshot `json:"children,omitempty"`}+// InventoryVMNetworkAdapter preserves vCenter VM hardware Ethernet adapter+// facts as read-only workload context.+type InventoryVMNetworkAdapter struct {+ NIC string `json:"nic,omitempty"`+ Label string `json:"label,omitempty"`+ Type string `json:"type,omitempty"`+ MACType string `json:"mac_type,omitempty"`+ MACAddress string `json:"mac_address,omitempty"`+ PCISlotNumber *int64 `json:"pci_slot_number,omitempty"`+ BackingType string `json:"backing_type,omitempty"`+ NetworkID string `json:"network_id,omitempty"`+ NetworkName string `json:"network_name,omitempty"`+ DistributedSwitchUUID string `json:"distributed_switch_uuid,omitempty"`+ DistributedPort string `json:"distributed_port,omitempty"`+ OpaqueNetworkType string `json:"opaque_network_type,omitempty"`+ OpaqueNetworkID string `json:"opaque_network_id,omitempty"`+ HostDevice string `json:"host_device,omitempty"`+ State string `json:"state,omitempty"`+ StartConnected bool `json:"start_connected"`+ AllowGuestControl bool `json:"allow_guest_control"`+ WakeOnLANEnabled bool `json:"wake_on_lan_enabled"`+ UPTCompatibility bool `json:"upt_compatibility_enabled,omitempty"`+ UPTV2Compatibility bool `json:"upt_v2_compatibility_enabled,omitempty"`+}+// InventoryMetrics captures the current runtime metric floor projected onto// canonical Pulse metrics for VMware-backed hosts and VMs.type InventoryMetrics struct {@@ -105,38 +130,39 @@ type InventoryHost struct {// InventoryVM is the canonical phase-1 VM summary returned by the vCenter// Automation API list endpoint.type InventoryVM struct {- VM string `json:"vm"`- Name string `json:"name"`- PowerState string `json:"power_state"`- CPUCount int `json:"cpu_count,omitempty"`- MemorySizeMiB int64 `json:"memory_size_mib,omitempty"`- DatacenterID string `json:"datacenter_id,omitempty"`- DatacenterName string `json:"datacenter_name,omitempty"`- ComputeResourceID string `json:"compute_resource_id,omitempty"`- ComputeResourceName string `json:"compute_resource_name,omitempty"`- ClusterID string `json:"cluster_id,omitempty"`- ClusterName string `json:"cluster_name,omitempty"`- FolderID string `json:"folder_id,omitempty"`- FolderName string `json:"folder_name,omitempty"`- ResourcePoolID string `json:"resource_pool_id,omitempty"`- ResourcePoolName string `json:"resource_pool_name,omitempty"`- RuntimeHostID string `json:"runtime_host_id,omitempty"`- RuntimeHostName string `json:"runtime_host_name,omitempty"`- DatastoreIDs []string `json:"datastore_ids,omitempty"`- DatastoreNames []string `json:"datastore_names,omitempty"`- InstanceUUID string `json:"instance_uuid,omitempty"`- BIOSUUID string `json:"bios_uuid,omitempty"`- GuestOSFamily string `json:"guest_os_family,omitempty"`- GuestHostname string `json:"guest_hostname,omitempty"`- GuestIPAddresses []string `json:"guest_ip_addresses,omitempty"`- OverallStatus string `json:"overall_status,omitempty"`- TriggeredAlarms []InventoryAlarm `json:"triggered_alarms,omitempty"`- RecentTasks []InventoryTask `json:"recent_tasks,omitempty"`- RecentEvents []InventoryEvent `json:"recent_events,omitempty"`- SnapshotCount int `json:"snapshot_count,omitempty"`- CurrentSnapshotID string `json:"current_snapshot_id,omitempty"`- SnapshotTree []InventoryVMSnapshot `json:"snapshot_tree,omitempty"`- Metrics *InventoryMetrics `json:"metrics,omitempty"`+ VM string `json:"vm"`+ Name string `json:"name"`+ PowerState string `json:"power_state"`+ CPUCount int `json:"cpu_count,omitempty"`+ MemorySizeMiB int64 `json:"memory_size_mib,omitempty"`+ DatacenterID string `json:"datacenter_id,omitempty"`+ DatacenterName string `json:"datacenter_name,omitempty"`+ ComputeResourceID string `json:"compute_resource_id,omitempty"`+ ComputeResourceName string `json:"compute_resource_name,omitempty"`+ ClusterID string `json:"cluster_id,omitempty"`+ ClusterName string `json:"cluster_name,omitempty"`+ FolderID string `json:"folder_id,omitempty"`+ FolderName string `json:"folder_name,omitempty"`+ ResourcePoolID string `json:"resource_pool_id,omitempty"`+ ResourcePoolName string `json:"resource_pool_name,omitempty"`+ RuntimeHostID string `json:"runtime_host_id,omitempty"`+ RuntimeHostName string `json:"runtime_host_name,omitempty"`+ DatastoreIDs []string `json:"datastore_ids,omitempty"`+ DatastoreNames []string `json:"datastore_names,omitempty"`+ InstanceUUID string `json:"instance_uuid,omitempty"`+ BIOSUUID string `json:"bios_uuid,omitempty"`+ GuestOSFamily string `json:"guest_os_family,omitempty"`+ GuestHostname string `json:"guest_hostname,omitempty"`+ GuestIPAddresses []string `json:"guest_ip_addresses,omitempty"`+ OverallStatus string `json:"overall_status,omitempty"`+ TriggeredAlarms []InventoryAlarm `json:"triggered_alarms,omitempty"`+ RecentTasks []InventoryTask `json:"recent_tasks,omitempty"`+ RecentEvents []InventoryEvent `json:"recent_events,omitempty"`+ SnapshotCount int `json:"snapshot_count,omitempty"`+ CurrentSnapshotID string `json:"current_snapshot_id,omitempty"`+ SnapshotTree []InventoryVMSnapshot `json:"snapshot_tree,omitempty"`+ NetworkAdapters []InventoryVMNetworkAdapter `json:"network_adapters,omitempty"`+ Metrics *InventoryMetrics `json:"metrics,omitempty"`}// InventoryDatastore is the canonical phase-1 datastore summary returned by@@ -484,6 +510,7 @@ func vmwareRecordsFromSnapshot(snapshot *InventorySnapshot, now func() time.TimeSnapshotCount: vm.SnapshotCount,CurrentSnapshotID: strings.TrimSpace(vm.CurrentSnapshotID),SnapshotTree: vmwareSnapshotTreeData(vm.SnapshotTree),+ NetworkAdapters: vmwareNetworkAdaptersData(vm.NetworkAdapters),},Tags: filterNonEmptyStrings("vmware",@@ -495,10 +522,11 @@ func vmwareRecordsFromSnapshot(snapshot *InventorySnapshot, now func() time.Time),}identity := unifiedresources.ResourceIdentity{- MachineID: firstNonEmptyTrimmed(vm.InstanceUUID, vm.BIOSUUID),- Hostnames: uniqueSortedTrimmedStrings([]string{name, vm.GuestHostname}),- IPAddresses: uniqueSortedTrimmedStrings(vm.GuestIPAddresses),- ClusterName: vmwareClusterHint(vm.ClusterName, vm.ComputeResourceName),+ MachineID: firstNonEmptyTrimmed(vm.InstanceUUID, vm.BIOSUUID),+ Hostnames: uniqueSortedTrimmedStrings([]string{name, vm.GuestHostname}),+ IPAddresses: uniqueSortedTrimmedStrings(vm.GuestIPAddresses),+ MACAddresses: uniqueSortedTrimmedStrings(vmwareNetworkAdapterMACAddresses(vm.NetworkAdapters)),+ ClusterName: vmwareClusterHint(vm.ClusterName, vm.ComputeResourceName),}records = append(records, unifiedresources.IngestRecord{SourceID: vmwareSourceID(snapshot.ConnectionID, "vm", vm.VM),@@ -642,6 +670,7 @@ func cloneInventoryVMs(in []InventoryVM) []InventoryVM {out[i].RecentTasks = cloneInventoryTasks(in[i].RecentTasks)out[i].RecentEvents = cloneInventoryEvents(in[i].RecentEvents)out[i].SnapshotTree = cloneInventoryVMSnapshots(in[i].SnapshotTree)+ out[i].NetworkAdapters = cloneInventoryVMNetworkAdapters(in[i].NetworkAdapters)out[i].Metrics = cloneInventoryMetrics(in[i].Metrics)}return out@@ -707,6 +736,18 @@ func cloneInventoryVMSnapshots(in []InventoryVMSnapshot) []InventoryVMSnapshot {return out}+func cloneInventoryVMNetworkAdapters(in []InventoryVMNetworkAdapter) []InventoryVMNetworkAdapter {+ if in == nil {+ return nil+ }+ out := make([]InventoryVMNetworkAdapter, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].PCISlotNumber = cloneInt64Pointer(in[i].PCISlotNumber)+ }+ return out+}+func cloneInventoryEnrichmentIssues(in []InventoryEnrichmentIssue) []InventoryEnrichmentIssue {if in == nil {return nil@@ -1039,6 +1080,52 @@ func vmwareSnapshotTreeData(snapshots []InventoryVMSnapshot) []unifiedresources.return out}+func vmwareNetworkAdaptersData(adapters []InventoryVMNetworkAdapter) []unifiedresources.VMwareNetworkAdapterData {+ if len(adapters) == 0 {+ return nil+ }+ out := make([]unifiedresources.VMwareNetworkAdapterData, 0, len(adapters))+ for _, adapter := range adapters {+ item := unifiedresources.VMwareNetworkAdapterData{+ NIC: strings.TrimSpace(adapter.NIC),+ Label: strings.TrimSpace(adapter.Label),+ Type: strings.TrimSpace(adapter.Type),+ MACType: strings.TrimSpace(adapter.MACType),+ MACAddress: strings.TrimSpace(adapter.MACAddress),+ PCISlotNumber: cloneInt64Pointer(adapter.PCISlotNumber),+ BackingType: strings.TrimSpace(adapter.BackingType),+ NetworkID: strings.TrimSpace(adapter.NetworkID),+ NetworkName: strings.TrimSpace(adapter.NetworkName),+ DistributedSwitchUUID: strings.TrimSpace(adapter.DistributedSwitchUUID),+ DistributedPort: strings.TrimSpace(adapter.DistributedPort),+ OpaqueNetworkType: strings.TrimSpace(adapter.OpaqueNetworkType),+ OpaqueNetworkID: strings.TrimSpace(adapter.OpaqueNetworkID),+ HostDevice: strings.TrimSpace(adapter.HostDevice),+ State: strings.TrimSpace(adapter.State),+ StartConnected: adapter.StartConnected,+ AllowGuestControl: adapter.AllowGuestControl,+ WakeOnLANEnabled: adapter.WakeOnLANEnabled,+ UPTCompatibility: adapter.UPTCompatibility,+ UPTV2Compatibility: adapter.UPTV2Compatibility,+ }+ out = append(out, item)+ }+ return out+}++func vmwareNetworkAdapterMACAddresses(adapters []InventoryVMNetworkAdapter) []string {+ if len(adapters) == 0 {+ return nil+ }+ addresses := make([]string, 0, len(adapters))+ for _, adapter := range adapters {+ if mac := strings.TrimSpace(adapter.MACAddress); mac != "" {+ addresses = append(addresses, mac)+ }+ }+ return addresses+}+func diskMetric(total, used int64) *unifiedresources.MetricValue {if total <= 0 {return nildiff --git a/internal/vmware/provider_test.go b/internal/vmware/provider_test.goindex 8309663b4a..b2fee1c831 100644--- a/internal/vmware/provider_test.go+++ b/internal/vmware/provider_test.go@@ -125,6 +125,22 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {Current: true,}},}},+ NetworkAdapters: []InventoryVMNetworkAdapter{{+ NIC: "4000",+ Label: "Network adapter 1",+ Type: "VMXNET3",+ MACType: "GENERATED",+ MACAddress: "00:50:56:aa:bb:cc",+ PCISlotNumber: int64Ptr(160),+ BackingType: "STANDARD_PORTGROUP",+ NetworkID: "network-101",+ NetworkName: "VM Network",+ DistributedSwitchUUID: "50 2b d1",+ State: "CONNECTED",+ StartConnected: true,+ AllowGuestControl: true,+ WakeOnLANEnabled: true,+ }},}},Datastores: []InventoryDatastore{{Datastore: "datastore-11",@@ -231,6 +247,12 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {if got := vmRecord.Resource.VMware.SnapshotTree; len(got) != 1 || got[0].Name != "pre-upgrade" || len(got[0].Children) != 1 || !got[0].Children[0].Current {t.Fatalf("vm snapshot tree projection = %+v, want root pre-upgrade with current child", got)}+ if got := vmRecord.Resource.VMware.NetworkAdapters; len(got) != 1 || got[0].NetworkName != "VM Network" || got[0].MACAddress != "00:50:56:aa:bb:cc" {+ t.Fatalf("vm network adapter projection = %+v, want VM Network adapter with MAC", got)+ }+ if got := vmRecord.Resource.VMware.NetworkAdapters[0].PCISlotNumber; got == nil || *got != 160 {+ t.Fatalf("vm network adapter pci slot = %+v, want 160", got)+ }if got := vmRecord.Resource.ParentName; got != "esxi-01.lab.local" {t.Fatalf("vm parent name = %q, want esxi-01.lab.local", got)}@@ -249,6 +271,9 @@ func TestProviderRecords_ProjectCanonicalVMwareResources(t *testing.T) {if got := vmRecord.Identity.IPAddresses; len(got) != 1 || got[0] != "10.0.0.21" {t.Fatalf("vm identity IPs = %#v, want [10.0.0.21]", got)}+ if got := vmRecord.Identity.MACAddresses; len(got) != 1 || got[0] != "00:50:56:aa:bb:cc" {+ t.Fatalf("vm identity MACs = %#v, want [00:50:56:aa:bb:cc]", got)+ }if vmRecord.Resource.Metrics == nil || vmRecord.Resource.Metrics.CPU == nil || vmRecord.Resource.Metrics.Memory == nil {t.Fatalf("expected VMware VM metrics, got %+v", vmRecord.Resource.Metrics)}