Auto provisioning lets you automatically provision a cluster of instances that use multiple instance types and billing methods, such as pay-as-you-go and spot instances, across multiple zones. This improves the efficiency of provisioning multiple instances in a batch. The provisioning policies of auto provisioning also help reduce the impact of spot instance reclamations on your services, which lets you use low-cost computing power with greater stability. This topic describes how to create an auto provisioning group.
Do not store important data on spot instances: When you use an auto provisioning group to provision spot instances, note that spot instances may be released or stopped due to changes in market supply and demand. To prevent data loss that may be caused by instance releases, do not store important data on spot instances.
Prerequisites
A service-linked role is created. After the role is created, auto provisioning uses the permissions of the role to manage instances in the group.
A launch template is created. An auto provisioning group uses a specific version of a launch template as the configuration source and inherits properties such as the image, security group, and logon credentials from the source.
Procedure
Go to the Auto Provisioning page.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
On the Auto Provisioning page, click Create Auto Provisioning Group. Enter a name for the auto provisioning group.
Configure the Basic Information for the auto provisioning group:
Set the Billing Method for the instances to be provisioned:
Pay-as-you-go: Provisions only pay-as-you-go instances.
Spot: Provisions only spot instances.
Pay-as-you-go and Spot: Provisions both pay-as-you-go and spot instances.
You can configure the Target Capacity Settings based on the selected billing method.
Pay-as-you-go
Capacity Delivery Mode: Specifies the unit of capacity for the auto provisioning group. You can select Instances or vCPUs.
Total Capacity: The amount of computing power to provision.
If you set Capacity Delivery Mode to Instances, Total capacity specifies the number of instances to deliver.
If you set Capacity Delivery Mode to vCPUs, the total capacity is the number of vCPUs to be delivered.
For example, if you provision an ecs.c6.large instance (2 vCPUs), it occupies a capacity of 2.
Spot
Capacity Delivery Mode: The capacity unit of the auto provisioning group. You can select Instances or vCPUs.
Total Capacity: The amount of computing power to provision.
If you set Capacity Delivery Mode to Instances, Total capacity specifies the number of instances to deliver.
If you set Capacity Delivery Mode to vCPUs, Total capacity specifies the total number of vCPUs to be delivered.
For example, provisioning an ecs.c6.large instance (2 vCPUs) occupies a capacity of 2.
Pay-as-you-go and Spot
Capacity Delivery Mode: The capacity unit of the auto provisioning group. You can set this to Instances or vCPUs.
Total Capacity: The sum of the Target Capacity of Spot Instances and Target Capacity of Pay-as-you-go Instances.
Target Capacity of Spot Instances:
If you set Capacity Delivery Mode to Instances, Total Capacity specifies the number of spot instances to be delivered.
If you set Capacity Delivery Mode to vCPUs, the total capacity specifies the total number of vCPUs to be delivered by the spot instances.
Target Capacity of Pay-as-you-go Instances:
If you set Capacity Delivery Mode to Instances, Total capacity specifies the number of pay-as-you-go instances.
If you set Capacity Delivery Mode to vCPUs, total capacity is the total number of vCPUs for the pay-as-you-go instances.
Set the Instance Configuration for the auto provisioning group.
Configuration Source: The source of the instance configuration. You can select a specific Version of a Launch Template to configure instances in the auto provisioning group.
Instance Configuration Mode:
Specify Instance Type: The system selects a suitable instance type from this list to create instances based on the specified vSwitch and Provisioning Policy.
NoteIf you set the Billing Method to Spot or Pay-as-you-go and Spot, you can also set a Price Limit for each spot instance type. If the market price of a spot instance exceeds the price cap, the instance creation fails. You can set the price cap in the following ways:
Use Automatic Bid: The system automatically bids at the real-time market price for spot instances. This ensures that instance creation does not fail because your bid is lower than the market price.
: Set a price cap. If the market price of a spot instance is higher than this price, the instance cannot be created. This helps you stay within your budget.
: Set a bid as a percentage of the on-demand instance price. This ensures a specific level of cost savings compared to on-demand instances.
Before setting a price cap, check the market price trends for spot instances. This helps prevent instance creation failures from a low price cap and budget overruns from a high price cap. Click Price History in the Actions column to view the price history.
Specify Instance Attribute: The system selects an appropriate instance type based on the Provisioning Policy and properties such as vSwitch ID, Maximum Acceptable Price, vCPU, Memory, and Architecture.
This method can effectively prevent instance creation failures caused by insufficient inventory.
In the Spot Instance Interruption Mode section, you can set the action to perform when the auto provisioning group stops a spot instance.
Option
Description
Release
Directly release the stopped spot instance.
Stop
The stopped spot instance enters economical mode. These instances are prioritized when the auto provisioning group needs to add instances.
In the Provisioning Policy section, you can specify the policy for instance creation. The available policies are as follows:
Option
Description
Capacity Optimization Policy
Automatically selects the most cost-effective instance type to create instances, considering the historical price fluctuations and reclamation rates of spot instances.
NoteSpot instances may be reclaimed due to factors such as price and inventory. Instance types with low reclamation rates are prioritized.
Cost Optimization Policy
Attempts to create instances in ascending order of vCPU unit price.
Balanced Distribution Policy
This policy takes effect only when vSwitches in different zones are specified in the instance configuration. It creates instances evenly across multiple zones.
When spot instances are reclaimed, they are reclaimed one by one based on instance type. Resources are shared among instances of the same instance family. For example, if an ecs.c6.large instance cannot be created, the c6 instance family may be running out of inventory. Other instance types such as ecs.c6.xlarge may also fail to be created.
NoteIf you choose the multi-zone balanced policy, configure different instance families. This prevents all instances from being reclaimed at the same time and ensures the high availability of the instance cluster.
Configure the Advanced Settings. The following describes each configuration item:
Advanced option
Description
Group Type
One-time Synchronous Delivery: The group synchronously creates instances only at startup. The system returns a list of successfully created instances and the reasons for any failures in the response.
Continuous Delivery and Capacity Maintained: The group attempts to provision the instance cluster at startup. The group continuously monitors the real-time capacity and target capacity. If the target capacity is not reached, the group continues to try creating instances until the capacity requirement is met.
One-time Asynchronous Delivery: The group attempts to provision the instance cluster only once at startup. The group does not retry if scheduling fails.
Start Time
Specifies the time when the auto provisioning group starts to provision the target capacity. This parameter is used with the end time to determine the effective period of the group.
Start Now: The group starts to provision the instance cluster immediately after the group is created.
Specify Start Time: You can customize the start time for the auto provisioning group.
End Time
This parameter is used with the start time to determine the effective period of the auto provisioning group.
Never: The auto provisioning group runs until you delete it.
Specify End Time: You can customize the expiration time for the auto provisioning group.
Global Maximum Price for Spot Instances
The global price cap for all spot instances in the auto provisioning group. This price cap applies to all instance types. If you specify both a maximum price for a specific instance type and a global price cap, the lower of the two values is used.
Use Automatic Bid: The system automatically bids at the real-time market price for spot instances. This ensures that instance creation does not fail because your bid is lower than the market price. Your costs are also reduced when the market price is low.
Set Maximum Price: Set a fixed price. If the market price of a spot instance is higher than the fixed price, the instance cannot be created. This helps you stay within your budget.
Instance Shutdown Settings
Shut Down Instances Upon Group Expiration: Specifies what happens to instances in an auto provisioning group after the group expires. If you select this option, the instances are released. If you do not select this option, the instances are only removed from the group. This setting is effective only if you specify an End Time for the group.
Shut Down Instances in Excess of Target Capacity: After the real-time capacity of the auto provisioning group exceeds the target capacity and triggers a scale-in event, the status of the scaled-in instances is affected. If you select this option, the scaled-in instances are released. If you do not select this option, the scaled-in instances are only removed from the group.
After you configure the settings, confirm the configuration, and then click Create Auto Provisioning Group.
After an auto provisioning group is created, it starts provisioning the instance cluster at the specified time. An auto provisioning group of the Continuous Delivery and Capacity Maintained type continuously maintains the target capacity of the instance cluster. When a spot instance is reclaimed, the group automatically launches a new instance to close the gap between the real-time capacity and the target capacity. It also promptly replaces unhealthy instances to ensure capacity continuity and stability.
References
To call an API operation to create an auto provisioning group, see CreateAutoProvisioningGroup.
You can view configuration examples for auto provisioning groups to help you create a group that meets your needs. For more information, see Auto provisioning group configuration examples.