The resource 'Port-ID' is in use error when removing a host from VDS
search cancel

The resource 'Port-ID' is in use error when removing a host from VDS

book

Article ID: 324497

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
When an ESXi host has no running virtual machines and is on Maintenance Mode, you experience these symptoms:
  • You cannot remove an ESXi host from the vSphere Distributed Switch (vDS).
  • You see the error similar to:

    The resource '104' is in use. 

    Note: In this example, 104 is the port-ID in use at that time. This could be any value.


Cause

This issue can occur if the vSphere Distributed Switch portgroup has objects still attached to it.

Resolution

To resolve this issue, either remove the vmkernel (vmk) NIC or migrate to a Standard Virtual Switch (vSwitch).

To migrate the vmkernel NIC

  1. Navigate to Hosts and Clusters and select the ESXi host.
  2. Under the Configuration tab, click Networking.
  3. Click the vSphere Standard Switch tab.
  4. In the top right corner of the switch, click Migrate VMKernel Adapter.
  5. Follow the prompts to migrate each vmk NIC.
  6. Make sure everything, including the physical NICs, are removed from the vDS.
  7. Once completed, you should now be able to remove the ESXi host from the vDS.


Workaround:
If the vDS still cannot be removed from the host, make sure the vDS is not referencing anything on the host in the following areas:
  • Port mirroring
  • VM templates (on the vDS and in the content library)
Additionally, the host should not have any vmkernels, VMs, or vmnics left on the vDS on the host you are trying to remove.

If everything is off the vDS and the removal of the ESXi host still fails:
  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.
  4. You should now be able to remove the ESXi host successfully from the VDS.


Additional Information

Sometimes this error occurs in relation to a vDS Out of Sync message. If so, please refer to The vSphere Distributed Switch configuration on some hosts differed from that of VMware vCenter- "Out of Sync"

For more information, see the Unable to Remove a Host from a vSphere Distributed Switch section of the vSphere Networking Guide.