After removing a cluster or host from VCenter, they are removed improperly, which causes a stale entry on NSX, and deploying a new segment either using Vcloud director or NSX will take a long period to be seen or used on VCenter.
From the NSX manager side, there will be similar log entries:
NSXAPI.log
2025-07-02T18:58:54.998Z INFO workerTaskExecutor-1-40 LogicalSwitchWorker 5151 - [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Handling work item LS=LogicalSwitch/00000000000000000000000 work item
WorkItem{identifier=LogicalSwitch/000000000000000000000000, Timestamp{epoch=324, address=8445522851}}
2025-07-02T18:58:55.007Z INFO workerTaskExecutor-1-40 WorkerInvocationTask 5151 POLICY [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Worker processing done , worker-id - LogicalSwitchWorker
2025-07-02T18:58:55.273Z INFO LogicalSwitchStateOperationScheduler2 LogicalSwitchHostSyncer 5151 SWITCHING [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] HandleVcNsxPortGroupRequest #desiredLogicalSwitchSize : 1
2025-07-02T18:58:55.277Z INFO LogicalSwitchStateOperationScheduler2 LogicalSwitchHostSyncer 5151 SWITCHING [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Invoke VC to handle NSXPG create request #addedVdsIdToLsMapSize : 4
2025-07-02T18:58:55.278Z ERROR LogicalSwitchStateOperationScheduler2 NsxPortgroupExecuteVcUtils 5151 SWITCHING [nsx@6876 comp="nsx-manager" errorCode="MP9538" level="ERROR" subcomp="manager"] Could not find the HostSwitch [00 000 000 000 000 00] of type VDS
2025-07-02T18:58:55.278Z INFO LogicalSwitchStateOperationScheduler2 TraceAspectAjIf 5151 POLICY [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] abnormally finish tracing a workflow with name handleVcNsxPortGroupRequest
2025-07-02T18:58:55.278Z ERROR LogicalSwitchStateOperationScheduler2 TaskUtils$LoggingErrorHandler 5151 Unexpected error occurred in scheduled task
com.vmware.nsx.management.switching.common.exceptions.SwitchingException: null
at com.vmware.nsx.management.switching.common.SwitchingUtils.getDvsByHostSwitchId(SwitchingUtils.java:1947) ~[?:?]
at com.vmware.nsx.management.switching.sync.host.NsxPortgroupExecuteVcUtils.createNsxPortgroupOnVds(NsxPortgroupExecuteVcUtils.java:91) ~[?:?]
at com.vmware.nsx.management.switching.sync.host.LogicalSwitchHostSyncer.handleVcNsxPortGroupRequest_aroundBody0(LogicalSwitchHostSyncer.java:279) ~[?:?]
at com.vmware.nsx.management.switching.sync.host.LogicalSwitchHostSyncer$AjcClosure1.run(LogicalSwitchHostSyncer.java:1) ~[?:?]
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[?:?]
at com.vmware.nsx.management.metric.aspect.TimedAspect.timedMethodAdvice(TimedAspect.java:87) ~[?:?]
at com.vmware.nsx.management.switching.sync.host.LogicalSwitchHostSyncer.handleVcNsxPortGroupRequest(LogicalSwitchHostSyncer.java:180) ~[?:?]
at com.vmware.nsx.management.switching.sync.host.LogicalSwitchHostSyncer.run(LogicalSwitchHostSyncer.java:304) ~[?:?]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_372]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_372]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_372]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_372]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_372]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_372]
at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_372]
Note: NSX is not able to find the DVS on question
VMware NSX
VMware vCloud Director
VMware vCenter Server
Go to Vcenter and confirm that we are not using those ESXI, after we confirm that
Once we located the host in question
After the ESXI or ESXIs on question are deleted. Create a new segment either using NSX or vCloud Director, and should be able to see it and use it right away