Wednesday, July 15, 2009

Terminate VMHost from ESX Console

On the ESXi console, press Alt-F1.

Type the word unsupported (text will not be displayed while typing) and press Enter. A password prompt will appear. Enter the root password for the ESXi host and you will be at a # prompt in the root partition.

The process status (ps) command shows the currently-running processes on a server, and the grep command finds the specified text in the output of the ps command. Type ps -g | grep which will return the WID (first column), CID (second column) and process group ID (PGID) (fourth column) of the running processes of the VM. You will have several entries returned; the number in the fourth column of the entries is the PGID of the VM.

The kill command sends a signal to terminate a process using its ID number. The ‘-9′ parameter forces the process to quit immediately and cannot be ignored like the more graceful ‘-15′ parameter can sometimes be. Type kill -9 which will forcibly terminate the process for the specified VM.

You can check the state of the VM again by typing vm-support -x; you should no longer see the VM listed.

You can leave tech support mode by typing ‘exit’ and press Alt-F2 to return to the normal console mode.

All three of these methods work identically on ESXi hosts in both VMware Infrasture 3and vSphere.

Actual Commands
ps -g | grep %VMHOST_Name%
kill -9 %VMHost_ID%
vm-support -x

No comments:

Post a Comment

Followers