This article provides steps for shutting down an unresponsive virtual machine from the ESXi CLI when facing below scenario:
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 999. 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
VMware ESXi 6.x , 7.x , 8.x
If powering off the virtual machine from vSphere Client or Host Client will not work, use one of the command line methods below.
There are several methods to power off the non-responsive virtual machine using command line as the following:
It's recommended to 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-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 by replacing esxcli
with localcli
.
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
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
In case none of the above methods work, it might be necessary to reboot the ESXi host to get rid of the stale vm process