Vmsvc/power.getstate: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
(New page: ==== vimsh vmsvc/power.getstate ==== Usage: power.getstate vmid Retrieves the power state of the specified virtual machine. ====Example output==== For a machine that is powered on: [/]$...)
 
No edit summary
Line 3: Line 3:


Retrieves the power state of the specified virtual machine.
Retrieves the power state of the specified virtual machine.
You can use [[vmsvc/getallvms]] to retrieve the vmid


====Example output====
====Example output====

Revision as of 19:48, 18 December 2008

vimsh vmsvc/power.getstate

Usage: power.getstate vmid

Retrieves the power state of the specified virtual machine.

You can use vmsvc/getallvms to retrieve the vmid

Example output

For a machine that is powered on:

[/]$ vmsvc/power.getstate 4400
Retrieved runtime info
Powered on

For a non existing machine:

[/]$ vmsvc/power.getstate 123
(vim.fault.NotFound) {
   dynamicType = <unset>,
   msg = "Unable to find a VM corresponding to "123""
}

For a suspended machine:

[/]$ vmsvc/power.getstate 4414
Retrieved runtime info 
Suspended

and powered off:

[/]$ vmsvc/power.getstate 4400
Retrieved runtime info
Powered off