When this is the case you will be getting error messages like: The operation is not allowed in current state or The attempted operation cannot be performed in the current state (Powered Off) or anything else along this line.
Recently a was working at a customer and the had a similar situation with 2 VMs, the admin's working on it where not able to successfully shutdown the either of the VMs. They asked if I knew a way to do it, maybe from the CLI.
I knew I could kill the process of these VMs thru CLI with the command esxcli vm process list to get the world-id followed by esxcli vm process kill -t [soft,hard,force] -w WorldNumber to kill the process running the VM. But for some reason I was not able to find the VMs concerning in the output presented in the CLI (perhaps to many VMs on the host and over-looked it).
As alternative I also knew there was a way to kill processes from esxtop (only available on ESXi 4.x and 5.x), but I did not have all the details on the steps to perform but this was quickly solved by a quick search thru the VMware KB.
As it turned out, I think I prefer the "esxtop way" above the other ways of doing it, for 2 reasons; first esxtop is something you use regularly (I assume) and second it is a very clear and "visible" way.
How to use esxtop to kill processes of unresponsive VMs:
- On the ESXi console, enter Tech Support mode or connect thru SSH and log in as root.
- Run esxtop
- Press c to switch to the CPU resource utilization screen.
- Press Shift+v to limit / filter the view to virtual machines.
- Press f to display the list of fields.
- Press c to add the column for the Leader World ID.
- Identify the target virtual machine by its Name and Leader World ID (LWID).
- Press k.
- At the World to kill prompt, type in the Leader World ID from step 7 and press Enter.
- Wait 30 seconds and validate that the process is not longer listed.
*Note; for the one's running ESX instead of ESXi please refer to VMware KB1004340 as there a different ways to do this on these systems.
Thanks it works for me.
ReplyDeleteHowever it takes 1min instead of 30 sec.
Rest all perfect.