From 9c7d3978e1ea93f36710affd7b21c4c6f9b9763d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 23 May 2026 09:24:31 +0100 Subject: [PATCH] Show vCenter MoRef in workload ID column for vSphere VMs The workload table's ID column reads displayId, which the mapping pipeline derived only from numeric vmid. vCenter identifies VMs by managed object reference (e.g. vm-206), not a Proxmox-shaped numeric vmid, so vSphere rows landed in the table with a blank ID cell. When workloadType is vm and there's no Proxmox-shaped numeric vmid, fall back to resource.vmware.managedObjectId. The MoRef is the identifier operators recognize from the vCenter UI, so the column now shows what an operator would expect to see. --- frontend-modern/src/hooks/useWorkloads.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend-modern/src/hooks/useWorkloads.ts b/frontend-modern/src/hooks/useWorkloads.ts index 7f429aa8b6..13909f0848 100644 --- a/frontend-modern/src/hooks/useWorkloads.ts +++ b/frontend-modern/src/hooks/useWorkloads.ts @@ -378,11 +378,20 @@ const mapResourceToWorkload = (resource: APIResource): WorkloadGuest | null => { ? resource.proxmox.vmid : 0; const rawDisplayId = resource.id; + // vCenter identifies VMs by managed object reference (e.g. `vm-206`), + // not a numeric vmid. When the resource has no Proxmox-shaped numeric + // vmid, fall back to the vSphere MoRef so the workload table's ID + // column shows the identifier operators recognize from vCenter rather + // than rendering blank. + const vsphereDisplayId = + workloadType === 'vm' && vmid <= 0 + ? (resource.vmware?.managedObjectId ?? '').trim() || undefined + : undefined; const displayId = workloadType === 'vm' || workloadType === 'system-container' ? vmid > 0 ? String(vmid) - : undefined + : vsphereDisplayId : rawDisplayId ? rawDisplayId.length > 12 ? rawDisplayId.slice(0, 12)