< Back
Set-VMStartPolicy
Post
NAME Set-VMStartPolicy
SYNOPSIS
This cmdlet modifies the virtual machine start policy.
SYNTAX
Set-VMStartPolicy [-StartPolicy] <VMStartPolicy[]> [-InheritStartDelayFromHost] [-InheritStopActionFromHost]
[-InheritStopDelayFromHost] [-InheritWaitForHeartbeatFromHost] [-StartAction <VmStartAction>] [-StartDelay
<Int32>] [-StartOrder <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [-UnspecifiedStartOrder]
[-WaitForHeartBeat <Boolean>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet modifies the virtual machine start policy. Start policy defines what happens to virtual machines when
the server starts up or stops.
PARAMETERS
-InheritStartDelayFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StartDelay parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritStopActionFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StopAction parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritStopDelayFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StopDelay parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritWaitForHeartbeatFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the WaitforHeartbeat parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-StartAction <VmStartAction>
Specifies a start action for virtual machines. It can be None or PowerOn.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartDelay <Int32>
Specifies a default start delay in seconds.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartOrder <Int32>
Specifies a number to define the virtual machines start order.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartPolicy <VMStartPolicy[]>
Specifies the virtual machine start policy you want to modify.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-StopAction <VmStopAction>
Specifies the default action of the virtual machine when the server stops. The valid values are None, Suspend,
PowerOff, and GuestShutDown.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StopDelay <Int32>
Specifies the default stop delay in seconds.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UnspecifiedStartOrder [<SwitchParameter>]
Indicates that no order is defined for starting the virtual machines.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WaitForHeartBeat <Boolean>
Indicates 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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-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.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more modified VMStartPolicy objects
NOTES
-------------------------- 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.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... olicy.html
Get-VMStartPolicy
SYNOPSIS
This cmdlet modifies the virtual machine start policy.
SYNTAX
Set-VMStartPolicy [-StartPolicy] <VMStartPolicy[]> [-InheritStartDelayFromHost] [-InheritStopActionFromHost]
[-InheritStopDelayFromHost] [-InheritWaitForHeartbeatFromHost] [-StartAction <VmStartAction>] [-StartDelay
<Int32>] [-StartOrder <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [-UnspecifiedStartOrder]
[-WaitForHeartBeat <Boolean>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet modifies the virtual machine start policy. Start policy defines what happens to virtual machines when
the server starts up or stops.
PARAMETERS
-InheritStartDelayFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StartDelay parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritStopActionFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StopAction parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritStopDelayFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the StopDelay parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-InheritWaitForHeartbeatFromHost [<SwitchParameter>]
Indicates that the virtual machine uses the value of the WaitforHeartbeat parameter of the host.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-StartAction <VmStartAction>
Specifies a start action for virtual machines. It can be None or PowerOn.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartDelay <Int32>
Specifies a default start delay in seconds.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartOrder <Int32>
Specifies a number to define the virtual machines start order.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StartPolicy <VMStartPolicy[]>
Specifies the virtual machine start policy you want to modify.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-StopAction <VmStopAction>
Specifies the default action of the virtual machine when the server stops. The valid values are None, Suspend,
PowerOff, and GuestShutDown.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-StopDelay <Int32>
Specifies the default stop delay in seconds.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UnspecifiedStartOrder [<SwitchParameter>]
Indicates that no order is defined for starting the virtual machines.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WaitForHeartBeat <Boolean>
Indicates 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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-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.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more modified VMStartPolicy objects
NOTES
-------------------------- 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.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... olicy.html
Get-VMStartPolicy