What to do when hyper-v (VM) gets stuck
big thanks to
http://www.petri.co.il/get-hyper-v-virtual-machine-process-id-and-guid.htm
I just faced a problem today where a VM refused to turn off
(user did a dirty snapshot of a machine and it was in an odd error state).
I did not want to bring down the entire server, nor did I
want to hard turn off all machines (restarting hyper-v service will do that).
Each hyper-v VMs are a process on their own. Therefore you
can shut each of their process down manually if things do not go the way you
expected.
1. Open
up powershell with elevated rights (run as admin
2.
Type the following
Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto
Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto
3. Write
down the Process ID
4. Go
to task manager à processes
and end the corresponding PID
Note: make sure its called “VMWP.EXE”
Note: make sure its called “VMWP.EXE”
5. The
VM will automatically reboot.