powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-VMStartPolicy



NAME
Set-VMStartPolicy

SYNOPSIS
Modifies the virtual machine start policy.

SYNTAX
Set-VMStartPolicy [-StartPolicy] [-StartAction ] [-StartOrder ] [-InheritSt
opActionFromHost] [-InheritStopDelayFromHost] [-InheritWaitForHeartbeatFromHost] [-InheritStartDelayFromHost] [-Uns
pecifiedStartOrder] [-StartDelay ] [-StopAction ] [-StopDelay ] [-WaitForHeartBeat [ olean>]] [-WhatIf] [-Confirm] []


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


PARAMETERS
-StartPolicy
Specifies the virtual machine start policy you want to modify.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-StartAction
Specify a start action for virtual machines. It can be None or PowerOn.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-StartOrder
Specify a number to define the virtual machines start order.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-InheritStopActionFromHost
Indicate that the virtual machine uses the value of the StopAction parameter of the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-InheritStopDelayFromHost
Indicate that the virtual machine uses the value of the StopDelay parameter of the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-InheritWaitForHeartbeatFromHost
Indicate that the virtual machine uses the value of the WaitforHeartbeat parameter of the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-InheritStartDelayFromHost
Indicate that the virtual machine uses the value of the StartDelay parameter of the host.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-UnspecifiedStartOrder
Indicate that no order is defined for starting the virtual machines.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-StartDelay
Specify a default start delay in seconds.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-StopAction
Specify the default action of the virtual machine when the server stops. The valid values are None, Suspend, Po
werOff, and GuestShutDown.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-StopDelay
Specify the default stop delay in seconds.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WaitForHeartBeat []
Indicate whether the virtual machine should start after receiving a heartbeat, ignore heartbeats and start afte
r 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
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
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


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VMStartPolicy


NOTES




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

C:\PS>$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 i
s powered on.





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

C:\PS>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 --------------

C:\PS>Get-VM VM | Get-VMStartPolicy | Set-VMStartpolicy -StartAction PowerOn -StartOrder 2 -StartDelay 300 -StopAct
ion GuestShutDown -StopDelay 300


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






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-VMStartPolicy.html
Get-VMStartPolicy