vSphere PowerCLI Reference

Set-VMStartPolicy

Synopsis

Modifies the virtual machine start policy.

Syntax

Set-VMStartPolicy [-StartPolicy] <VMStartPolicy[]> [-StartAction <VmStartAction>] [-StartOrder <Int32>] [-InheritStopActionFromHost] [-InheritStopDelayFromHost] [-InheritWaitForHeartbeatFromHost] [-InheritStartDelayFromHost] [-UnspecifiedStartOrder] [-StartDelay <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [-WaitForHeartBeat [<Boolean>]] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMStartPolicy

Detailed Description

Modifies the virtual machine start policy. Start policy defines what happen to virtual machines when the server starts up or stops.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
StartPolicyVMStartPolicy[]Specifies the virtual machine start policy you want to modify.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
InheritStartDelayFromHostSwitchParameterIndicate that the virtual machine uses the value of the StartDelay parameter of the host.falsefalse
InheritStopActionFromHostSwitchParameterIndicate that the virtual machine uses the value of the StopAction parameter of the host.falsefalse
InheritStopDelayFromHostSwitchParameterIndicate that the virtual machine uses the value of the StopDelay parameter of the host.falsefalse
InheritWaitForHeartbeatFromHostSwitchParameterIndicate that the virtual machine uses the value of the WaitforHeartbeat parameter of the host.falsefalse
StartActionVmStartActionSpecify a start action for virtual machines. It can be None or PowerOn.falsefalse
StartDelayInt32Specify a default start delay in seconds.falsefalse
StartOrderInt32Specify a number to define the virtual machines start order.falsefalse
StopActionVmStopActionSpecify the default action of the virtual machine when the server stops. The valid values are None, Suspend, PowerOff, and GuestShutDown.falsefalse
StopDelayInt32Specify the default stop delay in seconds.falsefalse
UnspecifiedStartOrderSwitchParameterIndicate that no order is defined for starting the virtual machines.falsefalse
WaitForHeartBeatBooleanIndicate whether the virtual machine should start after receiving a heartbeat, ignore heartbeats and start after the startDelay has elapsed ($true), or follow the system default before powering on ($false). When a virtual machine is next in the start order, the system either waits a specified period of time for a virtual machine to power on or it waits until it receives a successful heartbeat from a powered on virtual machine.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

VMStartPolicy

Notes

Examples

-------------- Example 1 --------------

$vmstartpolicy = Get-VMStartPolicy -VM VM  Set-VMStartPolicy -StartPolicy $vmstartpolicy -StartAction PowerOn

Retrieves the start policy of the VM virtual machine and defines that when the server starts, the virtual machine is powered on.

-------------- Example 2 --------------

Get-VM VM | Get-VMStartPolicy | Set-VMStartpolicy -InheritStopActionFromHost -InheritStopDelayFromHost

Reconfigures the start policy of the VM virtual machine to inherit the values of the StopAction and StopDelay from the host.

-------------- Example 3 --------------

Get-VM VM | Get-VMStartPolicy | Set-VMStartpolicy -StartAction PowerOn -StartOrder 2 -StartDelay 300 -StopAction GuestShutDown -StopDelay 300

Retrieve the start policy of the specified virtual machine and modify its configuration settings.


Copyright © 1998 - 2011 VMware, Inc. All rights reserved.