ALIYUN::EHPC::AutoScaleConfig is used to configure the auto scaling settings of a cluster.

Syntax

{
  "Type": "ALIYUN::EHPC::AutoScaleConfig",
  "Properties": {
    "ExtraNodesGrowRatio": Integer,
    "EnableAutoGrow": Boolean,
    "ClusterId": String,
    "ShrinkIdleTimes": Integer,
    "MaxNodesInCluster": Integer,
    "EnableAutoShrink": Boolean,
    "GrowRatio": Integer,
    "GrowIntervalInMinutes": Integer,
    "GrowTimeoutInMinutes": Integer,
    "ImageId": String,
    "ShrinkIntervalInMinutes": Integer,
    "SpotPriceLimit": Number,
    "Queues": List,
    "ExcludeNodes": String,
    "SpotStrategy": String
  }
}

Properties

Property Type Required Editable Description Constraint
ExtraNodesGrowRatio Integer No Yes The percentage of extra compute nodes. If you need to add 100 compute nodes to run a job and you set the ExtraNodesGrowRatio property to 2, the system adds 102 compute nodes.

Valid values: 0 to 100.

Default value: 0.

EnableAutoGrow Boolean No Yes Specifies whether to enable auto scale-out. Default value: false. Valid values:
  • true
  • false
ClusterId String Yes No The ID of the cluster. None.
ShrinkIdleTimes Integer No Yes The number of consecutive times that a compute node is idle during the resource scale-in check. An idle duration is a period of time when no job runs in the cluster.

Valid values: 2 to 5.

Default value: 3.

If you set this property to 3, a compute node is released when the node is idle for more than three consecutive times. The continuous idle duration is the scale-in time interval multiplied by the number of consecutive idle times. By default, the scale-in time interval that is specified by the ShrinkIntervalInMinutes property is two minutes. If a compute node is idle for more than 6 minutes, the node is released by default.
MaxNodesInCluster Integer No Yes The maximum number of compute nodes that can be added to the cluster. Valid values: 0 to 500.

Default value: 100.

EnableAutoShrink Boolean No Yes Specifies whether to enable auto scale-in. Default value: false. Valid values:
  • true
  • false
GrowRatio Integer No Yes The percentage of each round of a scale-out task. If you need to add 10 compute nodes to run a job and you set the GrowRatio property to 50, the scale-out task has two rounds. The system adds five compute nodes in each round.

Valid values: 1 to 100.

Default value: 100.

GrowIntervalInMinutes Integer No Yes The interval between two consecutive rounds of a scale-out task for compute nodes. Unit: minutes.

Valid values: 2 to 10.

Default value: 2.

Note An interval may exist among multiple rounds of a scale-out task or between two consecutive scale-out tasks.
GrowTimeoutInMinutes Integer No Yes The timeout period of the scale-out task. Unit: minutes.

Valid values: 10 to 60.

Default value: 20.

If the compute nodes that are added to the cluster do not enter the Running state when the scale-out timeout period ends, the system releases the nodes.
ImageId String No Yes The ID of the image.
Note
  • If you specify both the QueueImageId and ImageId properties, the QueueImageId property is used by default.
  • If you specify only one of the QueueImageId and ImageId properties, the specified property is used.
  • If you leave both the QueueImageId and ImageId.properties empty, the image that was used the last time you scaled out the cluster is used by default. If no scale-out task has been performed, the image that you specified when you created the cluster is used by default.
ShrinkIntervalInMinutes Integer No Yes The interval between two consecutive rounds of a scale-in task. Unit: minutes.

Valid values: 2 to 10.

Default value: 2.

SpotPriceLimit Number No Yes The maximum hourly price of the compute node. The value of this property can contain up to three decimal places.

This property takes effect when the SpotStrategy property is set to SpotWithPriceLimit.

Queues List No Yes The configurations of the queues in which you want to perform scale-out tasks. For more information, see Queues properties.
ExcludeNodes String No Yes The compute nodes that are excluded from auto scaling tasks. Separate multiple compute nodes with commas (,).
Note If you want to retain a compute node, you can specify the node as an additional node to retain the node when it is idle.
SpotStrategy String No Yes The preemption policy of the compute node. Default value: NoSpot. Valid values:
  • NoSpot: The compute node is a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The compute node is a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The compute node is a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.

Queues syntax

