The resource 'Port-ID' is in use error when removing a host from vSphere Distributed Switch (vDS)
search cancel

The resource 'Port-ID' is in use error when removing a host from vSphere Distributed Switch (vDS)

book

Article ID: 413617

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When administrators attempt to remove an ESXi host from a vSphere Distributed Switch (vDS) within the vCenter Server UI, the task fails with error:

  • "The resource '##' is in use"

    OR

  • The resource 'Host_NAME' is in use. Cannot remove the host ###### because it's part of VDS #####"

Environment

  • VMware vSphere ESXi 8.x
  • VMware vSphere ESXi 9.x

Cause

This issue occurs because a dependent network resource remains connected to the vSphere Distributed Switch on the host. The vCenter Server will prevent the removal of the ESXi host from the vDS to prevent a network outage if active objects (such as virtual machines, VM templates, VMkernel adapters, or physical uplinks) are still bound to the switch's portgroups.

Resolution

To resolve this issue, it is necessary to identify and remove or migrate any remaining objects attached to the vDS for the specific host.

Identify Connected Resources:

  1. Log in to the vSphere Client.
  2. Navigate to the affected ESXi host.
  3. Navigate to Configure > Networking > Virtual Switches.
  4. Expand the vDS view to inspect which Virtual Machines, VM Templates, VMkernel adapters, or physical uplinks are currently connected.

Resolution:

  1. If Virtual Machines are still in use: Migrate the VM to another host (if the vDS is spanning multiple hosts), or edit the VM's network settings to assign its network adapter to a different vDS or a vSphere Standard Switch portgroup.
  2. If VM templates are still in use: Convert the template back to a Virtual Machine. Once converted, edit its settings to change the network adapter to a different switch/portgroup, or migrate it to another host.
  3. If vmkernel adapter (e.g. vmk0, vmk1) in use: Migrate the VMkernel adapter (e.g., vmk0, vmk1) to another vDS or a Standard Switch. Refer, Migrate VMkernel Adapters to a vSphere Distributed Switch or Migrate a VMkernel Adapter on a Host to a vSphere Standard Switch.
  4. If uplinks are in use: Select "Manage Physical Adapters" and remove the uplinks from the vDS.

NOTE: Before removing any uplinks, it is highly recommended to migrate or power off any VMs or VMkernel adapters currently using the distributed switch to prevent network disruptions.

Once the vDS is completely empty of associated objects on that host, re-attempt the operation to remove the host from the vSphere Distributed Switch.

Additional Information

If there is no object shown as using the vDS in the host view but the error message still appears reporting a port in use, refer The resource 'Port-ID' is in use error when removing a host from vSphere Distributed Switch (vDS) when nothing is using it.