Powering on a virtual machine from the command line when the host cannot be managed using VMware vSphere Client
search cancel

Powering on a virtual machine from the command line when the host cannot be managed using VMware vSphere Client

book

Article ID: 345049

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to power on virtual machines from the command line (either through the ESX host console or through the RCLI/vSphere CLI) if the host cannot be managed from VMware vCenter Server or from the VMware vSphere Client.

Environment

VMware vSphere ESXi 5.0
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.7
VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 8.0.x
VMware vSphere ESXi 6.5
VMware vSphere ESXi 5.1
VMware vSphere ESXi 5.5

Resolution

Note: The steps in this article require root access to the host, either at the physical console or using SSH. For more information on enabling root access, see Enabling root SSH login on an ESX host (8375637)

 

ESXi 4.x, 5.x, 6.x, 7.0.x and 8.x

To power on a virtual machine from the command line:
  1. List the inventory ID of the virtual machine with the command:

    vim-cmd vmsvc/getallvms |grep <vm name>

    Note: The first (leftmost) column of the output shows the vmid.
     
  2. Check the power state of the virtual machine with the command:

    vim-cmd vmsvc/power.getstate <vmid>
     
  3. Power-on the virtual machine with the command:

    vim-cmd vmsvc/power.on <vmid>

Note: vim-cmd depends on hostd working properly. If hostd is stopped, you might see the following error after executing vim-cmd:
 

Failed to login: Connection refused: The remote service is not running, OR is overloaded, OR a firewall is rejecting connections.

Additional Information