Adds one or more pay-as-you-go or preemptible compute nodes to a cluster.
Description
The ApplyNodes operation allows you to specify the number of compute nodes, the number of vCPUs, and the memory capacity when you add nodes to a cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ApplyNodes |
The operation that you want to perform. Set the value to ApplyNodes. |
ClusterId | String | Yes | ehpc-hz-FYUr32**** |
The ID of the cluster. You can call the ListClusters operation to query the cluster ID. |
ImageId | String | No | centos_7_06_64_20G_alibase_20190711.vhd |
The image ID of the compute nodes to be added. The parameter takes effect only when the TargetImageId parameter is not specified. You can call the ListImages and ListCustomImages operations to query the image ID. Note If you add multiple compute nodes, the TargetImageId parameter takes effect only on
the nodes for which the TargetImageId parameter is specified.
|
ComputeSpotStrategy | String | No | NoSpot |
The preemption policy of the compute nodes. Valid values:
Default value: NoSpot |
ComputeSpotPriceLimit | Float | No | 0.68 |
The maximum hourly price of the compute nodes. The value is a floating-point number that supports up to three decimal places. The parameter takes effect only when ComputeSpotStrategy is set to SpotWithPriceLimit. If ComputeSpotPriceLimit and InstanceTypeModel.N.MaxPrice are specified at the same time, compute nodes are created based on the smaller value of these parameters. |
SystemDiskType | String | No | cloud_ssd |
The type of the system disk. Valid values:
|
SystemDiskSize | Integer | No | 40 |
The size of the system disk. Unit: GB. Valid values: 40 to 500 Default value: 40 |
HostNamePrefix | String | No | compute |
The prefix of the hostname. You can specify the parameter to manage the compute nodes in an efficient manner. |
HostNameSuffix | String | No | 01 |
The suffix of the hostname. You can specify the parameter to manage the compute nodes in an efficient manner. |
AllocatePublicAddress | Boolean | No | false |
Specifies whether to allocate a public IP address to the compute nodes. Valid values:
Default value: false |
InternetChargeType | String | No | PayByTraffic |
The billing method of the elastic IP address (EIP). Valid values:
|
InternetMaxBandWidthIn | Integer | No | 10 |
The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:
|
InternetMaxBandWidthOut | Integer | No | 10 |
The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0 |
Cores | Integer | No | 2 |
The number of vCPUs. The parameter is required when the ResourceAmountType parameter is set to Cores. You can set Cores, vCPU, and Memory to query node specifications. For example, you can query the available compute nodes that have 2 vCPUs and 16 GB of memory by setting vCPU to 2 and Memory to 16. You can also query compute nodes by zone. Query results are sorted by price. |
Memory | Integer | No | 16 |
The memory capacity. The parameter is required when the ResourceAmountType parameter is set to Cores. Unit: GB. You can set Cores, vCPU, and Memory to query node specifications. For example, you can query the available compute nodes that have 2 vCPUs and 16 GB of memory by setting vCPU to 2 and Memory to 16. You can also query compute nodes by zone. Query results are sorted by price. |
InstanceFamilyLevel | String | No | EntryLevel |
The level of the instance family. The parameter takes effect only when Cores and Memory are specified. Valid values:
Default value: EnterpriseLevel |
TargetCapacity | Integer | Yes | 20 |
The number of the resource that you want to add. The specific number depends on the value of the ResourceAmountType parameter.
|
ResourceAmountType | String | No | Instances |
The type of the resource to be added. Valid values:
Default value: Instances |
PriorityStrategy | String | No | LowPriceResourcePlanning |
The application policy of the preemptible nodes. Valid values:
|
StrictSatisfiedTargetCapacity | Boolean | No | true |
Specifies whether to meet the requirements of the TargetCapacity parameter. Valid values:
Default value: true |
SystemDiskLevel | String | No | PL0 |
The performance level of the ESSD that is used as the system disk. Valid values:
Default value: PL0 For more information, see ESSDs. |
StrictResourceProvision | Boolean | No | false |
Specifies whether to strictly meet the requirements of the TargetCapacity parameter. The parameter takes effect only when StrictSatisfiedTargetCapacity is set to true. Valid values:
Default value: false |
Round | Integer | No | 1 |
The total number of batches to create nodes. Valid values: 1 to 10. Default value: 1 |
Interval | Integer | No | 60 |
The interval between two consecutive batches. Valid values: 60 to 600. Unit: seconds. Default value: 60 |
JobQueue | String | No | workq |
The queue to which the compute nodes are added. You can call the ListQueues operation to query the queue name. |
ZoneInfos.N.VSwitchId | String | Yes | vsw-bp1e47optm9g58zcu**** |
The ID of the vSwitch. |
ZoneInfos.N.ZoneId | String | Yes | cn-hangzhou-b |
The ID of the zone to which the cluster belongs. Note Each zone ID must be unique.
|
InstanceTypeModel.N.MaxPrice | Float | No | 0.034 |
The maximum hourly price that you can pay for the preemptible node. The value is a floating-point number that supports up to three decimal places. The parameter takes effect only when ComputeSpotStrategy is set to SpotWithPriceLimit. Valid values of N: 1 to 10 |
InstanceTypeModel.N.TargetImageId | String | No | win2016_1607_x64_dtc_zh-cn_40G_alibase_20210516.vhd |
The image ID of the compute node. You must select a Windows image. Valid values of N: 1 to 10 |
InstanceTypeModel.N.InstanceType | String | No | ecs.n1.tiny |
The instance type of the compute node. The default value is the instance type that was specified when you created the cluster or the last time when you added compute nodes. Valid values of N: 1 to 10 |
Tag.N.Key | String | No | TestKey |
The tag key of the compute node that you want to attach. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://. Valid values of N: 1 to 10 |
Tag.N.Value | String | No | TestValue |
The tag value of the compute node that you want to add. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot start with acs: or contain http:// or https://. Valid values of N: 1 to 10 |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B745C159-3155-4B94-95D0-4B73D4D2**** |
The ID of the task. |
SatisfiedAmount | Integer | 10 |
The number of the compute nodes that were created. |
TaskId | String | B745C159-3155-4B94-95D0-4B73D4D2**** |
The ID of the request. |
Detail | String | Resources Application is satisfied. Creating... |
The detailed result of the request. |
InstanceIds | Array of String | null |
The ID of the Elastic Compute Service (ECS) instance. Note AddNodes is an asynchronous API operation. If a request succeeds, a response is immediately
generated before ECS instances are created. Therefore, the value of the parameter
is null. You can call the ListNodes operation to query the ID of the ECS instance.
|
Examples
Sample requests
http(s)://ehpc.cn-hangzhou.aliyuncs.com/?Action=ApplyNodes
&ClusterId=ehpc-hz-FYUr32****
&TargetCapacity=20
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ApplyNodes>
<TaskId>B745C159-3155-4B94-95D0-4B73D4D2****</TaskId>
<SatisfiedAmount>10</SatisfiedAmount>
<RequestId>B745C159-3155-4B94-95D0-4B73D4D2****</RequestId>
<InstanceIds>
<InstanceId>null</InstanceId>
</InstanceIds>
<Detail>Resources Application is satisfied. Creating...</Detail>
</ApplyNodes>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TaskId" : "B745C159-3155-4B94-95D0-4B73D4D2****",
"SatisfiedAmount" : 10,
"RequestId" : "B745C159-3155-4B94-95D0-4B73D4D2****",
"InstanceIds" : {
"InstanceId" : "null"
},
"Detail" : "Resources Application is satisfied. Creating..."
}
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. |
400 | NotEnabled | You have not enabled this service | The error message returned because the service is not activated for your account. |
400 | InDebt | Your account has overdue payments. | The error message returned because your account has overdue payments. |
400 | InvalidVswitch | The vSwitch parameter is invalid, or the number of available IP addresses is insufficient. | The error message returned because the value of the vSwitch parameter is invalid or the available IP addresses are insufficient. |
400 | InvalidImage | The image ID is invalid. | The error message returned because the value of the vSwitch parameter is invalid or the available IP addresses are insufficient. |
400 | InvaildSystemDiskSize | The system disk size must be greater than or equal to image size. | The error message returned because the size of the system disk must be greater than or equal to that of the image. |
400 | InvalidInstanceType.NotSupported | The instance type is invalid. | The error message returned because the specified instance type is invalid. |
400 | InvalidZoneId.ValueNotSupported | The specified ZoneId is invalid. | The error message returned because the specified region ID is invalid. |
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. |
403 | TooManyLogins | The maximum number of logged on nodes is exceeded. | The error message returned because the number of logon nodes has exceeded the logon node quota, which is two. To raise the quota, submit a ticket. |
403 | TooManyScc | The maximum number of SCC instances is exceeded. | The error message returned because the number of SCC instances has exceeded the SCC instance quota, which is 15. To raise the quota, submit a ticket. |
403 | InvalidClusterStatus | The operation failed due to invalid cluster status. | The error message returned because the operation is not supported while the cluster is in the current state. |
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 | ConflictOpt | A conflicting operation is running. | The error message returned because an operation that conflicts with the current operation is in progress. Try again later. |
403 | ImageNotSupported | The specified image is not supported. | The error message returned because the selected image is not supported. Change the image and try again. |
403 | InvalidCapacityNum.ValueNotSupported | The specified TargetCapacity is invalid. | The error message returned because the value of the TargetCapacity parameter is invalid. |
403 | RecommendEmpty.InstanceTypeSoldOut | The resource is out of stock. | The error message returned because the resources are sold out. |
403 | ResourceTargetAmount.NotSatisfied | The resource application is not satisfied. | The error message returned because the resource request has failed. |
403 | RecommendEmpty.PriceNotSatisfied | The price limit is not satisfied. | The error message returned because the prices of the available instances are higher than the specified price limit. |
403 | QuotaExceed.PayasyougoInstance | The pay-as-you-go instance exceeds the quota. | The error message returned because the pay-as-you-go nodes that you want to add have exceeded the quota. |
404 | ImageNotFound | The specified image does not exist. | The error message returned because the specified image does not exist. |
404 | ClusterNotFound | The specified cluster does not exist. | The error message returned because the specified cluster does not exist. |
404 | VolumeNotFound | The specified volume does not exist. | The error message returned because the specified NAS file system does not exist. |
404 | ManagerNotFound | The manager nodes do not exist or their status is abnormal. | The error message returned because the management node does not exist or is not running as expected. |
404 | ObjectNotFound | The specified object is not found. | The error message returned because the specified object does not exist. |
404 | VswitchNotFound | The specified vSwitch does not exist. | The error message returned because the specified vSwitch does not exist. |
406 | EcsError | An error occurred while calling the ECS API operation. | The error message returned because the ECS API call has failed. |
406 | EipError | The EIP API request failed. | The error message returned because the operation has failed to call the EIP service. |
406 | DbError | A database service error occurred. | The error message returned because the database request has failed. |
406 | AliyunError | An Alibaba Cloud product error occurred. | The error message returned because the operation has failed to call another Alibaba Cloud service. |
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. |
409 | PartFailure | Part of the batch operation failed. | The error message returned because the batch operation has failed. |
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.