"Remove from Inventory" option grayed out for ESXi host
search cancel

"Remove from Inventory" option grayed out for ESXi host

book

Article ID: 388696

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

  • In the vCenter Server UI, the "Remove from Inventory" option is grayed out for some ESXi hosts.
  • However, the option is available for other ESXi hosts.
  • Reviewing the logs, 

    /var/log/vmware/vmware-updatemgr/vum-server/vmware-vum-server.log

    yyyy-mm-ddThh:mm:ss info vmware-vum-server[3912100] [Originator@6876 sub=VciHostRemediateTask.VciHostRemediateTask{1455}] [vciHostRemediateTask 434] Host host-<host_id> scheduled for patching.
    yyyy-mm-ddThh:mm:ss info vmware-vum-server[3912100] [Originator@6876 sub=VciHostRemediateTask.VciHostRemediateTask{1455}] [vciHostRemediateTask 445] Add remediate host: vim.HostSystem:host-<host_id>

    yyyy-mm-ddThh:mm:ss info vmware-vum-server[3912100] [Originator@6876 sub=VciHostRemediateTask.VciHostRemediateTask{1455}] [vciHostRemediateTask 791] Disabled host methods: destroy

    yyyy-mm-ddThh:mm:ss error vmware-vum-server[3912100] [Originator@6876 sub=Default] [VdbStatement] SQL execution failed: INSERT INTO VCI_VC_CLEANUP_ACTION(action, create_time, vc_object, id) VALUES (?, ?, ?, ?)

Environment

VMware vCenter Server 7.x

VMware vCenter Server 8.x

Cause

Before starting the remediation, VUM disables 'vim.ManagedEntity.destroy' method which will make sure that the hosts are not removed from the inventory while the remediation is in progress. After that, it creates a task to activate the destroy method once the remediation completes. Here, VUM is successfully doing the first half of the task but failing at the 2nd step. VUM is ignoring the above error and going ahead with the remediation. As the task to enable 'vim.ManagedEntity.destroy' method is not added to DB, VUM doesnt enable it after remediation succeeds/fails.

Resolution

The issue can be resolved by using one of the following methods:

  • Create a new cluster and move the host to the new cluster
  • Move the host to the datacenter and using PowerCLI command to remove the host
    • connect-viserver <vcenter FQDN or IP Address>
    • get-vmhost <esx_hostname> | remove-vmhost -confirm:$false
  • Reboot vCenter Server