This topic describes how to configure an auto provisioning group in different scenarios.

Machine learning scenarios

For example, you plan to complete a machine learning task in the next week. The task involves analyzing risk factors in mortgage loans. You have the following requirements on the instance cluster:
  • Region: China (Hangzhou).
  • Instances: use NVIDIA V100 GPUs. The GPU memory of a single instance does not exceed 32 GB.
  • Target capacity: 20 instances.
  • To minimize costs, only preemptible instances are created. The number of instances in the instance cluster can be less than the value specified by the Target Capacity parameter.
  • Instances must be released after the task is completed.
The following table describes the configurations of the auto provisioning group based on the preceding requirements of the scenario.
Section Parameter Description
Capacity Configuration Target Capacity Configure the following settings based on the target capacity and instance category requirements:
  • Select Instances from the Target Capacity drop-down list.
  • Specify 20 in the spin box.
Instance Configuration Instance Configuration Perform the following operations to meet the requirements for instances that use NVIDIA V100 GPUs and the GPU memory of no larger than 32 GB per instance:
  1. Select the ecs.gn6v-c8g1.2xlarge and ecs.gn6e-c12g1.3xlarge instance types from the Instance Type column.
    Note For information about instance types, see Instance families.
  2. Query the amount of available resources of ecs.gn6v-c8g1.2xlarge and ecs.gn6e-c12g1.3xlarge in Hangzhou Zone H and Hangzhou Zone I.
    Note You can go to the ECS Instance Types Available for Each Region page to view the instance types available in each region.
You can add instance configurations based on the zones and instance types:
  1. Perform the following operations to add an instance configuration:
    • Specify a vSwitch in Hangzhou Zone H.
    • Add the ecs.gn6v-c8g1.2xlarge and ecs.gn6e-c12g1.3xlarge instance types.
  2. Perform the following operations to add another instance configuration:
    • Specify a vSwitch in Hangzhou Zone I.
    • Add the ecs.gn6v-c8g1.2xlarge and ecs.gn6e-c12g1.3xlarge instance types.
The following resource pools are formed after you add the preceding configurations:
  • The ecs.gn6v-c8g1.2xlarge instance type in Hangzhou Zone H
  • The ecs.gn6e-c12g1.3xlarge instance type in Hangzhou Zone H
  • The ecs.gn6v-c8g1.2xlarge instance type in Hangzhou Zone I
  • The ecs.gn6e-c12g1.3xlarge instance type in Hangzhou Zone I
Provisioning Policy Select Cost Optimization Policy. After the auto provisioning group is started, the resource pool that is available at the lowest price is used to create an instance cluster.
Advanced Group Type To minimize costs, the number of instances in the instance cluster can be less than the value specified by the Target Capacity parameter. In this case, select One-time Delivery.
Start Time and End Time Specify the start and expiration time based on the next-week time requirement.
Instance Shutdown Settings
  • Instances in the auto provisioning group must be released after the task is completed. Therefore, select Shut Down Instances Upon Group Expiration.
  • Select Shut Down Excessive Instances When Target Capacity Is Exceeded to minimize costs.

Ticketing website scenarios

For example, you want to build a ticketing website to provide reliable ticketing services at all hours, especially during peak hours. You have the following requirements on the instance cluster:
  • Region: China (Hangzhou).
  • Instances: The number of vCPUs on a single instance does not exceed 8.
  • Target capacity: 80 vCPUs.
  • Minimum capacity: 60 vCPUs.
  • To minimize costs, the website access experience is optimized based on the minimum computing requirements of the cluster.
  • The cluster must have disaster recovery capabilities.
The following table describes the configurations of the auto provisioning group based on the preceding requirements of the scenario.
Section Parameter Description
Capacity Configuration Target Capacity Configure the following settings based on the target capacity and minimum capacity requirements:
  • Select vCPUs from the Target Capacity drop-down list.
  • Specify 80 in the spin box.
  • Select Use Pay-as-you-go Instances to Provide Computing Power.
Pay-as-you-go Instance Capacity Specify 60 in the spin box to meet the minimum capacity requirement.
Instance Configuration Instance Configuration The c6 instance family is used because it is suitable for building frontend web servers. Perform the following operations to meet the requirements for instances that are equipped with no more than 8 vCPUs per instance:
  1. Select ecs.c6.large, ecs.c6.xlarge, and ecs.c6.2xlarge from the Instance Type column.
    Note For information about instance types, see Instance families.
  2. Query the amount of available resources of ecs.c6.large, ecs.c6.xlarge, and ecs.c6.2xlarge in Hangzhou Zone H, Hangzhou Zone I, and Hangzhou Zone J.
    Note You can go to the ECS Instance Types Available for Each Region page to view the instance types available in each region.
