Cannot Remove a vSphere host from vCenter

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) ;-)

2 Responses to Cannot Remove a vSphere host from vCenter

  1. Pingback: Technology Short Take #5 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers

  2. Tomas says:

    I have run into situations where even PowerCLI will “block” removal. I wrote an article on how to work around this on my blog and though it might be helpful to your readers as I ran across this article in my search for a solution.

    http://www.noplanningrequired.com/2010/12/when-you-cant-remove-vsphere-host-from-cluster/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 962 other followers