Package com.azure.compute.batch.models
Class RollingUpgradePolicy
java.lang.Object
com.azure.compute.batch.models.RollingUpgradePolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<RollingUpgradePolicy>
public final class RollingUpgradePolicy
extends Object
implements com.azure.json.JsonSerializable<RollingUpgradePolicy>
The configuration parameters used while performing a rolling upgrade.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RollingUpgradePolicy
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of RollingUpgradePolicy from the JsonReader.Get the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch.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.Get the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state.Get the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in one batch and starting the next batch.Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.setEnableCrossZoneUpgrade
(Boolean enableCrossZoneUpgrade) Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.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.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.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.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.setPrioritizeUnhealthyInstances
(Boolean prioritizeUnhealthyInstances) Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.setRollbackFailedInstancesOnPolicyBreach
(Boolean rollbackFailedInstancesOnPolicyBreach) Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
RollingUpgradePolicy
public RollingUpgradePolicy()Creates an instance of RollingUpgradePolicy class.
-
-
Method Details
-
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.
-
setEnableCrossZoneUpgrade
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.
-
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.
-
setMaxBatchInstancePercent
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.
-
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.
-
setMaxUnhealthyInstancePercent
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.
-
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.
-
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.
-
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.
-
setPauseTimeBetweenBatches
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.
-
isPrioritizeUnhealthyInstances
Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.- Returns:
- the prioritizeUnhealthyInstances value.
-
setPrioritizeUnhealthyInstances
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.
-
isRollbackFailedInstancesOnPolicyBreach
Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.- Returns:
- the rollbackFailedInstancesOnPolicyBreach value.
-
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<RollingUpgradePolicy>
- Throws:
IOException
-
fromJson
public static RollingUpgradePolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException 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.
-