"Queues": [
  {
    "HostNameSuffix": String,
    "MinNodesInQueue": Integer,
    "MaxNodesInQueue": Integer,
    "EnableAutoGrow": Boolean,
    "DataDisks": List,
    "SystemDiskSize": Integer,
    "SystemDiskLevel": String,
    "QueueImageId": String,
    "MinNodesPerCycle": Integer,
    "MaxNodesPerCycle": Integer,
    "EnableAutoShrink": Boolean,
    "SystemDiskCategory": String,
    "HostNamePrefix": String,
    "SpotPriceLimit": Number,
    "InstanceTypes": List,
    "InstanceType": String,
    "QueueName": String,
    "SpotStrategy": String
  }
]

Queues properties

Property Type Required Editable Description Constraint
HostNameSuffix String No Yes The hostname suffix of the host that is used to run scale-out tasks in the queues. None.
MinNodesInQueue Integer No Yes The minimum number of compute nodes that can be removed from the queues. Valid values: 0 to 50.

Default value: 0.

MaxNodesInQueue Integer No Yes The maximum number of compute nodes that can be added in the queues. Valid values: 0 to 500.

Default value: 100.

EnableAutoGrow Boolean No Yes Specifies whether to enable auto scale-out for the queues. Default value: false. Valid values:
  • true
  • false
DataDisks List No Yes The configurations of the data disks. For more information, see DataDisks properties.
SystemDiskSize Integer No Yes The size of the system disk for the compute nodes that are added in the queues. Unit: GB.

Valid values: 40 to 500.

Default value: 40.

SystemDiskLevel String No Yes The performance level (PL) of the enhanced SSD (ESSD) that is used as the system disk for the compute nodes that are added in the queues. Default value: PL1. Valid values:
  • PL0: An ESSD delivers up to 10,000 random read/write IOPS.
  • PL1: An ESSD delivers up to 50,000 random read/write IOPS.
  • PL2: An ESSD delivers up to 100,000 random read/write IOPS.
  • PL3: An ESSD delivers up to 1,000,000 random read/write IOPS.
QueueImageId String No Yes The ID of the image that you want to use in the queues.
Note
  • If you specify both the QueueImageId and ImageId properties, the QueueImageId property is used by default.
  • If you specify only one of the QueueImageId and ImageId properties, the specified property is used.
  • If you leave both the QueueImageId and ImageId.properties empty, the image that was used the last time you scaled out the cluster is used by default. If no scale-out task has been performed, the image that you specified when you created the cluster is used by default.
MinNodesPerCycle Integer No Yes The minimum number of compute nodes that can be added in each round of an auto scale-out task. Valid values: 1 to 99.

Default value: 1.

If the number of compute nodes that you want to add in a round is less than the value of this property, the system automatically changes the value of this property to the number of compute nodes that you want to add in a round. This helps ensure that compute nodes can be added as expected.
Note The changed value takes effect only for the minimum number of compute nodes that can be added in the current round.
MaxNodesPerCycle Integer No Yes The maximum number of compute nodes that can be added in each round of an auto scale-out task. Valid values: 0 to 99.

Default value: 0.

EnableAutoShrink Boolean No Yes Specifies whether to enable auto scale-in for the queues. Default value: false. Valid values:
  • true
  • false
SystemDiskCategory String No Yes The category of the system disk for the compute nodes that are added in the queues. Default value: cloud_efficiency. Valid values:
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: ESSD.
  • cloud: basic disk. Disks of this type are retired.
HostNamePrefix String No Yes The hostname prefix of the host that is used to run a scale-out task in the queues. None.
SpotPriceLimit Number No Yes The maximum hourly price for the compute node that is automatically added in the queues. The value of this property can contain up to three decimal places.

This property takes effect when the SpotStrategy property is set to SpotWithPriceLimit.

InstanceTypes List No Yes The configurations of the compute nodes that are automatically added in the queues. For more information, see InstanceTypes properties.
InstanceType String No Yes The instance type of the compute nodes that are automatically added in the queues. None.
QueueName String No Yes The name of the queue. You can specify multiple queue names at the same time.
SpotStrategy String No Yes The preemption policy of the compute node that is automatically added in the queues. Default value: NoSpot. Valid values:
  • NoSpot: The compute node is a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The compute node is a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The compute node is a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.

DataDisks syntax

"DataDisks": [
  {
    "DataDiskKMSKeyId": String,
    "DataDiskPerformanceLevel": String,
    "DataDiskEncrypted": Boolean,
    "DataDiskDeleteWithInstance": Boolean,
    "DataDiskSize": Integer,
    "DataDiskCategory": String
  }
]

