Previous Topic: dpmhv-addVMSCSIController (Cmdlet) Command--Add SCSI Controllers to a VMNext Topic: dpmhv-createTemplateFromVM (Funclet) Command--Create a Template from a VM


dpmhv-changeVMState (Cmdlet) Command--Change the State of a VM

The dpmhv-changeVMState command changes the state of the VM. The various states are: start, suspend, stop, pause, shutdown, and reboot.

This command has the following format:

dpmhv-changeVMState 
-host hostname 
-vm vmname|-vmid vmguid 
-state {start,suspend,stop,pause,shutdown,reboot} 
[-retval] 
[-silent]
-host hostname

Specifies the name of the Hyper-V server host.

-vm vmname

Specifies the name of the VM.

-vmid vmguid

Specifies the unique ID of the VM.

-state {start,suspend,stop,pause,shutdown,reboot}

Specifies the state of the VM. State options are the following:

start

Starts or resumes the VM.

suspend

Suspends the VM temporarily.

stop

Stops the VM.

pauses

Stops the VM temporarily.

shutdown

Shuts down the VM.

reboot

Restarts the VM.

Note:

If you specify an invalid state change, the system reports an exception.

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

Example: Change the state of a VM

This example starts the VM, "TestVM."

dpmhv-changeVMState -host hvserver -vm TestVM -state start