Labels

woensdag 5 oktober 2016

Kill Hyper-V client in "stopping" state

To kill a VM in "stopping" state on a Hyper-V platform run the following commands ont the Hyper-V host who hosts the problematic machine:


1. Find the Guid of the problem VM:
$vmname = "COMPUTERNAME"
$id = (get-vm | ? {$_.name -eq $vmname} | select id).id.guid

2. Find the VM worker process who's responsible for the problematic machine:
$vm_pid = (Get-WmiObject Win32_Process | ? {$_.Name -match 'vmwp' -and $_.CommandLine -match $id}).ProcessId
 

3. Kill process:
stop-process $vm_pid -Force

Geen opmerkingen:

Een reactie posten