Monday, September 9, 2013

Hyper-V 2012 VM will not delete from Hyper-V Manager

Caution: Make sure you have a backup and you do not need this VM or its data. “you break it you bought it…”

First we need to locate the proper GUID name to delete the VM. To do so start Powershell as an Administrator and use the following command:

Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto

clip_image002

Note: In the example above if there was a VM it would show the process id and GUID name of the VM under my host name of TMGKOW8LT.

Now that you know the GUID, browse to your Virtual Configurations path, in my case E:\Hyper-V\Virtual Machines\ locate the proper GUID folder and .XML file and delete them both

Browse to your Virtual Hard Disks path in my case E:\Hyper-V\Virtual Hard Disks\ locate the proper hard disk and delete

Now we need to delete the reference in Hyper-V to the VM typically this is located in C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\ and delete the GUID .xml

With a refresh of your Hyper-V manager the VM should be gone.

Credit References:
http://www.petri.co.il/get-hyper-v-virtual-machine-process-id-and-guid.htm

No comments:

Post a Comment