Posts

Showing posts from July, 2011

Hard kill VM in vSphere 4 and 5

First of all you need PowerCLI  for this to work. Next, try the following sequence of commands:       - Connect-VIServer -Server - directly connection on problematic ESXi server or vCenter       - $esxcli = Get-EsxCli -Server - fetching of useful command (without "Server" if directly on ESXi)       - $esxcli.vms.vm.list() | Format-Table -Property DisplayName, WorldID - find problematic VM by worldID       - $esxcli.vms.vm.kill("soft", [worldID]) - "kill" with 3 options: soft, hard and force (first try with hard and only in really big problems use force...without "[]" of course) Or, if just want to kill VM process in ESXi 3.5-5 directly (without need of PowerCLI) then this is useful too:        - ps | grep vmx which gives something similar to:       7662 7662 vmx /bin/vmx    7667 7662 vmx /bin/vmx    7668 7662 mks:VirtualMachineName /bin/vmx    7669 7662 vcpu-0:VirtualMachineName /bin/vmx Underscored ones are parents ID's which needs