The dpmhv-getVMState command retrieves the power state of the VM.
This command has the following format:
dpmhv-getVMState -vm vmname|-vmid vmguid -host hostname [-retval] [-silent]
Specifies the name of the VM.
Specifies the unique ID of the VM.
Specifies the name of the Hyper-V server host.
Specifies not to direct the output to the screen.
Returns a value for further processing.
The dpmhv-getVMState command returns a string indicating the power state of the VM. The values returned are:
Example: Show the VM State
This example checks whether the VM is running.
s = dpmhv-getVMState -host hvserver -vm TestVM -retval -silent if(s=="enabled") ? "VM is running" else ? "VM is not running"
Copyright © 2013 CA. All rights reserved. |
|