Restart VMware VM

This Automation Manager object will restart a VM. Depending on how the object is used, it can either do a forceful reboot without shutting down the guest Operating System first, or it can try to shutdown the guest OS first and if it can’t, shut it down and start again forcefully, or it can only attempt a graceful reboot, and not reboot if that fails.

Install VMware.PowerCLI

Before using this VMware Automation Manager Object, you must install the PowerShell module VMware.PowerCLI.

This VMware Automation Object runs on 64-bit PowerShell, and the module must also be added to 64-bit PowerShell.

Requires PowerShell 5.0

Before using this VMware Automation Manager Object, you must install PowerShell 5.0.

Input Parameters

Name Type Required Description
Session ID String Yes This is the session ID that is generated by the VMware connection object.
This is required for this object to work.
Virtual Machine Name String Yes This is the name of the virtual machine that you want to restart.
The field supports wildcards, so to restart all virtual machines, use "*" as the value.
Perform a Graceful or Forceful Restart String Yes This parameter will dictate how the restart is attempted:
  • Always Force: This will do a forceful restart only, regardless of the guest OS. This is equivalent to doing a hard reset of the guest.
  • Restart Gracefully if available, force if needed: This will attempt a graceful restart first. If the VMware tools are not running properly on the guest, a forceful restart will be done to force the reboot.
  • Only Restart Gracefully: This will look to see if the VMware tools on the guest are running properly. If they are not, the system will not be restarted. If they are running, a graceful restart will be attempted.

Output Parameters

Name Type Description
Current Power State String This output parameter will output the state of the virtual machine as the object was being requested to perform the action.
Reboot Action Performed String This output parameter will output the action performed by the object.
Result Number Returns a success value of zero or any value other than zero to indicate failure.
Result String String Object execution error details.

Example Input Parameters

Name Type Required Example
Session ID String Yes ab4c55c1273cb609678a2bb6a15104e927ac8dec

10.199.2.23
Virtual Machine Name String Yes SRVExchange
SRV*
*
Perform a Graceful or Forceful Restart String Yes Always Force