Auto Provisioning allows you to quickly deliver Elastic Compute Service (ECS) instance clusters. You need to only make simple configurations to automate the delivery of instances that use different billing methods (pay-as-you-go and preemptible instances) across instance types and zones. This improves the efficiency of delivering a large number of instances at the same time. Auto Provisioning provides a variety of provisioning policies to alleviate the impacts on your business caused by the reclaiming of preemptible instances, so that you can use computing power at low costs. For example, you can use Auto Provisioning to create pay-as-you-go instances to meet the minimum computing power requirements and then create preemptible instances to meet your computing power requirements and reduce costs. This topic describes the usage scenarios, billing, and usage notes of Auto Provisioning.
Introduction
An auto provisioning group automatically delivers instance clusters based on the specified resource pool, target capacity, and provisioning policy. This eliminates the need to create instances one by one or calculate the costs of each instance. The following table describes the attributes of auto provisioning groups.
Attribute | Description |
Resource pool | A resource pool consists of a single zone and a single instance type. You can specify multiple zones and instance types to ensure that multiple resource pools are available to create instances. |
Target capacity | Target capacity is the computing power that is scheduled to be provisioned, and can include the capacity of preemptible and pay-as-you-go instances. You can specify the target capacity based on instances, vCPUs, or memory size. By default, auto provisioning groups use preemptible instances to meet the target capacity. You can specify to use pay-as-you-go instances to provide the minimum required computing power. If you specify to use the capacity of pay-as-you-go instances, pay-as-you-go instances are created with priority over preemptible instances. Then, preemptible instances are created to make up for the remaining target capacity. If preemptible instances cannot be created due to insufficient resources, pay-as-you-go instances are created to meet the target capacity. |
Provisioning policy | A provisioning policy is used to select resource pools to use to create instances. For example, you can use the resource pool with the lowest unit price to reduce your costs, or choose to create instances in different zones to improve the availability of your instances. For more information about provisioning policies, see the Policy type table in this topic. |
Scenarios
Similar to preemptible instances, auto provisioning groups are applicable to stateless applications such as scalable website services, image rendering, big data analytics, and parallel computing. For more information, see What are preemptible instances?.
Billing
Auto Provisioning is available free of charge.
However, you are charged for instances that are created based on auto provisioning groups. Auto Provisioning supports preemptible and pay-as-you-go instances. For information about the billing of the instances, see What are preemptible instances? and Pay-as-you-go.
Make sure that you have sufficient balance in your account. If you have overdue payments, all pay-as-you-go and preemptible instances are stopped. For more information, see Pay-as-you-go. In this case, the auto provisioning group cannot create instances. The auto provisioning group considers the stopped instances to be unhealthy based on the health check results and then removes and releases the instances.
Usage notes
Before you create an auto provisioning group, make sure that the following operations are performed:
Specify the launch template that contains the basic instance configurations. For more information, see Overview.
The auto provisioning group uses attributes such as the image, security group, and logon credential specified in the launch template, but not the instance type and the vSwitch that specifies the zone where to create the instances. The auto provisioning group uses a separately specified vSwitch and instance type instead.
Specify the resource pools to use to create instances across zones and instance types.
A resource pool consists of a single zone and a single instance type. If resources in one resource pool are insufficient, the auto provisioning group uses another resource pool with sufficient resources to create instances. A larger number of resource pools increases the available options for creating instances and improves the success rate of creating instances.
ImportantYou can specify only a single vSwitch within a single zone. If you specify multiple vSwitches within the same zone, only the first vSwitch takes effect.
Specify the target capacity of the auto provisioning group and the proportions of capacities of different types.
The target capacity can be specified based on instances, vCPUs, or memory size. Auto Provisioning uses the weight of an instance type to indicate the capacity of a single instance of this instance type. The following rules apply to weights:
If the target capacity is specified based on instances, the weights of all instance types are the same.
If the target capacity is set to the number of vCPUs, the weight of an instance type varies based on the number of vCPUs. The more vCPUs that an instance type has, the higher the weight of the instance type and the fewer instances of the instance type that are required to meet the target capacity.
If the target capacity involves multiple instance type factors such as vCPUs and memory, you must evaluate the computing power that each specified instance type is able to contribute to the target capacity and set a weight for each instance type. A larger weight indicates that the instance type is able to contribute more computing power.
NoteYou can specify the weights of instance types only when you create auto provisioning groups by calling the CreateAutoProvisioningGroup operation.
If you use pay-as-you-go instances to meet the minimum computing power requirements and use preemptible instances to meet the remaining target capacity, your costs can be significantly reduced.
Specify the provisioning policy.
The following table describes the provisioning policies in Auto Provisioning.
Policy
Application to
Method
Description
Capacity optimization policy (capacity-optimized)
Preemptible instance
ECS console (preemptible instance): Set Provisioning Policy to Capacity Optimization Policy.
API operation (preemptible instance): Set SpotAllocationStrategy to capacity-optimized.
The resource pool that is most cost-effective and that has the highest success rate of instance creation is used based on the prices and reclaim rates to create preemptible instances. This can effectively reduce the possibilities of preemptible instances being reclaimed and ensure stable capacity.
Balanced distribution policy (diversified)
Preemptible instance
ECS console (preemptible instance): Set Provisioning Policy to Balanced Distribution Policy.
API operation (preemptible instance): Set SpotAllocationStrategy to diversified.
Resource pools in multiple zones are evenly used to create instances. This eliminates the possibilities of instance creation failures caused by insufficient resources in a single zone and can effectively improve the disaster recovery capabilities of applications.
Cost optimization policy (lowest-price)
Preemptible and pay-as-you-go instances
ECS console (preemptible instance): Set Provisioning Policy to Cost Optimization Policy.
API operation (preemptible instance): Set SpotAllocationStrategy to lowest-price.
API operation (pay-as-you-go instance): Set PayAsYouGoAllocationStrategy to lowest-price.
The resource pool with the lowest cost is used to create instances. This can effectively reduce costs. The resource pool with the lowest cost has vCPUs whose unit prices are the lowest.
If you create an auto provisioning group by calling the CreateAutoProvisioningGroup operation, you can use the cost optimization policy for preemptible instances and specify the number of resource pools to use by configuring the SpotInstancePoolsToUseCount parameter. You can use multiple resource pools with the lowest costs to create instances.
For example, you specify 100 preemptible instances as the target capacity of an auto provisioning group and set SpotInstancePoolsToUseCount to 5. Each resource pool is used to create 20 instances. When preemptible instances created by using a resource pool are reclaimed, preemptible instances created by using other resource pools remain available. This can effectively improve the availability of services.
Priority-based policy (prioritized)
Pay-as-you-go instance
API operation (pay-as-you-go instance): Set PayAsYouGoAllocationStrategy to prioritized.
Resource pools are used based on their priorities in descending order. When resources in a high-priority resource pool are insufficient, lower-priority resource pools are used.
You must call the CreateAutoProvisioningGroup operation and configure the LaunchTemplateConfig.N.Priority parameter to specify the priority-based policy and the priority of the resource pools.
ImportantYou can specify provisioning policies for pay-as-you-go instances only when you call the CreateAutoProvisioningGroup operation to create auto provisioning groups. In other cases, the cost optimization policy is used by default.
Specify the maximum hourly prices.
You can specify the maximum hourly prices of preemptible instances for a single resource pool or for all resource pools. If the specified maximum prices are exceeded, the auto provisioning group stops creating preemptible instances even if the target capacity is not met. This ensures that your provisioned resource costs remain within your budget.
You can use discount plans such as reserved instances and savings plans to reduce your costs of pay-as-you-go instances. For more information, see Overview of reserved instances and Overview of savings plans.
Specify whether to maintain the target capacity.
The type of an auto provisioning group can be set to One-time Delivery or Continuous Delivery and Maintain Capacity. If you select Continuous Delivery and Maintain Capacity when you create an auto provisioning group, the auto provisioning group automatically checks the health status of instances, compares the real-time capacity and target capacity, and creates instances to maintain the target capacity to meet your computing power needs. When instances become unhealthy or insufficient, the auto provisioning group automatically creates instances to maintain the target capacity.
After an auto provisioning group starts, it selects appropriate resource pools based on the specified provisioning policy to provision instances that meet the target capacity. For example, if you want to provision a cluster that contains 12 instances by using the MyLaunchTemplate launch template and want improved cluster availability, you can perform the following procedure to configure the auto provisioning group:
Specify multiple resource pools based on the MyLaunchTemplate launch template.
Specify the proportions of capacities of preemptible and pay-as-you-go instances.
Specify the provisioning policy.
Limits
Auto provisioning groups cannot provision instances across regions.
For each auto provisioning group, you can specify the specified version of a single launch template as the basic configurations of instances. However, you can specify multiple resource pools based on the instance type specified in the launch template.
Each auto provisioning group can include up to 20 resource pools. Each resource pool is a combination of a single zone and a single instance type.
Up to 1,000 instances can be created in each auto provisioning group.
Auto Provisioning configuration guidelines
You can perform the following operations to use Auto Provisioning:
(Conditionally required) Grant your account the permissions on Auto Provisioning operations.
If you use a Resource Access Management (RAM) user, you must grant the RAM user the permissions to perform operations on auto provisioning groups. For more information, see Manage the service-linked role for Auto Provisioning.
Create a service-linked role for Auto Provisioning.
For more information, see Manage the service-linked role for Auto Provisioning.
Create an instance launch template. Then, create an auto provisioning group.
For more information, see Create an auto provisioning group. You can create an auto provisioning group based on your business requirements. For more information, see Configure an auto provisioning group.
Manage an auto provisioning group by performing the following operations:
References
You can use a scaling group to automatically change the number of ECS instances based on business changes. For more information, see What is Auto Scaling?
For information about how to create ECS instances, see Create an instance.