Set-VMHostStartPolicy

This cmdlet modifies the host default start policy. Start policy defines what happens to virtual machines when the server starts up or stops.

Syntax

-VMHostStartPolicy  <VMHostStartPolicy[]>
[-Enabled  <Boolean>]
[-StartDelay  <Int32>]
[-StopAction  <VmStopAction>]
[-StopDelay  <Int32>]
[-WaitForHeartBeat  <Boolean>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VMHostStartPolicy
VMHostStartPolicy[] named
  • pipeline
  • Specifies the host start policy you want to modify.
    optional
    Enabled
    Boolean named 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 deactivated, no start policy is applied.
    optional
    StartDelay
    Int32 named Specifies a default start delay of the virtual machines in seconds.
    optional
    StopAction
    VmStopAction named Specifies the default action that is applied to the virtual machines when the server stops. The valid values are None, Suspend, PowerOff, or GuestShutDown.
    optional
    StopDelay
    Int32 named Specifies a default stop delay of the virtual machines in seconds.
    optional
    WaitForHeartBeat
    Boolean named 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.

    Output

    VMware.VimAutomation.ViCore.Types.V1.Host.VMStartPolicy.VMHostStartPolicy

    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.

    Related Commands

    Feedback

    Was this page helpful?