Unable to remove VMware ESXi host in VMware vCenter

Written on Monday 30 May 2011 by Gert Van Gorp in category: VMware

During a migration process from ESX to ESXi at a customer site we had a problem removing a server from the vCenter inventory.

We checked the permissions on this server and we saw that the user who wanted to remove the server was admin on datacenter level.  Here the screen we got.

 Cannot Remove ESXi Host

Knowing there is a PowerCLI command to remove a ESXi host from the vCenter, we walked that way with success.

I used this PowerCLI script to remove this server from the inventory after moving the server out of the cluster to the datacenter level.

Connect-VIServer  vCenterServer

Remove-VMHost "HostThatCannotBeRemovedViaGui" –confirm:$false

Disconnect-VIServer –confirm:$false

Comment