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

Advertisements

2 thoughts on “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

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 )

Google+ photo

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

Connecting to %s