Share via


RollingUpgradePolicy Class

  • java.lang.Object
    • com.azure.compute.batch.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
static RollingUpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of RollingUpgradePolicy from the JsonReader.

Integer getMaxBatchInstancePercent()

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

Integer getMaxUnhealthyInstancePercent()

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 getMaxUnhealthyUpgradedInstancePercent()

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

Duration getPauseTimeBetweenBatches()

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

Boolean isEnableCrossZoneUpgrade()

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

Boolean isPrioritizeUnhealthyInstances()

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

Boolean isRollbackFailedInstancesOnPolicyBreach()

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

RollingUpgradePolicy setEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade)

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

RollingUpgradePolicy setMaxBatchInstancePercent(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 setMaxUnhealthyInstancePercent(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 setMaxUnhealthyUpgradedInstancePercent(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 setPauseTimeBetweenBatches(Duration 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 setPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances)

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

RollingUpgradePolicy setRollbackFailedInstancesOnPolicyBreach(Boolean rollbackFailedInstancesOnPolicyBreach)

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

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

RollingUpgradePolicy

public RollingUpgradePolicy()

Creates an instance of RollingUpgradePolicy class.

Method Details

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.

getMaxBatchInstancePercent

public Integer getMaxBatchInstancePercent()

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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent.

Returns:

the maxBatchInstancePercent value.

getMaxUnhealthyInstancePercent

public Integer getMaxUnhealthyInstancePercent()

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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent.

Returns:

the maxUnhealthyInstancePercent value.

getMaxUnhealthyUpgradedInstancePercent

public Integer getMaxUnhealthyUpgradedInstancePercent()

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 value of this field should be between 0 and 100, inclusive.

Returns:

the maxUnhealthyUpgradedInstancePercent value.

getPauseTimeBetweenBatches

public Duration getPauseTimeBetweenBatches()

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

Returns:

the pauseTimeBetweenBatches value.

isEnableCrossZoneUpgrade

public Boolean isEnableCrossZoneUpgrade()

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. This field is able to be set to true or false only when using NodePlacementConfiguration as Zonal.

Returns:

the enableCrossZoneUpgrade value.

isPrioritizeUnhealthyInstances

public Boolean isPrioritizeUnhealthyInstances()

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

Returns:

the prioritizeUnhealthyInstances value.

isRollbackFailedInstancesOnPolicyBreach

public Boolean isRollbackFailedInstancesOnPolicyBreach()

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

Returns:

the rollbackFailedInstancesOnPolicyBreach value.

setEnableCrossZoneUpgrade

public RollingUpgradePolicy setEnableCrossZoneUpgrade(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. This field is able to be set to true or false only when using NodePlacementConfiguration as Zonal.

Parameters:

enableCrossZoneUpgrade - the enableCrossZoneUpgrade value to set.

Returns:

the RollingUpgradePolicy object itself.

setMaxBatchInstancePercent

public RollingUpgradePolicy setMaxBatchInstancePercent(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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent.

Parameters:

maxBatchInstancePercent - the maxBatchInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

setMaxUnhealthyInstancePercent

public RollingUpgradePolicy setMaxUnhealthyInstancePercent(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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent.

Parameters:

maxUnhealthyInstancePercent - the maxUnhealthyInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

setMaxUnhealthyUpgradedInstancePercent

public RollingUpgradePolicy setMaxUnhealthyUpgradedInstancePercent(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 value of this field should be between 0 and 100, inclusive.

Parameters:

maxUnhealthyUpgradedInstancePercent - the maxUnhealthyUpgradedInstancePercent value to set.

Returns:

the RollingUpgradePolicy object itself.

setPauseTimeBetweenBatches

public RollingUpgradePolicy setPauseTimeBetweenBatches(Duration 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..

Parameters:

pauseTimeBetweenBatches - the pauseTimeBetweenBatches value to set.

Returns:

the RollingUpgradePolicy object itself.

setPrioritizeUnhealthyInstances

public RollingUpgradePolicy setPrioritizeUnhealthyInstances(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.

setRollbackFailedInstancesOnPolicyBreach

public RollingUpgradePolicy setRollbackFailedInstancesOnPolicyBreach(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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to