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 Details

    • RollingUpgradePolicy

      public RollingUpgradePolicy()
      Creates an instance of RollingUpgradePolicy class.
  • Method Details

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

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

      public Boolean isPrioritizeUnhealthyInstances()
      Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.
      Returns:
      the prioritizeUnhealthyInstances value.
    • 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.
    • 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.
    • 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 com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.