Configures the auto scaling settings of a cluster.

Description

If you specify different auto scaling settings in the Queue Configuration section and Global Configurations section on the Auto Scale page, the settings in the Queue Configuration section prevail.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetAutoScaleConfig

The operation that you want to perform. Set the value to SetAutoScaleConfig.

ClusterId String Yes ehpc-hz-FYUr32****

The ID of the cluster.

MaxNodesInCluster Integer Yes 100

The maximum number of compute nodes that can be added in the cluster. Valid values: 0 to 500.

Default value: 100

EnableAutoGrow Boolean No false

Specifies whether to enable auto scale-out. Valid values:

  • true: enables auto scale-out
  • false: disables auto scale-out

Default value: false

EnableAutoShrink Boolean No false

Specifies whether to enable auto scale-in. Valid values:

  • true: enables auto scale-in
  • false: disables auto scale-in

Default value: false

GrowIntervalInMinutes Integer No 2

The interval between two points in time when compute nodes are added. Unit: minutes.

Valid values: 2 to 10

Default value: 2

Note An interval may exist during a scale-out task or between two scale-out tasks.
ShrinkIntervalInMinutes Integer No 2

The interval between two points in time when compute nodes are removed. Unit: minutes.

Valid values: 2 to 10

Default value: 2

ShrinkIdleTimes Integer No 3

The number of consecutive idle times of a compute node during the resource scale-in check.

Valid values: 2 to 5

Default value: 3

If the parameter is set to 3, a compute node is idle for more than 3 consecutive times. In this case, the node will be released. If a compute node is idle for more than 6 minutes in a row, it is released by default. This is because the default value of the ShrinkIntervalInMinutes parameter is 2.

GrowTimeoutInMinutes Integer No 20

The scale-out timeout period. Unit: minutes.

Valid values: 10 to 60

Default value: 20

If the scale-out timeout period has been reached and the scale-out nodes still do not reach the Running state, the system resets them.

ExtraNodesGrowRatio Integer No 0

The percentage of extra compute nodes. Valid values: 0 to 100.

Default value: 0

If you need to add 100 compute nodes and the value of the ExtraNodesGrowRatio parameter is 2, 102 compute nodes are added.

GrowRatio Integer No 50

The percentage of each round of scale-out. Valid values: 1 to 100.

Default value: 100

If you set GrowRatio to 50, the scale-out has two rounds. Each round completes half of the scale-out.

ExcludeNodes String No i-bp19lgqwxb4206t5****,i-bp1g4hvzs9pywrhb****

The compute nodes that are excluded from the list of auto scaling nodes. Separate multiple compute nodes with commas (,).

If you want to retain a compute node, you can set the node as an exceptional node. Then, the node is not released if it is idle.

SpotStrategy String No SpotWithPriceLimit

The preemption policy of the compute nodes. Valid values:

  • NoSpot: The compute nodes are pay-as-you-go instances.
  • SpotWithPriceLimit: The compute nodes are preemptible instances that have a maximum hourly price.
  • SpotAsPriceGo: The compute nodes are preemptible instances for which the market price at the time of purchase is used as the bid price.

Default value: NoSpot

SpotPriceLimit Float No 0.062

The maximum hourly price of the compute nodes. The value can be accurate to three decimal places. The parameter only takes effect when SpotStrategy is set to SpotWithPriceLimit.

Queues.N.QueueName String No cluster1

The name of the queue. N queue names can be set at the same time. Valid values of N: 1 to 8.

Queues.N.InstanceTypes.N.InstanceType String No ecs.n1.tiny

The instance type of the compute nodes that are automatically added in the queue.

The instance types of the compute nodes that are automatically added in N queues can be set at the same time. Valid values of N: 1 to 8.

The instance types of N compute nodes in the queue can be set at the same time when auto scaling is performed in the queue. Valid values of N: 0 to 500.

Queues.N.InstanceTypes.N.SpotStrategy String No SpotWithPriceLimit

