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

vSphere - Virtual Machine Will Not 'Power Off' (Hangs at 95%)

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.

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

 

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

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.

 

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

Syntax

kill {PID}

Example

kill 1398644

 

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

Posted by: Natural Networks NOC - January 9, 2015. This article has been viewed 1021 times.
Online URL: https://kb.naturalnetworks.com/article.php?id=173

Powered by PHPKB (Knowledge Base Software)