No Power Option

There are times which some VMs are freezing and in these situations there is no option for restart or shutdown.
Today I got same experience and hopefully this time it was in my home lab, if it were in production … 🙄

Anyway, getting to the main point, in these situation admins may wants to terminate currently  halted VM process and restarting it as soon as possible.
I did this before on VMware ESX 3.5 and ESXi 4.x but this time lets check the process on VMware ESXi 5.0.

First of all get access to the host and for this series of action Local TSM or Remote TSM make no difference; There are two command under “esxcli vm process” which are going to be used for this purpose as shown in the below image:

First of all let’s get all info we need by running below command:

esxcli vm process list

This command will list all VMs in running state and some of their corresponding information like “World ID, Config File and Display Name”, after finding the target VM note it’s “World ID” somewhere for further use.
Now it’s time for doing the main action, but before that just check the “esxcli vm process kill” option in the below image:

As it shown in the above image, there are two options of “type” and “world-id” for “esxcli vm process kill” command.
“-t” or “–type” will indicate the type of kill operation and it could be “soft, hard, force” while “soft” is recommended to use first.
“-w” or “–world-id” is related the running VM and it will be use for selecting and killing process.
Now that we have  “world id” of VM from previous step, we can use it for killing its process by following command:

esxcli vm process kill  -t soft -w XXXX

After running the command it will end with no prompt or message, just like below:

And for being sure, you can run the “esxcli vm process list” command again and looking for that VM.

❓ Note:
If VMware HA is configured on the cluster which containing this VM, it will automatically restart this VM on the other host from the same cluster.
It can be a way for testing VMware HA configuration (in lab, education, …) to see if it’s ready to protect VMs.  😉

P.S: based on kill command and list command, you can see which VM made this post possible.  😉

It's your kindness to leave a reply/feedback