Today I wanted to remove a test vSphere host from my Lab environment but the option Remove was grayed out.

image

I couldn’t find any other options in vCenter so I tried it with PowerCLI. I took a look at the vSphere PowerCLI Cmdlets Reference and searched for the remove-vmhost cmdled. This is what the Cmdlets Reference returned:

Removes the specified hosts from the inventory.

Syntax

Remove-VMHost [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

Removes the specified hosts from the inventory.

So with the following command:

Remove-VMHost esx3.ict-freak.local -Confirm:$false

you can remove the vSphere host from the vCenter server. The –Confirm:$false parameter disables the confirm question.

I didn’t use the –Confirm parameter so I got the Confirm question:

image

After running the command the vSphere host was removed from my vCenter server. So PowerCLI to the rescue (again) 😉

3 thoughts on “Cannot Remove a vSphere host from vCenter

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.