Auto Provisioning can automate the delivery of instances that use different billing methods (pay-as-you-go and preemptible instances) across instance types and zones, which improves the efficiency of batch delivering a large number of instances. 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. This topic describes how to create an auto provisioning group.
Prerequisites
Your account is granted permissions on Auto Provisioning. For more information, see Manage the service-linked role for Auto Provisioning.
A launch template is created. For more information, see Create a launch template.
ImportantAuto provisioning groups use specific versions of launch templates as instance configuration sources and create instances based on the attributes of the launch template versions, such as instance images, security groups, and logon credentials. For more information, see the Usage notes section in the "Overview" topic.
Procedure
Go to the Auto Provisioning page.
Log on to the ECS console.
In the upper-left corner of the top navigation bar, select a region.
In the left-side navigation pane, choose .
On the Auto Provisioning page, click Create Auto Provisioning Group.
In the Group Name field, enter a name for the auto provisioning group.
In the Target Capacity section, configure the capacity-related parameters.
The capacity-related parameters determine the sum of compute capacity provisioned by the auto provisioning group and the proportions of compute capacities provided by preemptible and pay-as-you-go instances. The following table describes the parameters.
Parameter
Description
Target Capacity
The compute capacity that the auto provisioning group provisions. You can specify this capacity in units of Instances or vCPUs. After you select Use Pay-as-you-go Instances to Provide Computing Power, you can specify the compute capacity provisioned by pay-as-you-go instances. By default, only preemptible instances are created by the auto provisioning group. Pay-as-you-go instances are created only after you set the Pay-as-you-go Instance Capacity parameter to a value greater than 0.
NoteIf the target capacity involves multiple instance type factors such as vCPUs and memory, call the CreateAutoProvisioningGroup operation to create an auto provisioning group and set weights for the specified instance types.
Pay-as-you-go Instance Capacity
The capacity of pay-as-you-go ECS instances that the auto provisioning group provisions. You can specify this capacity in units of Instances or vCPUs. You can use pay-as-you-go instances to ensure that the lowest compute capacity requirement can be met because preemptible instances may be reclaimed.
Auto Provisioning uses the weight of an instance type to indicate the capacity of a single instance of the instance type in an auto provisioning group.
If the target capacity is specified in units of Instances, the weights of all instance types are the same.
If the target capacity is specified in units of vCPUs, the weight of an instance type depends 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, evaluate the compute capacity that each specified instance type can contribute to the target capacity and set a weight for each instance type. A larger weight indicates that the instance type can contribute more compute capacity.
In the Configuration Source and Instance Configuration sections, configure instance attributes.
You can use an auto provisioning group to create instances of multiple instance types across multiple zones. If an instance cannot be created due to insufficient resources of a specific instance type or insufficient resources in a specific zone, the auto provisioning group attempts to create instances of another instance type or create instances in a different zone. This improves the success rate of creating instances.
You can specify vSwitches in multiple zones to create instances across multiple zones, and add instance types to create instances of multiple instance types. The following figure shows an example on how to configure the parameters. For more information, see Configure an auto provisioning group.
In the preceding example, two zones and three instance types are used. The following table describes operations involved in the example.
No.
Procedure
①
Select a launch template and then a version of the launch template as the configuration source.
NoteThe auto provisioning group creates instances based on the vSwitches and instance types that are specified in section ② and section ④ and the attributes that are obtained from the configuration source, such as the image, security groups, and logon credentials.
②
Complete instance configurations. By default, the vSwitch and instance type that are specified in the configuration source are used. You can select other vSwitches and add other instance types.
NoteYou must specify at least one instance configuration for an auto provisioning group.
③
Add an instance configuration to create instances across multiple zones.
④
Complete the instance configuration. Specify the following required parameters:
Specify VSwitch: Select a vSwitch to which to connect the instances. Make sure that the vSwitch resides in a zone different from that of the vSwitch specified in section ②.
ImportantIf you specify multiple vSwitches within the same zone, only the first vSwitch takes effect.
Add Instance Type: You can select multiple instance types to improve the success rate of instance creation. In this example, two instance types are selected. In the Select Instance Type dialog box, instance types that have the same instance size or vCPU-to-memory ratio as the instance type specified in the configuration source are listed. You can also select other instance types.
In addition to vSwitches and instance types, you can also configure a maximum hourly price for preemptible instances of each instance type. You can use one of the following methods to configure a maximum hourly price for an instance type:
Select Automatic Bidding. The real-time market price is used as the maximum hourly price to bid for the instance type. This way, preemptible instances do not fail to be created due to low bids. The instance costs are subject to changes to the market price.
Choose Set Maximum Price > Maximum Price, and specify a maximum hourly price to bid for the instance type. Preemptible instances cannot be created if your bid is lower than the market price. This prevents instance costs from spiraling out of control if the market price increases.
Choose Set Maximum Price > Pay-as-you-go Price, and specify a percentage of the pay-as-you-go price as the maximum hourly price. Created preemptible instances cost less than equivalent pay-as-you-go instances by the percentage. For example, if you specify 50%, preemptible instances fail to be created when the market price is higher than 50% of the pay-as-you-go price.
NoteWe recommend that you learn the market price trends of preemptible instances before you configure the maximum hourly prices. This way, you can prevent high costs or failures to meet the target capacity. You can click Price History in the Actions column to view historical prices.
In the Preemptible Instance Interruption Settings section, specify the action of the auto provisioning group after it stops the preemptible instances.
The following table describes the options available.
Option
Description
Release
The auto provisioning group releases the stopped preemptible instances.
Stop
The auto provisioning group puts the stopped preemptible instances into economical mode. If the auto provisioning group requires more instances, these preemptible instances are prioritized for use.
In the Provisioning Policy section, select the policy used to create instances.
The following table describes the options available.
Option
Description
Capacity Optimization Policy
The auto provisioning group selects the most cost-effective instance type based on the prices and reclaim rates to create preemptible instances.
NotePreemptible instances may be reclaimed due to factors such as price and inventory. Instance types that have low reclaim rates are preferred.
Cost Optimization Policy
The auto provisioning group attempts to create ECS instances based on the unit prices of vCPUs in ascending order.
Balanced Distribution Policy
The auto provisioning group evenly distributes ECS instances across the zones that are specified in the instance configurations. This option takes effect only when multiple zones are specified.
The preemptible instances of each instance type are reclaimed together. Instance resources are shared within the same instance family. For example, if an instance of the ecs.c6.large instance type fails to be created, a possible cause is that instance resources in the c6 instance family are insufficient. Instances of other c6 instance types, such as ecs.c6.xlarge, may also fail to be created.
NoteIf you select Balanced Distribution Policy, we recommend that you configure instance types from different instance families to prevent instances from being reclaimed at the same time and ensure that your instance clusters remain available.
Configure parameters in the Advanced section.
The following table describes the parameters.
Parameter
Description
Group Type
One-time Delivery: After the auto provisioning group is started, it tries only once to create an instance cluster that meets the target capacity. If the instance cluster fails to be created, the auto provisioning group does not try again to create the instance cluster.
Continuous Delivery and Maintain Capacity: After the auto provisioning group is started, it attempts to create an instance cluster until the cluster reaches the target capacity. If the real-time capacity does not match the target capacity, the auto provisioning group scales in or out instances to meet the target capacity.
Start Time
The time when the auto provisioning group is started. The period of time between this point in time and the point in time specified by End Time is the validity period of the auto provisioning group.
Now: The auto provisioning group is started immediately after it is created.
Specify Start Time: Specify a point in time at which to start the auto provisioning group.
End Time
The time when the auto provisioning group expires. The period of time between this point in time and the point in time specified by Start Time is the validity period of the auto provisioning group.
Never: The auto provisioning group never expires and can be only manually deleted.
Specify End Time: Specify the point in time at which the auto provisioning group expires.
Global Maximum Price for Preemptible Instances
The global maximum hourly price for preemptible instances created in the auto provisioning group. This parameter applies to preemptible instances of all instance types. If the global maximum hourly price is different from the maximum hourly price specified for an instance type in the instance configurations, the lower one of the two prices takes precedence.
Automatic Bidding: The real-time market price is used as the maximum hourly price to bid for instance types. This way, preemptible ECS instances do not fail to be created due to low bids. The instance costs are subject to changes to the market price.
Set Maximum Price: Specify a maximum hourly price to bid for instance types. In this case, preemptible instances cannot be created if your bid is lower than the market price. This prevents instance costs from spiraling out of control if the market price increases.
Instance Shutdown Settings
Shut Down Instances Upon Group Expiration: If you select this option, instances in the auto provisioning group are released when the auto provisioning group expires. If you do not select this option, the instances are only removed from the auto provisioning group. This option is valid only for the auto provisioning group for which the End Time is set.
Shut Down Excessive Instances When Target Capacity Is Exceeded: When the real-time capacity of the auto provisioning group exceeds the target capacity, a scale-in event is triggered. If you select this option, the excess instances are released. If you do not select this option, the excess instances are only removed from the auto provisioning group.
Check that your configurations are correct and click Create Provisioning Group.
After the auto provisioning group is created, it starts and attempts to create the instance cluster at the specified time. If Group Type is set to Continuous Delivery and Maintain Capacity, the auto provisioning group continuously maintains the instance cluster. The auto provisioning group attempts to create instances to meet the target capacity when preemptible instances are reclaimed, and replaces unhealthy instances at the earliest opportunity.
References
You can call the CreateAutoProvisioningGroup operation to create an auto provisioning group. For more information, see CreateAutoProvisioningGroup.
You can view the examples on how to configure an auto provisioning group and create an auto provisioning group that meets your business requirements. For more information, see Configure an auto provisioning group.