The resource ‘Port-ID’ is in use – Unable to remove ESXi host from VDS

I am currently involved with a lot of migration activities which include NSX-V to NSX-T migrations. As part of NSX-V to NSX-T migrations, I am performing various activities which include migration of VMs across the vCenter Servers using Cross Vcenter vMotion and moving the entire cluster from one vCenter to another vCenter server which is compatible with NSX-T.

As part of the Cluster migration to the new vCenter Server, we will be cleanly removing the ESXi host from VDS and vCenter Server. For that, all the vmkernel interfaces and physical interfaces need to migrate from vDS to Standard switch and the host will be removed from VDS. When I try to remove the host from VDS, most of the time never faced any issue but faced the error “The resource ‘Port-ID’ is in use” one time.

Usually, this error happens when we have any of the VM or VM templates from that host still use the ports in the VDS but in this case, no VMs or VM templates are running on the host. I even tried to reboot the hosts to clear any ghosted ports. Even after the reboot, I was getting the error “The resource ‘Port-ID’ is in use” when i try to remove the host from VDS.

In our case, nothing (VMs or VM templates) is running on the host, and no vmkernel interfaces in the VDS as well. Still, we are unable to remove the host from VDS. If everything is off the vDS and the removal of the ESXi host still fails, you can follow the below steps to fix the issue. I have followed the same to fix my issues.

Troubleshooting – The resource ‘Port-ID’ is in use

1. Right-click the ESXi host from the Inventory and select Connection > Disconnect.
Note: Ensure to have the ESXi host username and password.

2. Proceed to remove the ESXi host from the VDS.

3. Right-click the ESXi host from the Inventory and select Connection > Connect.

After that, I was able to remove the ESXi host successfully from the VDS and I have started the ESXi host movement to another vCenter Server. This fixed my issue. This is a simple fix but still, I want to share with you all to avoid wasting time on troubleshooting this when you face this.

I hope this is informative for you. Thanks for Reading. Be social and share it on social media, if you feel worth sharing it.

You can read my article related to Deep dive on vSphere Distributed Switch