Start and stop ESXi VMs from console

esx

Sometimes you don’t have VMware vSphere Client handy, or you might need to restart a server remotely via SSH. In these cases it’s great to be able to turn virtual machines on and off via the command line.

Read on for a brief overview.

Log on to the ESXi server using SSH and then you can use the following commands:

The basic command to control the virtual machines is

vim-cmd vmsvc

To list all virtual machines run:

vim-cmd vmsvc/getallvms

To work with individual VMs you need the ID provided by the previous command.  To get a summary of the machine run:

vim-cmd vmsvc/get.summary [ID]

To power on a VM run:

vim-cmd vmsvc/power.on [ID]

To power off a VM run

vim-cmd vmsvc/power.off [ID]

To suspend a VM run

vim-cmd vmsvc/power.suspend [ID]
Posted on March 22, 2014 at 0:48 by simon · Permalink
In: Vmware · Tagged with: 

One Response

Subscribe to comments via RSS

  1. Written by Mo
    on 22 November 2014 at 0:14
    Reply · Permalink

    excellent, my vsphere client has crapped out and this had just saved my bacon, thanks.

Subscribe to comments via RSS

Leave a Reply