ESX 5: Command Line VM Manipulation
I haven’t been working with ESX for a bit, but while I was I was mostly interacting with it via the command line. Here is a list I had compiled while I was going through that exercise, and since I while be starting a job next week where I will no longer be interacting with much ESX I will just publish this one as-is. It is by no means complete and frankly it is not even that helpful. Notice that the commands which reference a specific virtual machine have a number, this is the VM ID for the VM you’d like to interact with.
This is specifically to interact with VMs on ESX 5. There is also esxcli which will allow you to make hypervisor level changes such as configuring a vSwitch, the esxcli is similar to a switch in how it behaves but it is beyond the scope of this article.
List All VMs on the Host
# vim-cmd vmsvc/getallvms
Get Information for a Specific VM
# vim-cmd vmsvc/get.guest 30
Get Configuration for a Specific VM
# vim-cmd vmsvc/get.config 30
Get Summary for a Specific VM
# vim-cmd vmsvc/get.summary 30
Get Current Power State of a Specific VM
# vim-cmd vmsvc/power.getstate 30
Power On a Specific VM
# vim-cmd vmsvc/power.on 30
Power Off a Specific VM (Hard)
# vim-cmd vmsvc/power.off 30
Shutdown a Specific VM
# vim-cmd vmsvc/power.shutdown 30
Reboot a Specific VM
# vim-cmd vmsvc/power.reset 30
List a Specific VM’s Snapshots
# vim-cmd vmsvc/get.snapshot 30
Unregister a VM from a ESX Host
# vim-cmd vmsvc/unregister 30
Register a VM on a ESX Host
# vim-cmd solo/registervm path/to/.vmx

Nice! Exactly the commands i was looking for! I linked back to you from my blog.