You can use ECS API operations to create multiple pay-as-you-go ECS instances at the same time. Compared with the RunInstances operation, the CreateAutoProvisioningGroup operation can help you create a large number of ECS instances at the same time in a simpler and more stable manner.
Background information
To meet your requirements of creating more than 100 ECS instances at the same time, Alibaba Cloud provides auto provisioning groups. You can call the CreateAutoProvisioningGroup operation to create an auto provisioning group and use the group to deploy an instance cluster across different billing methods, instance families, and zones within one click. CreateAutoProvisioningGroup is more suitable than RunInstances when you create a large number of ECS instances. For more information, see Comparison between RunInstances and CreateAutoProvisioningGroup and Benefits of auto provisioning groups.
Comparison between RunInstances and CreateAutoProvisioningGroup
Item | RunInstances | CreateAutoProvisioningGroup |
---|---|---|
Maximum number of instances that can be created at the same time | 100. | 1,000 (up to 10,000 vCPUs). |
Capacity delivery form | Specific number of instances. | Specific number of instances, specific number of vCPUs, and instance types of different weights |
Support for multiple zones | No. | Yes. |
Support for multiple instance types | No. | Yes. |
Support for multiple disk categories | No. | Yes. |
Provision of policies that you can use to create instances | No. | Yes. The following policies are provided:
|
Delivery stability | Affected by resource availability. | Multiple combinations of instance types and zones reduce the impacts of resource availability. |
Response method | Returns a response in real time. | Returns a response in real time. |
- Assume that you called the RunInstances operation to batch create instances of a single instance type in a single zone. When you call the CreateAutoProvisioningGroup operation instead to batch create instances, you need only to configure a combination of instance types and zones.
- Assume that you manually configure a business deployment plan when you called the
RunInstances operation to batch create instances. You can call the CreateAutoProvisioningGroup operation instead to deploy instances that have multiple categories of disks attached
across multiple instance types and zones, based on different instance provisioning
policies provided by Auto Provisioning.
For example, you manually configured a business deployment plan that traversed multiple instance types and zones to create instances by calling the RunInstances operation. This improves the success rate of creating instances. If you call the CreateAutoProvisioningGroup operation instead to batch create a large number of instances, you need only to configure multiple combinations of instance types and zones, and select an appropriate policy. The created auto provisioning group automatically batch creates instances based on your configurations and policy.
WeightedCapacity
parameter, the maximum weighted capacity that is created one time is 10,000.
Possible issues caused by using RunInstances
Due to the limits of the RunInstances operation, you may encounter the following issues when you call RunInstances to create instances.
Issue | Description | Solution |
---|---|---|
A limited number of instances can be created at the same time. | You can call the RunInstances operation to create a maximum of 100 ECS instances at the same time. | If you want to create more than 100 ECS instances, you must call this operation multiple times in a recurring or concurrent manner. |
The success rate of creating instances is not ensured. | You can call the RunInstances operation to create instances of a single instance type
in a single zone. When you call this operation to create multiple ECS instances at
the same time, you may encounter the following issues:
|
|
Simple policies that are used to create instances cannot meet diversified business requirements. | RunInstances can only be used to create instances of a single instance type in a single
zone. If you need to deploy instances in multiple zones to implement geo-disaster
recovery or create ECS instances at minimal costs, you must create a business deployment
plan on your own to ensure that instances are deployed. A business deployment plan
that you create on your own may have the following issues:
|
To resolve the issue, you may contact Alibaba Cloud for assistance. |
Benefits of auto provisioning groups
Alibaba Cloud provides auto provisioning groups to address the issues that you may encounter when you call the RunInstances operation to create multiple ECS instances at the same time. Auto provisioning groups allow you to deploy an instance cluster across different billing methods, instance families, and zones within one click. Auto provisioning groups provide stable computing power, alleviate the instability caused by recycled preemptible instances, and eliminate the need to manually create instances. The following table describes the benefits of auto provisioning groups.
Benefit | Description |
---|---|
Allow you to create a large number of ECS instances at the same time. | You can use an auto provisioning group to create up to 1,000 ECS instances at the same time. |
Allow you to create instances that have multiple categories of disks attached across instance types and zones. | Auto provisioning groups allow you to configure up to 10 combinations of instance
types and zones, and allow you to select up to five disk categories. This ensures
high availability when you create ECS instances at the same time.
Example scenarios: When you create ECS instances based on the balanced distribution policy provided by an auto provisioning group, you can configure multiple instance types and zones. As required by the policy, instances need to be created in a relatively balanced manner across zones. However, if the required number of instances cannot be created in a zone, the auto provisioning group attempts to create the same number of instances in other zones. If you specify multiple disk categories, the auto provisioning group creates disks
for instances based on the priorities of the disk categories, and changes a disk category
if the disk category is unavailable.
Note If all disk categories are unavailable, the auto provisioning group no longer uses
this method but selects another creation method.
|
Support multiple policies to create instances | Auto provisioning groups provide the following policies to create instances:
|
Improve availability of preemptible instances | The demand for preemptible instances is increasing due to the advantages in prices
of preemptible instances. However, the prices of preemptible instances fluctuate,
and the instances are recycled when bidding prices become lower than current market
prices after protection periods. This makes preemptible instances difficult to manage.
Auto provisioning groups improve the availability of preemptible instances while low
costs are maintained. The following items describe how to improve the availability
of preemptible instances:
|
Best practices for creating auto provisioning groups by calling CreateAutoProvisioningGroup
This section provides the sample Java code that is used to create an auto provisioning group (CreateAutoProvisioningGroup). This section also describes how to call the CreateAutoProvisioningGroup operation.