Determine the power status of a virtual machine on an ESX or ESXi Host
search cancel

Determine the power status of a virtual machine on an ESX or ESXi Host

book

Article ID: 309034

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides information on how to determine the power status of a virtual machine on an ESX or ESXi host. In some instances, the power status of a virtual machine on an ESX or ESXi host cannot be determined just by looking at the VMware graphical interface. The article also allows you to determine the process ID (PID) of a powered on virtual machine.

Resolution

To confirm that your virtual machine is powered on:
  1. Check the state of the virtual machine according to the vCenter Server by pointing the vSphere Client at your vCenter Server host.
     
    1. Launch the vSphere Client.
    2. In Server, enter the IP of the vCenter Server host.
    3. Provide a valid log in for the vCenter Server host, such as administrator and its password.

    Verify that the virtual machine is powered off.

    Notes:
     
    • This may not always be accurate. Complete the following steps to determine the status of the virtual machine.
    • If the option to power on the virtual machine is unavailable, try restarting the vCenter Server service.
    • If the virtual machine is shown as powered on in vCenter Server but is powered off in the following steps, restart the vCenter Server service.


      Note: For more information, see Stopping, starting or restarting the vCenter Server service (1003895).
       
  2. Check the state of the virtual machine according to the ESX/ESXi host by directly pointing the vSphere Client at the ESX/ESXi Server host.
    1. Launch the vSphere Client
    2. Enter the IP of the ESX/ESXi Server host under server
    3. Provide a valid log in for the ESX/ESXi Server host such as root and it's password.

    Verify that the virtual machine is powered off.
     
  3. Open an SSH session directly to the ESX/ESXi host. For more information, see Opening a command or shell prompt (1003892).
  4. Run this command to verify the power state of the virtual machine.
     
    • In ESX – vmware-cmd <cfg> getstate

      Where <cfg> is the path to the configuration file as determined by the vmware-cmd –l command.

      For more information on the vmware-cmd command, see the Performing common virtual machine-related tasks with command-line utilities.
       
    • In ESXi – # vm-support -x ( Note: For ESXi 5.x - # vm-support -V ) OR # vim-cmd vmsvc/getallvms

      From the output, get the ID and then use it to run this command to check the power state:

      # vim-cmd vmsvc/power.getstate <Vmid>
       
  5. For virtual machines on the ESX host, run this command to check if there is a process running for the virtual machine:

    ps –auxwww | grep –i VM_NAME

    This is a standard Linux command to list processes. If a process other than the grep command that you have just run shows up in this list, note the second value in the column. It is the process ID (PID) and may be required in later troubleshooting steps to resolve your issue.

For virtual machines on an ESXi host, see Powering off a virtual machine on an ESXi host.