VMware is one of the leading virtualization platforms. Virtualization enables you to create virtual networks, servers, operating systems, and storage devices. It makes it possible to run several operating systems on one device, save the virtually created OS to files, move a virtual machine to a physical server, and more.
You can also delete an orphaned VM in VMWare. Read this article to find out how.
What Are Orphaned Virtual Machines?
If you don’t register your virtual machine with a host or a host failover wasn’t successful, a VM can become orphaned. When this happens, the said VM remains in the database, and vCenter Server can see it, but the ESXi host can’t.
You can either move this machine to another host where its files are stored, or delete it.
Deleting an Orphaned VM
When you open the vCenter Server, and you see a Virtual Machine showing as orphaned or invalid, you won’t be able to start it. There may be several reasons for that, and you’ll get a corresponding error message or several of them. For example, communication with the VM may have been interrupted, or a general system error occurred.
You can remove this orphaned machine with a few easy steps:
- Launch VMware on your computer.
- Right-click the name of the machine where it says orphaned in brackets.
- Drag the cursor to All Virtual Infrastructure Actions.
- Point the cursor to More Uncategorized Actions.
- Click on Remove from inventory.
That’s the easy way to remove an orphaned virtual machine from your software, as you don’t have to construct a command to do it.
Delete an Orphaned VM via Command Line
However, sometimes the quick option won’t be available.
If you access the machines via vCenter Web Client, you can’t remove the VM from the inventory, and the process becomes a bit more complicated. You need to use a command-line via the PowerCLI manager designed for this software. It’s quite useful to learn how to use this interface because you can automate many administrative tasks with it.
Here’s how to remove the orphaned VM.
- Start the PowerCLI from the Start menu or your desktop.
- Connect to the vCenter. You may need to type in your user name and password.
- Enter Get-VM –Name to see a list of all virtual machines within the program.
- Type in Get-VM –Name TheOrphanedVM | Remove-VM.
How to Create a VM
When you’ve removed an orphaned virtual machine, maybe you’d like to create a new one. The following steps describe the process:
- Open the VMware Workstation on your computer.
- Select New Virtual Machine.
- Choose the type of machine you’d like to create. It can be Custom or Typical, depending on the hardware you want for your virtual machine. Pick one and click Next.
- Choose an operating system for the machine and select Next. You can use an installer disc or an ISO file to install the system.
- Type in the Product Key, and on the next screen, enter a user name and password.
- Name your virtual machine and pick a disk location where it will save files.
- Set the disk size and whether you’ll be storing the virtual disk as one of two files. Click on Next.
- Verify other settings, such as memory, processors, display, USB controller, network adapter, and others. When you finish setting things up, click on Finish.
When the Tools installation is over, you’ll need to restart the virtual machine to get it started.
Your Virtual World
Virtual machines create a space for you to test and improve your ideas, apps, and programs. They’re super useful to both developers and the QA team. You can also play with them in your free-time and experiment with new operating systems, upgrades, and more.
You can create new virtual machines without any limitations. If some of them become orphaned, you can quickly delete them and start again.
Have you already started using the VMware Workstation? Share your experience in the comments section below.