Removing ESXi host from the vCenter inventory fails with error: "The resource Port-ID is in use"
search cancel

Removing ESXi host from the vCenter inventory fails with error: "The resource Port-ID is in use"

book

Article ID: 441834

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

  • Unable to remove an ESXi host from the vCenter Server inventory.
  • The host is placed in Maintenance Mode and removed from the cluster and placed at the data-center level.

  • But the removal operation fails with the error message: "The resource 'Port-ID' is in use".

  • It has already been verified that:
    • No Virtual Machines are residing on the host or mapped to the vDS.
    • No VM Templates are registered to the host and mapped to the vDS.
    • No VMkernel adapters (vmk) on the host are attached to the vDS.
  • Checking further on failed operation in vCenter, it reports that vCenter cannot remove the ESXi host because its still part of the vDS.

  • After further validation it was found that even though all VMs, vmkernels and VM templates had been moved from the ESXi host, there were still physical adapters on the ESXI host mapped to the DVS.

Environment

VMware vSphere ESXi 
VMware vCenter Server 

Cause

Although all resources (VMs, VM templates, and VMkernel adapters) have been successfully moved out of the ESXi host, a physical network adapter (vmnic) on the ESXi host remains assigned as an uplink to the vSphere Distributed Switch (vDS).
vCenter Server locks the host object and prevents inventory removal while physical adapter is still actively bound to the distributed switch fabric.

Resolution

To properly remove/decommission the ESXi host from the vCenter inventory, please follow the below steps:

  • Log in to the vSphere Client and navigate to the Networking view (network icon in the top menu).
  • Expand the Datacenter and locate the specific vSphere Distributed Switch (vDS) that the host is connected to.
  • Right-click the vDS and select Add and Manage Hosts.
  • In the wizard, select the Remove hosts radio button and click Next.
  • Click + Attached hosts, check the box next to the ESXi host you are decommissioning, and click OK.
  • Click Next and complete the wizard to strip the vDS configuration from the host and explicitly free the physical uplink (vmnic).
  • Optional:
    • Log in to the ESXi host via SSH and run esxcfg-vswitch -l to confirm the vmnic is no longer assigned as an uplink to the vDS.
  • Navigate to the Hosts and Clusters view, right-click the ESXi host, and select Remove from Inventory.

Additional Information