DataDisks properties

Property Type Required Editable Description Constraint
DataDiskKMSKeyId String No Yes The Key Management Service (KMS) key ID of the data disk. None.
DataDiskPerformanceLevel String No Yes The PL of the ESSD that is used as the data disk. This property takes effect when the DataDiskCategory property is set to cloud_essd.

Default value: PL1. Valid values:

  • PL0: An ESSD delivers up to 10,000 random read/write IOPS.
  • PL1: An ESSD delivers up to 50,000 random read/write IOPS.
  • PL2: An ESSD delivers up to 100,000 random read/write IOPS.
  • PL3: An ESSD delivers up to 1,000,000 random read/write IOPS.
DataDiskEncrypted Boolean No Yes Specifies whether to encrypt the data disk. Default value: false. Valid values:
  • true
  • false
DataDiskDeleteWithInstance Boolean No Yes Specifies whether to release the data disk when the compute node is released. Default value: true. Valid values:
  • true
  • false
DataDiskSize Integer No Yes The size of the data disk. Unit: GB.

Valid values: 40 to 500.

Default value: 40.
DataDiskCategory String No Yes The category of the data disk. Default value: cloud_efficiency. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
  • cloud: basic disk

InstanceTypes syntax

"InstanceTypes": [
  {
    "ZoneId": String,
    "VSwitchId": String,
    "SpotPriceLimit": Number,
    "InstanceType": String,
    "SpotStrategy": String
  }
]

InstanceTypes properties

Property Type Required Editable Description Constraint
ZoneId String Yes No The zone ID of the compute nodes that are automatically added in the queues. You can specify N queue names at the same time and specify a zone ID for N compute nodes in the queues at the same time. The configurations take effect when the system performs auto scale-out in the queues.

Valid values of N: 0 to 500.

VSwitchId String Yes No The vSwitch ID of the compute nodes that are automatically added in the queues. You can specify N queue names at the same time and specify a vSwitch ID for N compute nodes in the queues at the same time. The configurations take effect when the system performs auto scale-out in the queues.

Valid values of N: 0 to 500.

SpotPriceLimit Number No Yes The maximum hourly price of the compute node that is automatically added in the queues. The value of this property can contain up to three decimal places.

This property takes effect when the SpotStrategy property is set to SpotWithPriceLimit.

You can specify N queue names at the same time and specify the maximum hourly price for N compute nodes in the queues at the same time. The configurations take effect when the system performs auto scale-out in the queues.

Valid values of N: 0 to 500.

InstanceType String Yes Yes The instance type of the compute nodes that are automatically added in the queues. You can specify N queue names at the same time and specify an instance type for N compute nodes in the queues at the same time. The configurations take effect when the system performs auto scale-out in the queues.

Valid values of N: 0 to 500.

SpotStrategy String No Yes The preemption policy for the compute node that is automatically added in the queues. Default value: NoSpot. Valid values:
  • NoSpot: The compute node is a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The compute node is a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The compute node is a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.

You can specify a preemption policy for N compute nodes in the queues at the same time. The configuration takes effect when the system performs auto scale-out in the queues.

Valid values of N: 0 to 500.

Return values

Fn::GetAtt

ClusterId: the ID of the cluster.

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ClusterId": {
          "Type": "String",
          "Description": "Cluster ID."
        },
        "Queues": {
          "Type": "Json",
          "Description": "",
          "MaxLength": 8
        }
      },
      "Resources": {
        "AutoScaleConfig": {
          "Type": "ALIYUN::EHPC::AutoScaleConfig",
          "Properties": {
            "ClusterId": {
              "Ref": "ClusterId"
            },
            "Queues": {
              "Ref": "Queues"
            }
          }
        }
      },
      "Outputs": {
        "ClusterId": {
          "Description": "Cluster Id.",
          "Value": {
            "Fn::GetAtt": [
              "AutoScaleConfig",
              "ClusterId"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ClusterId:
        Type: String
        Description: Cluster ID.
      Queues:
        Type: Json
        Description: ''
        MaxLength: 8
    Resources:
      AutoScaleConfig:
        Type: ALIYUN::EHPC::AutoScaleConfig
        Properties:
          ClusterId:
            Ref: ClusterId
          Queues:
            Ref: Queues
    Outputs:
      ClusterId:
        Description: Cluster Id.
        Value:
          Fn::GetAtt:
            - AutoScaleConfig
            - ClusterId