VMware Cloud Community
virtual_Vic
Contributor
Contributor

VI3 - PID Question

Hello everyone...

How do I list in readable format what the PID is for a VM that is hanging?

Also, after I find the PID, what is the command to KILL it?

Thanks in advance...

-Vic

0 Kudos
7 Replies
Dave_Mishchenko
Immortal
Immortal

ESX 3.0 method

o Login to the service console

o You can check the VM state by typing “vmware-cmd /”

o You will be prompted if you want to include a screenshot of the VM, send an NMI to the VM and send a ABORT to the VM, you must answer Yes to the ABORT question to kill the VM. The entire process will take about 5-10 minutes to run. It will create a tar archive in the directory you run it in.

0 Kudos
virtual_Vic
Contributor
Contributor

Hi Dave,

Thanks for the quick response. Here is the output of the fist method:

\[root@PRBINFESX003 root]# ps -ef |grep myguestos.vmx

root 31681 31590 0 16:10 pts/1 00:00:00 grep myguestos.vmx

so I killed the number on my 2nd column (31590) and all that did was kill my putty session to the host. I did this on another VM on this same host and it gave me this output:

root 10020 1 0 05:43 ? 00:00:03 /usr/lib/vmware/bin/vmkload_app /usr/lib/vmware/bin/vmware-vmx -ssched.group=host/user/pool29 -@ pipe=/tmp/vmhsdaemon-0/vmxe25c0a20b1d4cbc9;vm=e25c0a20b1d4cbc9 /vmfs/volumes/46168626-a9ff79e2-700a-0019bb3ce956/myguesos1/myguestos1.vmx

so I'm guessing that 10020 is the actual PID of that VM and it safe to kill. My question now is...

If the VM isn't coming back with a PID but in the VIC it showing as running (even though it's not), what would my next step be short of putting this host in maintenance mode and bouncing the host once the VMs have migrated off?

-Vic

0 Kudos
Dave_Mishchenko
Immortal
Immortal

In the below example, PS finds both the process for the VM (PID is in italics and PS also find my console process because it runnnig a command with test1.vmx in it. To kill the VM I ran the below kill command.

If the server is communicating Ok with VirtualCenter, the VM will show as being down quite quickly. If not, you could run the below command to restart the VC agent on the host.

service mgmt-vmware restart

\[root@ESX01 root]# ps -ef | grep test1.vmx

root 28962[/i] 1 0 08:35 ? 00:00:00 /usr/lib/vmware/bin/vmkload_app /usr/lib/vmware/bin/vmware-vmx -ssched.group=host/user -@ pipe=/tmp/vmhsdaemon-0/vmx8b8fbe27f08e4a8c;vm=8b8fbe27f08e4a8c /vmfs/volumes/44a6fdaf-e7f2a104-d9a2-00096b63ac0a/test1/test1.vmx

root 29790 17184 0 08:39 pts/1 00:00:00 grep test1.vmx[/b]

\[root@ESX01 root]# kill -9 28962

\[root@ESX01 root]#

0 Kudos
virtual_Vic
Contributor
Contributor

Dave,

Thanks for all the advice. One question about the "service mgmt-vmware restart command:

I have about 25 VMs running on this host. Will running this command effect them as well?

In others words, if I use this command, will the other VMs remain available even though the VC agent is being restarted?

-Vic

0 Kudos
esiebert7625
Immortal
Immortal

No it will not effect them with one exception, there is a bug in 3.0 and 3.0.1 that was patched in the 5/15 round of patches. If you use Autostarts on your server and use that command your VM's will power down. You can disable Autostarts prior to doing it on the ESX server by selecting Configuration, Virtual Machine Startup/Shutdown. The kill methods listed above come from the documentation on my website, http://vmware-land.com/Vmware_Tips.html

See this post...

http://www.vmware.com/community/thread.jspa?threadID=75462&tstart=0

Here is the fix for it...

http://www.vmware.com/support/vi3/doc/esx-7557441-patch.html

0 Kudos
virtual_Vic
Contributor
Contributor

Ok,

So i've been out for a bit and I want to give credit where credit is due. How do I mark this as an answered question?

Sorry for this taking so long.

-Vic

0 Kudos
Dave_Mishchenko
Immortal
Immortal

When you create the post, you have to mark it as a question then (or up to 15 minutes after you add the post). Then you'd have the option to mark it as answered and one post as correct and up to 2 as helpful.

http://www.vmware.com/community/help.jspa#questions

0 Kudos