You can add instance configurations based on the zones and instance types:
  1. Perform the following operations to add an instance configuration:
    • Specify a vSwitch in Hangzhou Zone H.
    • Add the ecs.c6.large, ecs.c6.xlarge, and ecs.c6.2xlarge instance types.
  2. Perform the following operations to add an instance configuration:
    • Specify a vSwitch in Hangzhou Zone I.
    • Add the ecs.c6.large, ecs.c6.xlarge, and ecs.c6.2xlarge instance types.
  3. Perform the following operations to add another instance configuration:
    • Specify a vSwitch in Hangzhou Zone J.
    • Add the ecs.c6.large, ecs.c6.xlarge, and ecs.c6.2xlarge instance types.
The following resource pools are formed after you add the preceding configurations:
  • The ecs.c6.large instance type in Hangzhou Zone H
  • The ecs.c6.xlarge instance type in Hangzhou Zone H
  • The ecs.c6.2xlarge instance type in Hangzhou Zone H
  • The ecs.c6.large instance type in Hangzhou Zone I
  • The ecs.c6.xlarge instance type in Hangzhou Zone I
  • The ecs.c6.2xlarge instance type in Hangzhou Zone I
  • The ecs.c6.large instance type in Hangzhou Zone J
  • The ecs.c6.xlarge instance type in Hangzhou Zone J
  • The ecs.c6.2xlarge instance type in Hangzhou Zone J
Provisioning Policy Select Balanced Distribution Policy. After the auto provisioning group is started, it attempts to evenly create instances across zones to prevent instance creation failures caused by insufficient resources within a single zone. This can improve the disaster recovery capabilities of applications.
Advanced Group Type Select Continuous Delivery and Maintain Capacity to continuously provide ticketing service.
Start Time and End Time The auto provisioning group immediately starts and can be indefinitely retained to continuously provide ticketing service.
Instance Shutdown Settings Select Shut Down Excessive Instances When Target Capacity Is Exceeded to minimize costs.
The target capacity is specified in the number of vCPUs. Therefore, the weight of each instance is related to the number of vCPUs of each instance type. The following table describes the weighted price of each instance type.
Note Prices in the following table are for reference only. The actual prices displayed on the buy page prevail.
Instance type vCPU Pay-as-you-go price (USD) Weight Weighted price (USD)
ecs.c6.large 2 0.06/hour 2 0.03/hour
ecs.c6.xlarge 4 0.121/hour 4 0.03025/hour
ecs.c6.2xlarge 8 0.241/hour 8 0.030125/hour

When an auto provisioning group attempts to create an instance cluster, the auto provisioning group first attempts to implement the balanced distribution policy and evenly creates instances across zones. Then, the auto provisioning group attempts to choose instance types that have lower weighted prices to create instances. If the weighted prices of all instance types are the same, the auto provisioning group chooses instance types at random to create instances.

Use multiple resource pools that have the lowest prices

If you want to minimize costs and alleviate the impact of reclaiming preemptible instances created by using a single resource pool, you can configure an auto provisioning group to use multiple resource pools that have the lowest prices to create instances.

You can configure an auto provisioning group to use multiple resource pools only when you call the CreateAutoProvisioningGroup operation to create the auto provisioning group. Make sure that you set the SpotAllocationStrategy parameter to lowest-price and specify the SpotInstancePoolsToUseCount parameter. For example, you can make the configurations described in the following table to create an auto provisioning group with the following results:
  • Obtain five resource pools based on the lt-bp1ivgo4p5now3px**** launch template.
  • Set the target capacity to 30 instances and create only preemptible instances.
  • Use the three resource pools that have the lowest prices and create 10 preemptible instances from each resource pool.
