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: 

2 Responses

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.

  2. Written by Simonfen
    on 15 June 2018 at 0:12
    Reply · Permalink

    You’re the best!!! Thanks for your post!

Subscribe to comments via RSS

Leave a Reply