If Powering off the virtual machine from vSphere Web Client or Host Client does not work , you must use the command line method.
Determine the host on which the virtual machine is running. This information is available in the virtual machine's Summary tab when viewed in vCenter web client.
There are several methods to power off the non-responsive virtual machine using command line as the following:
Warning: Follow the sections and steps in this article in order.
# vim-cmd vmsvc/getallvms
Example output:
# vim-cmd vmsvc/power.getstate VMID
# vim-cmd vmsvc/get.tasklist VMID
(ManagedObjectReference) [
'vim.Task:haTask-2-vim.VirtualMachine.createSnapshot-182550283',
'vim.Task:haTask-2-vim.VirtualMachine.consolidateDisks-182550274'
]
$ vim-cmd vimsvc/task_info haTask-2-vim.VirtualMachine.createSnapshot-182550283
vim.TaskInfo) {
dynamicType = <unset>,
key = "haTask-2-vim.VirtualMachine.createSnapshot-182550283",
task = 'vim.Task:haTask-2-vim.VirtualMachine.createSnapshot-182550283',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.createSnapshot",
descriptionId = "VirtualMachine.createSnapshot",
entity = 'vim.VirtualMachine:2',
entityName = "VMware vCenter Server Appliance5-1",
state = "running",
cancelled = false,
cancelable = false,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 50,
reason = (vim.TaskReasonUser) {
dynamicType = <unset>,
userName = "vpxuser",
},
queueTime = "2014-11-09T17:49:01.171933Z",
startTime = "2014-11-09T17:49:01.175521Z",
completeTime = <unset>,
eventChainId = 182550283,
changeTag = <unset>,
parentTaskKey = <unset>,
rootTaskKey = <unset>,
}
# vim-cmd vimsvc/task_cancel task_id
# vim-cmd vmsvc/power.shutdown VMID
# vim-cmd vmsvc/power.off VMID
Example output:
# esxcli vm process list
Example output:
# esxcli vm process kill -t=soft -w=WorldID
or
# esxcli vm process kill -t=hard -w=WorldID
or
# esxcli vm process kill -t=force -w=WorldID