How to delete orphaned VMs on VMware vCenter 6.5

Before VMware vCenter 6.5, deleting orphaned VMs was really easy. You just needed to connect with the VMware vSphere Client (the fat client) to the vCenter server, create a new folder, move the broken stuff in it, and delete the folder.

Well… on vCenter 6.5, that’s not possible anymore as you can’t connect with the vSphere Client on the vCenter server, just to the ESXi.

The only workaround for this was to use PowerCLI (version 6.5 can be downloaded from here)

After installing PowerCLI, start it from your Desktop or from the Start Menu and type:

Connect-VIServer -Server YourvCenterServer

You’ll now be prompted for credentials needed to login in vCenter.

2016-12-13_10-12-48_vmware-powercli-6-5-release-1-build-4624819_000228

The following command will show you all VMs registered in vCenter

Get-VM -Name *

And to delete the orphaned one(s)

Get-VM -Name YourOrphanedVMName | Remove-VM

To see all running VMs and a bunch of other info type:

Get-VM | select * | Out-GridView

When you deleted all your VMs, you should also check to see if the process left behind some crap like unused VMDKs.

Good luck!

Advertisements
About

Victor an End User Computing Architect and Consultant. You find him most of the time on Twitter (@01004753) but also on LinkedIn evangelizing new technologies and processes that can change in good, the world we live in. Victor has expertise in Server & Client Virtualization, Client Management, GPU Virtualization, HyperConvergence and Enterprise Security

Tagged with: , , ,
Posted in error, fixes, HowTo, PowerCLI, vCenter, VMware

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

Follow Victor Homocea on WordPress.com
My Gravatar

Marius Sandbu

Software-defined datacenter, End user computing & cloud Architect (Microsoft MVP Azure, vExpert, Veeam Vanguard, Citrix CTA)

Trafictube.ro

cu camera pe bord

Thincomputing.net

by Michel Roth on the VDI, Desktop Virtualizaion, Application Virtualization, UEM aspects of End User Computing and Product Management

Ingmar Verheij

About Citrix, Remote Desktop, Performance, Workspace, Monitoring and more...

Carl Stalhood

Filling gaps in EUC vendor documentation

Archy.net

Don't Follow the Trend

Victor Homocea

blog.ogs.ro

Ray Heffer

Double VCDX #122 | Cloud Architect

Elvis Apostol

Calatorind prin lumi indepartate, pictez in cuvinte, lacrimi de culori.

%d bloggers like this: