Class RollingUpgradePolicy

java.lang.Object
com.azure.resourcemanager.compute.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
    Constructor
    Description
    Creates an instance of RollingUpgradePolicy class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.
    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 maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines.
    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 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.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade)
    Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches.
    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.
    Set the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines.
    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.
    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.
    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.
    withPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances)
    Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.
    withRollbackFailedInstancesOnPolicyBreach(Boolean rollbackFailedInstancesOnPolicyBreach)
    Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the Rolling Upgrade policy is violated.

    Methods inherited from class 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

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

      public Boolean prioritizeUnhealthyInstances()
      Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy instances.
      Returns:
      the prioritizeUnhealthyInstances value.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • 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.