vSphere – Virtual Machine Will Not ‘Power Off’ (Hangs at 95%)

KB ID 0000911 

Problem

I had a virtual machine crash on me, while I was doing some work on it As I was unable to shut it down gracefully, I attempted to ‘Power Off’. It progressed to 95% and stopped there.

VM Stuck at 95%

Expecting it to ‘time out’, I carried on with some other work and kept an eye on it. 30 minutes later there was still no progress.

Solution

1. Enable SSH access on the ESX host that is hosting the problem VM.

2. Connect to the ESX host via SSH, and logon as root. Execute the following command to see all the running VMs on this host, and list their world ID numbers.

esxcli vm process list

Locate VM World ID

 

3. Once you have the World ID of the problem VM, you can attempt to power it off with the following command;

Syntax

esxcli vm process kill --type {soft,hard,force} --world-id {ID Number}
Example

esxcli vm process kill –type hard –world-id 1397444

 

Terminate a hung VM

4. Check, and your VM should now be powered off.

If That Didn’t Work (How to Kill a VM)

Note: This is a last resort.

1. Issue the following command to locate the Process ID’s that are associated with the problem VM.

Syntax

ps | grep "VM Name"

Example

ps | grep "2012 Test"

You will get all the processes, and they are preceded by two columns of numbers, the first column contains the individual PID’s. The second column is the PID for the parent process, this is the one you need.

Locate PIDs for a VM

2. Armed with your PID, you need to terminate that parent process with the following command;

Syntax

kill {PID}
Example

kill 1398644

Stop a Process ID PID in ESX

3. Check, and your VM should now be powered off.

Related Articles, References, Credits, or External Links

NA

Author: Migrated

Share This Post On