Syntax
Set-VMHostStartPolicy [-VMHostStartPolicy] <VMHostStartPolicy[]> [-Enabled <Boolean>] [-StartDelay <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [-WaitForHeartBeat <Boolean>] [-Confirm] [-WhatIf] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet modifies the host default start policy. Start policy defines what happens to virtual machines when the server starts up or stops.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
VMHostStartPolicy | VMHostStartPolicy[] | Specifies the host start policy you want to modify. | true | True (ByValue) | |
Confirm | SwitchParameter | If 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. | false | False | |
Enabled | Boolean | Indicates that the service that controls the host start policies is enabled. If it is enabled, the default start policies and the start policies of the specified hosts are applied. If disabled, no start policy is applied. | false | False | |
StartDelay | Int32 | Specifies a default start delay of the virtual machines in seconds. | false | False | |
StopAction | VmStopAction | Specifies the default action that is applied to the virtual machines when the server stops. The valid values are None, Suspend, PowerOff, or GuestShutDown. | false | False | |
StopDelay | Int32 | Specifies a default stop delay of the virtual machines in seconds. | false | False | |
WaitForHeartBeat | Boolean | Specifies whether the virtual machines should start after receiving a heartbeat from the host, 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 host to power on or it waits until it receives a successful heartbeat from a powered-on host. | false | False | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | False |
Return Type
Zero or more modified VMHostStartPolicy objectsNotes
Examples
-------------------------- Example 1 --------------------------
Get-VMHost Host | Get-VMHostStartPolicy | Set-VMHostStartPolicy -Enabled:$true -StartOrder 2 -StartDelay 300 -StopAction GuestShutDown -StopDelay 300
Retrieves the start policy of the Host host and modifies its configuration settings.
-------------------------- Example 2 --------------------------
Get-VMHost Host | Get-VMHostStartPolicy | Set-VMHostStartPolicy -WaitForHeartbeat
Retrieves the start policy of the Host host and modifies its configuration settings, so that virtual machines on the specified host wait for the host heartbeat.