Start and stop ESXi VMs from console
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]
on 22 November 2014 at 0:14
· Permalink
excellent, my vsphere client has crapped out and this had just saved my bacon, thanks.
on 15 June 2018 at 0:12
· Permalink
You’re the best!!! Thanks for your post!