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

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

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.

  • If ResourceAmountType is set to Instance, the value range of TargetCapacity is 1 to 200.
  • If ResourceAmountType is set to Cores, the value range of TargetCapacity is 1 to 1,000.
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:

  • NoSpot: The compute nodes use the pay-as-you-go billing method.
  • 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

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:

  • cloud_efficiency: ultra disk.
  • cloud_ssd: SSD.
  • cloud_essd: ESSD.
  • cloud: basic disk. Disks of this type are retired.
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:

  • true: A public IP address is allocated to the compute nodes.
  • false: A public IP address is not allocated to the compute nodes.

Default value: false

InternetChargeType String No PayByTraffic

The billing method of the elastic IP address (EIP). Valid values:

  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-traffic
InternetMaxBandWidthIn Integer No 10

The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:

  • If the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of the parameter are 1 to 10 and the default value is 10.
  • If the purchased outbound public bandwidth is greater than 10Mbit/s, the valid values of this parameter are 1 to the amount of the outbound bandwidth that is purchased.
InternetMaxBandWidthOut Integer No 10

The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100.

Default value: 0

ZoneInfos.N.ZoneId String No cn-hangzhou-b

The ID of the zone to which the cluster belongs.

Note Each zone ID must be unique.
ZoneInfos.N.VSwitchId String No vsw-bp1e47optm9g58zcu****

The ID of the vSwitch.

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 only takes effect when Cores and Memory are specified. Valid values:

  • EntryLevel
  • EnterpriseLevel
  • CreditEntryLevel For more information, see Overview.

Default value: EnterpriseLevel

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

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 only takes effect 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

ResourceAmountType String No Instances

The type of the resource to be added. Valid values:

  • Instances: compute node
  • Cores: vCPU and memory

Default value: Instances

PriorityStrategy String No LowPriceResourcePlanning

The application policy of the preemptible nodes. Valid values:

  • LowPriceResourcePlanning: Preemptible nodes are created based on the unit prices of vCPUs in ascending order. Preemptible nodes are created first when preemptible instance types are specified.
  • CapacityOptResourcePlanning: Preemptible nodes are created based on the prices and release rates in ascending order.
  • CustomizedResourcePlanning: Nodes are added based on the predefined value of the ZoneIds.N parameter. Instances of a zone that has a higher priority are used first.
StrictSatisfiedTargetCapacity Boolean No true

Specifies whether to meet the requirements of the TargetCapacity parameter. Valid values:

  • true: If the available resources are fewer than the resources that you want to add, no compute nodes are created and an error is returned. If the available resources are more than the resources that you want to add, the following cases may occur:
    • If StrictResourceProvision is set to true, check the supply of the resources. Compute nodes are created based on the value of the TargetCapacity parameter only when the available resources are sufficient. Otherwise, no compute nodes are created.
    • If StrictResourceProvision is set to false, check the supply of the resources. Compute nodes are created only when the available resources are sufficient. However, some compute nodes may fail to be created because resources become insufficient after the supply is checked.
  • false: If the available resources are insufficient, compute nodes are created based on the supply of the resources.

Default value: true

SystemDiskLevel String No PL0

The performance level of the ESSD that is created as the system disk. 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.

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 only takes effect when StrictSatisfiedTargetCapacity is set to true. Valid values:

  • true: Check the supply of the resources. Compute nodes are created based on the value of the TargetCapacity parameter only when the available resources are sufficient. Otherwise, no compute nodes are created.
  • false: Check the supply of the resources. Compute nodes are created only when the available resources are sufficient. However, some compute nodes may fail to be created because resources become insufficient after the supply is checked.

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

Response parameters

Parameter Type Example Description
Detail String Resources Application is satisfied. Creating...

The detailed result of the request.

InstanceIds List null

The ID of the 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 obtain the IDs of the ECS instances.
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.

Samples

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

<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

{
    "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 has not been activated for your account.
400 InDebt Your account has overdue payments. The error message returned because your account has overdue payments.
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 Super Computing Cluster (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.
404 ImageNotFound The specified image does not exist. The error message returned because the specified cluster 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 storage instance 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.
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.
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 Elastic IP Address 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.
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.
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.
404 VswitchNotFound The specified vSwitch does not exist. The error message returned because the specified vSwitch does not exist.
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 ImageId parameter is invalid.
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.
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.
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.
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.