VMWare ESX – How to clear a hung VM guest OS.

# VMware

I’m guessing that most ESX administrators have experienced at least one time where a VM decides to hang leaving them unable to shut down or restart it.

You have half a dozen production VM’s running, you don’t have VMotion in place and this rogue VM that you need back up and running ASAP is sitting in a greyed out state.

What do you do?

Well you could give one of the following methods a go to try and stop the VM.

DISCLAIMER: Try these commands at your own risk.  As with any hung process file corruption can occur when not stopped correctly by the associated application or process.

Log onto the ESX server itself and try one of these commends.

(The commands below should be typed all on one line – also, the datastorename can be quite long so make sure you don’t make a typo)

The Karate Chop:

vmware-cmd /vmfs/volumes/<datastorename>/<vmname>/<vmname>.vmx stop

or The Finger of Death (Be warned this no holds barred move will attempt to kill the VM instantly):

vmware-cmd /vmfs/volumes/<datastorename>/<vmname>/<vmname>.vmx stop hard

Failing that from the ESX console issue the following commands:

1. Firstly list the running VM’s and their associated VM ID’s:

vm-support -x

image

2. Once you have the VM ID of the rogue VM you wish to stop then issue the command (Note: that both commands are case sensitive and one uses a capital ‘x’ and the other lowercase):

vm-support -X <VMID>

Answer the questions (usually ‘no’ to most) and then wait for a good 3-4 minutes whilst a tgz file is generated containing support information.  This file is a side product and can be deleted off of the Root directory so to clear disk space.

Hope this helped tame your unruly VM instance…

ESX

Technorati Tags: ,,,,,,,,,,,

VN:F [1.8.5_1061]
Rating: 0.0/5 (0 votes cast)
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)

Related posts:

  1. VMware Workstation – “Cannot open one of the virtual disks needed by this VM because it is larger that the maximum size supported by the host file system” After moving a VMware Workstation VM from one PC...
  2. How to Manually Remove VMware Tools Ever had the problem where you either have a...

You can leave a response, or trackback from your own site.

5 Responses to “VMWare ESX – How to clear a hung VM guest OS.”

  1. Ryan Liebke says:

    Dude, You are the man! vm-support -X did the trick. Thank you for taking the time to post this!

    UN:F [1.8.5_1061]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.5_1061]
    Rating: 0 (from 0 votes)

    [Reply]

  2. Carl Amess says:

    Hi,

    This killed the VM Guest for us but the GUI and command line still showed that it was still running so that we could not restart.

    We had to restart then management interface on the actual ESX server using the following command:-

    service mgmt-vmware restart

    Although you have to make sure that the option to Automatically Startup/Shutdown the virtual machines with the System is set to disabled on the ESX server.

    Regards

    UN:F [1.8.5_1061]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.5_1061]
    Rating: 0 (from 0 votes)

    [Reply]

  3. Evert Meulie says:

    Thanks, guys!

    You saved me from having to take an entire webfarm down! :-)

    Greetings,
    Evert

    UN:F [1.8.5_1061]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.5_1061]
    Rating: 0 (from 0 votes)

    [Reply]

  4. Jeff Jennings says:

    Kudo’s to you. I did not want to have to call the datacenter and have them reboot the host machine – this worked!

    UN:F [1.8.5_1061]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.5_1061]
    Rating: 0 (from 0 votes)

    [Reply]

    Kiwi Si Reply:

    Hi Jeff,

    Glad you found it useful, a trip or call to the datacenter is always good to avoid. :)

    Cheers,

    Simon

    UA:F [1.8.5_1061]
    Rating: 0.0/5 (0 votes cast)
    UA:F [1.8.5_1061]
    Rating: 0 (from 0 votes)

    [Reply]

Leave a Reply

You can add images to your comment by clicking here.

Virtualization Pro Summit 2010
Veeam - Backup & Replication
Virtu-Al.net
TrainSignal - vSphere Pro
PHD Virtual - esXpress
StarWind Software