The bidding method of the compute nodes that are automatically added in the queue. Valid values:

  • NoSpot: The compute nodes are pay-as-you-go instances.
  • SpotWithPriceLimit: The compute nodes are preemptible instances that have a maximum hourly price.
  • SpotAsPriceGo: The compute nodes are preemptible instances for which the market price at the time of purchase is used as the bid price.

Default value: NoSpot

The bidding methods of the compute nodes that are automatically added in N queues can be set the same time. Valid values of N: 1 to 8.

The bidding methods of N compute nodes in the queue can be set at the same time when auto scaling is performed in the queue. Valid values of N: 0 to 500.

Queues.N.InstanceTypes.N.SpotPriceLimit Float No 0.660

The maximum hourly price of the compute nodes that are automatically added in the queue. The value can be accurate to three decimal places. The parameter only takes effect when Queues.N.InstanceTypes.N.SpotStrategy is set to Queues.N.InstanceTypes.N.SpotStrategy.

The maximum hourly prices of the compute nodes that are automatically added in N queues can be set the same time. Valid values of N: 1 to 8.

The maximum hourly prices of N compute nodes in the queue can be set at the same time when auto scaling is performed in the queue. Valid values of N: 0 to 500.

Queues.N.InstanceTypes.N.ZoneId String No cn-hangzhou-b

The zone ID of the compute nodes that are automatically added in the queue belongs.

The zone IDs of the compute nodes that are automatically added in N queues can be set the same time. Valid values of N: 1 to 8.

The zone IDs of N compute nodes in the queue can be set at the same time when auto scaling is performed in the queue. Valid values of N: 0 to 500.

Queues.N.InstanceTypes.N.VSwitchId String No vsw-bp1lfcjbfb099rrjn****

The vSwitch ID of the compute nodes that are automatically added in the queue.

The vSwitch IDs of the compute nodes that are automatically added in N queues can be set the same time. Valid values of N: 1 to 8.

The vSwitch IDs of N compute nodes in the queue can be set at the same time when auto scaling is performed in the queue. Valid values of N: 0 to 500.

Queues.N.InstanceType String No ecs.n1.medium

The instance type of the compute nodes that are automatically added in the queue. Valid values of N: 1 to 8.

Queues.N.SpotStrategy String No NoSpot

The bidding method of the compute nodes that are automatically added in the queue. Valid values of N: 1 to 8.

Valid values:

  • NoSpot: The compute nodes are pay-as-you-go instances.
  • SpotWithPriceLimit: The compute nodes are preemptible instances that have a maximum hourly price.
  • SpotAsPriceGo: The compute nodes are preemptible instances for which the market price at the time of purchase is used as the bid price.

Default value: NoSpot

Queues.N.SpotPriceLimit Float No 0.662

The maximum hourly price of the compute nodes that are automatically added in the queue. The value can be accurate to three decimal places. The parameter only takes effect when Queues.N.SpotStrategy is set to SpotWithPriceLimit.

Valid values of N: 1 to 8

Queues.N.EnableAutoGrow Boolean No false

Specifies whether the queue enables auto scale-out. Valid values:

  • true: enables auto scale-out
  • false: disables auto scale-out

Valid values of N: 1 to 8

Default value: false

Queues.N.EnableAutoShrink Boolean No false

Specifies whether the queue enables auto scale-in. Valid values:

  • true: enables auto scale-in
  • false: disables auto scale-in

Valid values of N: 1 to 8

Default value: false

Queues.N.MaxNodesInQueue Integer No 30

The maximum number of the compute nodes that can be added in the queue. Valid values: 0 to 500.

Valid values of N: 1 to 8

Default value: 100

Queues.N.MinNodesInQueue Integer No 0

The minimum number of the compute nodes that can be removed in the queue. Valid values: 0 to 50.

Valid values of N: 1 to 8

Default value: 0

Queues.N.QueueImageId String No centos_7_03_64_20G_alibase_201708****

