Recently my customer wanted to cancel a "creating a snapshot" task. The task was created by backup application. Unfortunately the cancel option was greyed so wow to cancel it? I will show this in the following post.
At first you have to investigate where a hang process exists (Clicking summary tab on VM). Then:
- Log in to ESXi host via SSH (using e.g. putty). If the SSH service is not running on ESXi host, please enable it.
To enable SSH from the vSphere Client:
- Select the host and click the Configuration tab.
- Click Security Profile in the Software panel.
- In the Services section, click Properties.
- Select SSH and click Options.
- Change the SSH options.
- Click OK.
- Run ps command. If you face problems to find the running processes related to the VM please use grep e.g. ps | grep VM_name. In the below example, I looked for VM named: SPDB1CEN-T:
- Kill the parent process by running the command kill id_parent. In my case: kill 84695.
- The hang task should be canceled now.
It is also possible just to reboot ESXi host (after doing vMotion of other VMs) to solve the issue.
Note: Please follow snapshots best practices and recommendations to avoid problems with them and how to delete snapshots automatically.
Update: You can try the below options:
- Log in to ESXi host via ssh.
- Run esxcli vm process list to get world id of VM.
- Power off the virtual machine from the list by running this command: esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber