I’ve seen this multiple times now with VMware. You cancel a task via vCenter or the ESXi UI and it just stays there hanging and nothing further happens. Normally this situation resolves itself after some time, but just last week I had a case where the task never stopped. While the Webclients weren’t really helpful in that case, we were able to cancel this task with the ESXi commandline.
Warning: Interupting certain tasks, for example snapshot consolidations or Storage vMotions, can lead to issues or corrupted VMs. So only do this if you don’t have any alternatives and need the task to be canceled. And better have a backup at your hand.
Solution
- Start the SSH service on the ESXi host where your VM is registered
- Connect via SSH
- Query the VM ID: vim-cmd vmsvc/getallvms
- Query all tasks for this VM: vim-cmd vmsvc/get.tasklist “VM ID”
- Check the Task information: vim-cmd vimsvc/task_info “haTask….”
- Is the task still state still active?
- Note: The screenshot is just an example; the task state is success, so it’s completed
-
Chancel the task: vim-cmd vimsvc/task_cancel “haTask….”
This should be it. Afterwards you can check in the task info whether the task has been canceled successfully. If you have multiple active tasks, then first try to stop the oldest one and wait if all further tasks get cleaned up later on.
Source: VMware Knowledge Base