This article provides steps for shutting down an unresponsive virtual machine
A general system error occurred: Syscall kill returned error (-1) during vm termination attempt: ## with cartel id: ## and error message: No such process
Soap error ####. The operation is not allowed in current state
The attempted operation cannot be performed in the current state (Powered Off)
The request refers to an object that no longer exists or has never existed
Another task in progress
If the virtual machine remains unresponsive to power commands from the vSphere Client or ESXi host client, follow the methods below
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-1234567',
'vim.Task:haTask-2-vim.VirtualMachine.consolidateDisks-12345678'
]
vim-cmd vimsvc/task_info task_id command to see the task in more detail.vim-cmd vimsvc/task_info haTask-2-vim.VirtualMachine.createSnapshot-1234567
vim.TaskInfo) {
dynamicType = <unset>,
key = "haTask-2-vim.VirtualMachine.createSnapshot-1234567",
task = 'vim.Task:haTask-2-vim.VirtualMachine.createSnapshot-1234567',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.createSnapshot",
descriptionId = "VirtualMachine.createSnapshot",
entity = 'vim.VirtualMachine:2',
entityName = "VM_name",
state = "running",
cancelled = false,
cancelable = false,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 50,
reason = (vim.TaskReasonUser) {
dynamicType = <unset>,
userName = "********",
},
queueTime = "YYYY-MM-DDThh:mm:ss.msZ",
startTime = "YYYY-MM-DDThh:mm.ss.msZ",
completeTime = <unset>,
eventChainId = 1234567,
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: Note: If esxcli does not work, use localcli instead; Replace esxcli with localcli.
esxcli vm process list
Example output:
esxcli vm process kill -t soft -w WorldIDoresxcli vm process kill -t hard -w WorldIDoresxcli vm process kill -t force -w WorldID
esxcli vm process kill" command, evacuate all other VMs off the ESXi host and restart the ESXi itself.localcli vm process kill" command returns a "No such process" error or returns no error but the VM still appears in the "localcli vm process list" output, back up the running VMs in the Guest OS if necessary, then power off and power on the ESXi server during a maintenance window.Killing a virtual machine using esxtop is equivalent to a forced hard shutdown with esxcli.
esxtop
If none of the above methods work, you need to evacuate all other VMs off the ESXi host and restart the ESXi itself to flush the stale vm process.