The image ID of the queue where scale-out is performed. Valid values of N: 1 to 8.

Note
  • If you set both Queues.N.QueueImageId and ImageId, Queues.N.QueueImageId prevails.
  • If you set Queues.N.QueueImageId or ImageId, the parameter that you set takes effect.
  • If you leave both Queues.N.QueueImageId and ImageId empty, the image that was specified when you created the cluster or the last time when you scaled out the cluster is used by default.
Queues.N.HostNamePrefix String No compute

The hostname prefix of the host that is used to perform scale-out for the queue. You can manage host names that have a specified prefix.

Valid values of N: 1 to 8

Queues.N.HostNameSuffix String No 000

The hostname suffix of the host that is used to perform scale-out for the queue. You can manage host names that have a specified suffix.

Valid values of N: 1 to 8

Queues.N.SystemDiskSize Integer No 40

The size of the system disk specified for the compute nodes that are added in the queue. Unit: GB

Valid values: 40 to 500

Valid values of N: 1 to 8

Default value: 40

Queues.N.SystemDiskCategory String No cloud_efficiency

The type of the system disk specified for the compute nodes that are added in the queue. Valid values:

  • cloud_efficiency: ultra disk.
  • cloud_ssd: SSD.
  • cloud_essd: ESSD
  • cloud: basic disk. Disks of this type are retired.

Valid values of N: 1 to 8

Default value: cloud_efficiency

Queues.N.SystemDiskLevel String No PL1

The performance level of the system disk specified for the compute nodes that are added in the queue. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 input/output operations per second (IOPS) of random read/write.
  • PL1: A single ESSD can deliver up to 50,000 IOPS of random read/write.
  • PL2: A single ESSD can deliver up to 100,000 IOPS of random read/write.
  • PL3: A single ESSD can deliver up to 1,000,000 IOPS of random read/write.

Valid values of N: 1 to 8

Default value: PL1

ImageId String No centos_7_03_64_20G_alibase_201708****

The ID of the image.

Note
  • If you set both Queues.N.QueueImageId and ImageId, Queues.N.QueueImageId prevails.
  • If you set Queues.N.QueueImageId or ImageId, the parameter that you set takes effect.
  • If you leave both Queues.N.QueueImageId and ImageId empty, the image that was specified when you created the cluster or the last time when you scaled out the cluster is used by default.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-13358736C-A1D7-6C044FE7****

The ID of the request.

Examples

Sample requests

http(s)://ehpc.cn-hangzhou.aliyuncs.com/?Action=SetAutoScaleConfig
&ClusterId=ehpc-hz-FYUr32****
&MaxNodesInCluster=100
&<Common request parameters>

Sample success responses

XML format

<SetAutoScaleConfigResponse>
      <RequestId>04F0F334-13358736C-A1D7-6C044FE7****</RequestId>
</SetAutoScaleConfigResponse>

JSON format

{
    "RequestId":"04F0F334-13358736C-A1D7-6C044FE7****"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParams The specified parameter %s is invalid. The error message returned because the following parameter is invalid: %s.
407 NotAuthorized You are not authorized by RAM for this request. The error message returned because you are not authorized by RAM for this request.
404 ClusterNotFound The specified cluster does not exist. The error message returned because the specified cluster does not exist.
403 InvalidOpt The specified operation is invalid. Please try again later. If the problem still exists, submit a ticket. The error message returned because the operation is unknown. Please try again later. If the error persists, submit a ticket.
406 DbError A database service error occurred. The error message returned because the database request has failed.
500 UnknownError An unknown error occurred. The error message returned because an unknown error has occurred.
403 TooManyComputes The number of computing nodes exceeds the quota. The error message returned because the number of compute nodes has exceeded the node quota.
404 ImageNotFound The specified image does not exist. The error message returned because the specified image does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server The error message returned because the request has failed. The service is temporarily unavailable.

For a list of error codes, visit the API Error Center.