다음을 통해 공유


RollingUpgradePolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.models.RollingUpgradePolicy

Implements

public final class RollingUpgradePolicy
implements JsonSerializable<RollingUpgradePolicy>

The configuration parameters used while performing a rolling upgrade.

Constructor Summary

Constructor Description
RollingUpgradePolicy()

Creates an instance of RollingUpgradePolicy class.

Method Summary

Modifier and Type Method and Description
Boolean enableCrossZoneUpgrade()

Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.

static RollingUpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of RollingUpgradePolicy from the JsonReader.

Integer maxBatchInstancePercent()

Get the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch.

Boolean maxSurge()

Get the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines.

Integer maxUnhealthyInstancePercent()

Get the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts.

Integer maxUnhealthyUpgradedInstancePercent()

Get the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state.

String pauseTimeBetweenBatches()

Get the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in one batch and starting the next batch.

Boolean prioritizeUnhealthyInstances()

Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.

Boolean rollbackFailedInstancesOnPolicyBreach()

Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

RollingUpgradePolicy withEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade)

Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.

RollingUpgradePolicy withMaxBatchInstancePercent(Integer maxBatchInstancePercent)

Set the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch.

RollingUpgradePolicy withMaxSurge(Boolean maxSurge)

Set the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines.

RollingUpgradePolicy withMaxUnhealthyInstancePercent(Integer maxUnhealthyInstancePercent)

Set the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts.

RollingUpgradePolicy withMaxUnhealthyUpgradedInstancePercent(Integer maxUnhealthyUpgradedInstancePercent)

Set the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state.

RollingUpgradePolicy withPauseTimeBetweenBatches(String pauseTimeBetweenBatches)

Set the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in one batch and starting the next batch.

RollingUpgradePolicy withPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances)

Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.

RollingUpgradePolicy withRollbackFailedInstancesOnPolicyBreach(Boolean rollbackFailedInstancesOnPolicyBreach)

Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.

Methods inherited from java.lang.Object

Constructor Details

RollingUpgradePolicy

public RollingUpgradePolicy()

Creates an instance of RollingUpgradePolicy class.

Method Details

enableCrossZoneUpgrade

public Boolean enableCrossZoneUpgrade()

Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size.

Returns:

the enableCrossZoneUpgrade value.

fromJson

public static RollingUpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of RollingUpgradePolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of RollingUpgradePolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the RollingUpgradePolicy.

maxBatchInstancePercent

public Integer maxBatchInstancePercent()

Get the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%.

Returns:

the maxBatchInstancePercent value.

maxSurge

public Boolean maxSurge()

Get the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch.

Returns:

the maxSurge value.

maxUnhealthyInstancePercent

public Integer maxUnhealthyInstancePercent()

Get the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%.

Returns:

the maxUnhealthyInstancePercent value.

maxUnhealthyUpgradedInstancePercent

public Integer maxUnhealthyUpgradedInstancePercent()

Get the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%.

Returns:

the maxUnhealthyUpgradedInstancePercent value.

pauseTimeBetweenBatches

public String pauseTimeBetweenBatches()

Get the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S).

Returns:

the pauseTimeBetweenBatches value.

prioritizeUnhealthyInstances

public Boolean prioritizeUnhealthyInstances()

Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.

Returns:

the prioritizeUnhealthyInstances value.

rollbackFailedInstancesOnPolicyBreach

public Boolean rollbackFailedInstancesOnPolicyBreach()

Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.

Returns:

the rollbackFailedInstancesOnPolicyBreach value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withEnableCrossZoneUpgrade

public RollingUpgradePolicy withEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade)

Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size.

Parameters:

enableCrossZoneUpgrade - the enableCrossZoneUpgrade value to set.

Returns:

the RollingUpgradePolicy object itself.

withMaxBatchInstancePercent

public RollingUpgradePolicy withMaxBatchInstancePercent(Integer maxBatchInstancePercent)

Set the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%.

Parameters:

maxBatchInstancePercent - the maxBatchInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

withMaxSurge

public RollingUpgradePolicy withMaxSurge(Boolean maxSurge)

Set the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch.

Parameters:

maxSurge - the maxSurge value to set.

Returns:

the RollingUpgradePolicy object itself.

withMaxUnhealthyInstancePercent

public RollingUpgradePolicy withMaxUnhealthyInstancePercent(Integer maxUnhealthyInstancePercent)

Set the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%.

Parameters:

maxUnhealthyInstancePercent - the maxUnhealthyInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

withMaxUnhealthyUpgradedInstancePercent

public RollingUpgradePolicy withMaxUnhealthyUpgradedInstancePercent(Integer maxUnhealthyUpgradedInstancePercent)

Set the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%.

Parameters:

maxUnhealthyUpgradedInstancePercent - the maxUnhealthyUpgradedInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

withPauseTimeBetweenBatches

public RollingUpgradePolicy withPauseTimeBetweenBatches(String pauseTimeBetweenBatches)

Set the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S).

Parameters:

pauseTimeBetweenBatches - the pauseTimeBetweenBatches value to set.

Returns:

the RollingUpgradePolicy object itself.

withPrioritizeUnhealthyInstances

public RollingUpgradePolicy withPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances)

Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.

Parameters:

prioritizeUnhealthyInstances - the prioritizeUnhealthyInstances value to set.

Returns:

the RollingUpgradePolicy object itself.

withRollbackFailedInstancesOnPolicyBreach

public RollingUpgradePolicy withRollbackFailedInstancesOnPolicyBreach(Boolean rollbackFailedInstancesOnPolicyBreach)

Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.

Parameters:

rollbackFailedInstancesOnPolicyBreach - the rollbackFailedInstancesOnPolicyBreach value to set.

Returns:

the RollingUpgradePolicy object itself.

Applies to