ESX Useful commands

If you’ve enabled SSH, there are a series of useful commands you can run against the VMs on the host

I’ll keep this post updated with those I’ve found most useful


Gets a list of the VM ids for use in subsequent commands

vim-cmd vmsvc/getallvms

Get the snapshot info for a given VM ID (which you can obtain with the previous command)
vim-cmd vmsvc/snapshot.get <VM ID>

Remove all snapshots for a given VM ID.
vim-cmd vmsvc/snapshot.removeall <VM ID>

Create a snapshot for a given VM ID and information provided
vim-cmd vmsvc/snapshot.create [VmId] [snapshotName] 
[snapshotDescription] [includeMemory] [quiesced]

Edit cron file
vi /var/spool/cron/crontabs/root

Kill and Restart Cron
kill $(cat /var/run/crond.pid)
crond

Leave a Reply