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.

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.

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

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 user-defined 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 takes effect only when SpotStrategy is set to SpotWithPriceLimit.

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.
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.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.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.HostNameSuffix String No 000

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

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 user-defined 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.HostNamePrefix String No compute

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

Valid values of N: 1 to 8

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.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.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.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.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.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.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 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Valid values of N: 1 to 8

Default value: PL1

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 takes effect only when Queues.N.SpotStrategy is set to SpotWithPriceLimit.

Valid values of N: 1 to 8

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

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

N queue names can be set at 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.InstanceTypes.N.ZoneId String No cn-hangzhou-b

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

N queue names can be set at 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.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 takes effect only when Queues.N.InstanceTypes.N.SpotStrategy is set to Queues.N.InstanceTypes.N.SpotStrategy.

N queue names can be set at 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.InstanceType String No ecs.n1.tiny

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

N queue names 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 user-defined 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

N queue names can be set at 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.DataDisks.N.DataDiskSize Integer No 40

The size of the data disk. Unit: GB.

Valid values: 40 to 500

Default value: 40

Valid values of N: 0 to 16

Queues.N.DataDisks.N.DataDiskCategory String No cloud_efficiency

The type of the data disk. Valid values:

  • cloud_efficiency: ultra disk
  • cloud_ssd: SSD
  • cloud_essd: ESSD
  • cloud: basic disk

Default value: cloud_efficiency

Valid values of N: 0 to 16

Queues.N.DataDisks.N.DataDiskDeleteWithInstance Boolean No true

Specifies whether the data disk is released when the node is released. Valid values:

  • true
  • false

Default value: true

Valid values of N: 0 to 16

Queues.N.DataDisks.N.DataDiskPerformanceLevel String No PL1

The performance level of the ESSD used as the data disk. The parameter takes effect only when the Queues.N.DataDisks.N.DataDiskCategory parameter is set to cloud_essd. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL1

Valid values of N: 0 to 16

Queues.N.DataDisks.N.DataDiskEncrypted Boolean No false

Specifies whether to encrypt the data disk. Valid values:

  • true
  • false

Default value: false

Valid values of N: 0 to 16

Queues.N.DataDisks.N.DataDiskKMSKeyId String No 0e478b7a-4262-4802-b8cb-00d3fb40826X

The KMS key ID of the data disk.

Valid values of N: 0 to 16

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****
&EnableAutoGrow=false
&EnableAutoShrink=false
&GrowIntervalInMinutes=2
&ShrinkIntervalInMinutes=2
&ShrinkIdleTimes=3
&GrowTimeoutInMinutes=20
&ExtraNodesGrowRatio=0
&GrowRatio=50
&MaxNodesInCluster=100
&ExcludeNodes=i-bp19lgqwxb4206t5****,i-bp1g4hvzs9pywrhb****
&SpotStrategy=SpotWithPriceLimit
&SpotPriceLimit=0.062
&ImageId=centos_7_03_64_20G_alibase_201708****
&Queues=[{"QueueImageId":"centos_7_03_64_20G_alibase_201708****","SystemDiskCategory":"cloud_efficiency","InstanceType":"ecs.n1.medium","HostNameSuffix":"000","SpotStrategy":"NoSpot","HostNamePrefix":"compute","MinNodesInQueue":0,"SystemDiskSize":40,"MaxNodesInQueue":30,"EnableAutoShrink":false,"QueueName":"cluster1","EnableAutoGrow":false,"SystemDiskLevel":"PL1","SpotPriceLimit":0.662,"InstanceTypes":[{"VSwitchId":"vsw-bp1lfcjbfb099rrjn****","ZoneId":"cn-hangzhou-b","SpotPriceLimit":0.66,"InstanceType":"ecs.n1.tiny","SpotStrategy":"SpotWithPriceLimit"}],"DataDisks":[{"DataDiskSize":40,"DataDiskCategory":"cloud_efficiency","DataDiskDeleteWithInstance":true,"DataDiskPerformanceLevel":"PL1","DataDiskEncrypted":false,"DataDiskKMSKeyId":"0e478b7a-4262-4802-b8cb-00d3fb40826X"}]}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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.
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. Try again later. If the error persists, submit a ticket.
403 TooManyComputes The number of computing nodes exceeds the quota. The error message returned because the number of compute nodes has exceeded the compute node quota.
404 ClusterNotFound The specified cluster does not exist. The error message returned because the specified cluster does not exist.
404 ImageNotFound The specified image does not exist. The error message returned because the specified image does not exist.
406 DbError A database service error occurred. The error message returned because the database request has failed.
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.
500 UnknownError An unknown error occurred. The error message returned because an unknown error has occurred. Try again later. If the error persists, submit a ticket.
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.