The interesting thing is how it happened and what the resolution is.
So, we have a VCSA 6.5 vCenter and 2 ESXi 6.5 hosts joined to it. The lab manual has us build a nested VCSA VM to run through the installation of VCSA. AS soon as you get the VM setup, they have you delete it. BUT, they have you use the new embedded Host Client which debuted in ESXi 6.0 with Update 2.
Since you do this from the host & NOT from the Web Client or new vSphere Client (HTML5) through vCenter, the VM is gone, but the object in vCenter inventory that represents the VM still exists and shows up as orphaned:
https://kb.vmware.com/kb/1011468, we have a workaround.
Here are the steps:
- Open VMware Infrastructure or vSphere Client and connect to vCenter Server with a user with Administrative rights.
- Change the view to the VMs and Templates inventory view.
- On the left pane, right-click vCenter Server, click New Folder and provide an alpha-numeric name to the folder.
- Click the virtual machine and while holding the left mouse button, drag the virtual machine to the folder created in step 3.
- Right-click the folder, and click Remove. The folder and its contents are deleted.
This KB is OLD, so in Step 1 in vSphere 6.5, you might see a problem ... There is no Windows based vSphere Client available. But hold it, the KB shows support for vCenter 6.5, how can that be?
Well, here's a little known fact. IF you have the 6.0 Update 2 version of the OLD Windows based vSphere Client installed, you can actually use it to connect to vSphere 6.5! Well, kind of, you CAN connect to an ESXi 6.5 host but NOT a vCenter 6.5 server. So again we are stuck.
OK, so the real answer is to use the command line.
You need to remove the VM information from the vCenter database.
One easy way is with PowerCLI 6.5 Release 1, you need to:
- Connect to vCenter with a connect-viserver <VC FQDN>
- Issue the command get-vm | select name so you can see the VM in question
- Issue a remove-vm <VM name> to remove the orphaned VM
- Re-run the original command to verify it's gone and view the inventory!
We start with this VM:
Never too late to learn PowerShell with PowerCLI for vSphere 6.5!