ESXi Host fails to remove from vCenter Inventory with error - The object or item referred to could not be found
search cancel

ESXi Host fails to remove from vCenter Inventory with error - The object or item referred to could not be found

book

Article ID: 370273

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

ESXi Host fails to remove from vCenter Inventory with error "The object or item referred to could not be found. vDS dvs port ########-####-####-####-#######c554 cannot be found".

Environment

  • VMware vCenter Server 7.0
  • VMware vCenter Server 8.0

Cause

This occurs if the Host was incorrectly removed from vCenter and the Host entry remains in vCenter Database leading to stale entry.

Resolution

The resolution requires removing the host manually from VCDB (vCenter Database) : 

  1. Ensure that the ESXi host to be removed has no active VMs and / or Templates running on it and the ESXi host is in Maintenance Mode.  VM templates can be harder to find, so you may have to search for them more.
  2. SSH to vCenter with root credentials
  3. Switch to Shell - Refer KB Toggling the vCenter Server Appliance default shell
    1. Log in to the vCenter Server Appliance through SSH.
    2. Run this command to enable access to the Bash shell:
      shell.set --enabled true
    3. Type shell and press Enter.
    4. In the temporary BASH shell, run this command to permanently configure the default Shell to BASH for root:
      chsh -s /bin/bash root
    5. Log out of the BASH Shell.
    6. Log in again for the changes to take effect.
  4. To see if this is an issue with remaining entries in the vCenter database
    1. Connect to vCenter Database (VCDB):
      /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
    2. Run the command to check the host entry
      1.    # select * from VPX_ENTITY where name ='<Host Name or IP address of the Host to be removed>';
      2. Sample output:
        VCDB=# select * from vpx_entity where name='esxi01.example.com';

           id    |           name                   | type_id | parent_id

        ---------+---------------------------+---------+-----------

         1######7 |     esxi01.example.com          |       1 |   1######7

         1######7 |     esxi01.example.com          |       2 |         1

        Note: There are 2 entries for the same host with id of one of the host entries being the parent_id for the other host entry.

Capture the output from above step and Please contact Broadcom support for assistance to remove host from VCDB (vCenter Database).  Once you are working with Broadcom support, you will likely need a snapshot of the vCenter and powered off snapshots of the vCenters if they are in ELM (Enhanced Linked Mode).  vCenter service(s) will need to be stopped during any database changes, so expect some time where vCenter service(s) are not available while Broadcom Support works with you to resolve this issue.