Parameter Value Description
TotalTargetCapacity 30 Sets the target capacity to 30 instances.
SpotTargetCapacity 30 Creates 30 preemptible instances.
PayAsYouGoTargetCapacity 0 Creates no pay-as-you-go instances.
SpotAllocationStrategy lowest-price Uses the cost optimization policy for preemptible instances.
PayAsYouGoAllocationStrategy lowest-price Uses the cost optimization policy for pay-as-you-go instances.
SpotInstancePoolsToUseCount 3 Uses the three resource pools that have the lowest prices.
LaunchTemplateId lt-bp1ivgo4p5now3px**** The ID of the launch template used to create instances.
LaunchTemplateConfig.1.VSwitchId vsw-bp1ygryo03m39xhsy**** The ID of the vSwitch of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.1.InstanceType ecs.c6e.large The instance type of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.1.WeightedCapacity 1 The weight of the instance type of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.2.VSwitchId vsw-bp16hgf8f3kvtcbyu**** The ID of the vSwitch of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.2.InstanceType ecs.c6e.xlarge The instance type of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.2.WeightedCapacity 1 The weight of the instance type of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.3.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.3.InstanceType ecs.c6e.2xlarge The instance type of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.3.WeightedCapacity 1 The weight of the instance type of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.4.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.4.InstanceType ecs.g6e.xlarge The instance type of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.4.WeightedCapacity 1 The weight of the instance type of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.5.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 5 (Resource Pool 5).
LaunchTemplateConfig.5.InstanceType ecs.g6e.2xlarge The instance type of the extended configuration 5 (Resource Pool 5).
LaunchTemplateConfig.5.WeightedCapacity 1 The weight of the instance type of the extended configuration 5 (Resource Pool 5).

Use a specific resource pool

You can use a specific resource pool to create instances. For example, if you purchase zone-level reserved instances to create ecs.c6e.large instances and to offset the bills of the instances, you can configure an auto provisioning group to create pay-as-you-go instances of the ecs.c6e.large instance type by using a specific resource pool.

You can configure an auto provisioning group to use a specific resource pool only when you call the CreateAutoProvisioningGroup operation to create the auto provisioning group. Make sure that you set the PayAsYouGoAllocationStrategy parameter to prioritized and set the priority of the specified resource pool to 0 (the highest priority). For example, you can make the configurations described in the following table to create an auto provisioning group with the following results:
  • Obtain five resource pools based on the lt-bp1ivgo4p5now3px**** launch template.
  • Set the target capacity to 20 instances, including 10 preemptible instances and 10 pay-as-you-go instances.
  • Use the resource pool corresponding to the ecs.c6e.large instance type to create pay-as-you-go instances by specifying the LaunchTemplateConfig.1 parameter.
Parameter Value Description
TotalTargetCapacity 20 Sets the target capacity to 20 instances.
SpotTargetCapacity 10 Creates 10 preemptible instances.
PayAsYouGoTargetCapacity 10 Creates 10 pay-as-you-go instances.
SpotAllocationStrategy lowest-price Uses the cost optimization policy for preemptible instances.
PayAsYouGoAllocationStrategy prioritized Uses the cost optimization policy for pay-as-you-go instances.
LaunchTemplateId lt-bp1ivgo4p5now3px**** The ID of the launch template used to create instances.
LaunchTemplateConfig.1.VSwitchId vsw-bp1ygryo03m39xhsy**** The ID of the vSwitch of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.1.InstanceType ecs.c6e.large The instance type of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.1.WeightedCapacity 1 The weight of the instance type of the extended configuration 1 (Resource Pool 1).
LaunchTemplateConfig.1.Priority 0 The priority of the extended configuration 1. The value 0 indicates the highest priority.
LaunchTemplateConfig.2.VSwitchId vsw-bp16hgf8f3kvtcbyu**** The ID of the vSwitch of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.2.InstanceType ecs.c6e.xlarge The instance type of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.2.WeightedCapacity 1 The weight of the instance type of the extended configuration 2 (Resource Pool 2).
LaunchTemplateConfig.3.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.3.InstanceType ecs.c6e.2xlarge The instance type of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.3.WeightedCapacity 1 The weight of the instance type of the extended configuration 3 (Resource Pool 3).
LaunchTemplateConfig.4.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.4.InstanceType ecs.g6e.xlarge The instance type of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.4.WeightedCapacity 1 The weight of the instance type of the extended configuration 4 (Resource Pool 4).
LaunchTemplateConfig.5.VSwitchId vsw-bp1oeawdo9tj2gvjp**** The ID of the vSwitch of the extended configuration 5 (Resource Pool 5).
LaunchTemplateConfig.5.InstanceType ecs.g6e.2xlarge The instance type of the extended configuration 5 (Resource Pool 5).
LaunchTemplateConfig.5.WeightedCapacity 1 The weight of the instance type of the extended configuration 5 (Resource Pool 5).