Error: "The resource 'Port-ID' is in use" when removing an ESXi host from a vSphere Distributed Switch (vDS) when nothing is using it
search cancel

Error: "The resource 'Port-ID' is in use" when removing an ESXi host from a vSphere Distributed Switch (vDS) when nothing is using it

book

Article ID: 324497

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Unable to remove an ESXi host from the vSphere Distributed Switch (vDS) when the host is in maintenance mode. 
    • The host does not have any VMs currently running on it.
  • The following error may be observed:

The resource '###' is in use. 

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

Environment

VMware vSphere

Cause

In this scenario, the vCenter database will contain a record that indicates that a dvPort with the number '###' is "in use". This is why the vCenter is issuing this error message.

However, when examining the output from the command esxcfg-vswitch -l on the ESXi host, the "in use" value associated with that dvPort "###" may show "0", indicating that it is not currently in use. The vCenter is currently showing a stale entry tied to that dvPort.

The dvPort may be associated with:

  • A vmkernel interface. The interface could be associated with Management, vMotion, vSAN or other services.
  • A virtual machine that has a snapshot that has not been consolidated.
  • A virtual machine template.

Resolution

The resolution will depend on the type of network connection associated with the dvPort "###" in the error message.

If it is determined that:

     1. The dvPort "###" is associated with a virtual machine or a virtual machine template

AND

     2. The Management vmkernel interface configured for the host is configured to use a standard switch (or a different vDS than the one in question).

 

Then follow the steps below:

1. Place the ESXi host in Maintenance Mode

    • (Note: If the ESXi host is part of a vSAN cluster, make sure to select the appropriate Maintenance Mode option that is required for a host to completely leave the vSAN cluster, as if it were being decommissioned).

2. Disconnect the ESXi host from vCenter: Home > Hosts and Clusters > Right-click on the ESXi host > Connection > Disconnect

3. Once the host is disconnected, remove the ESXi host from vCenter (which will also remove the ESXi host from any vDS it is connected to):  vSphere client > vCenter > Hosts and Clusters icon > Right-click on the ESXi host > Remove from inventory

For all other scenarios, please open a Support Case with Broadcom Support, see Creating and managing Broadcom support cases.