This topic describes how to create an auto provisioning group in the ECS console. The created group will deploy an instance cluster as configured.

Prerequisites

  • Make sure the user account is granted permissions on auto provisioning. When you access the auto provisioning page for the first time, follow the instructions to assign the user account the RAM role of AliyunECSAutoProvisioningGroupRole.
  • A launch template is already created. For more information, see Create a template.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Deployment & Elasticity > Auto Provisioning.
  3. In the upper-left corner, select the target region.


  4. Click Create Auto Provisioning Group.
    To learn about the configurations of an auto provisioning group, see Procedure to configure an auto provisioning group.
  5. Configure the auto provisioning group.
    1. Configure the basic information.
      Parameter Description
      Group Name The name of the auto provisioning group. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
      Group Type
      • One-time Delivery: After being started, the auto provisioning group attempts to create an instance cluster with a specified capacity for only one time. If the creation fails, the group does not attempt again.
      • Continuous Delivery and Maintain Capacity: After being started, the auto provisioning group continuously attempts to create an instance cluster of a specified capacity. The auto provisioning group continuously compares the real-time capacity and target capacity. If there is a gap, the group will attempt to create instances to meet the target capacity.
      Effective 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 Expiration Time is the effective time period of the auto provisioning group.
      • Now: The auto provisioning group immediately executes scheduling tasks after it is created.
      • The scheduled time at which the auto provisioning group takes effect and executes scheduling tasks.
      Expiration 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 Effective Time is the effective time period of the auto provisioning group.
      • Never: The auto provisioning group will never expire.
      • The scheduled time at which the auto provisioning group expires.
    2. Specify the capacity of the auto provisioning group.
      Parameter Description
      Target Capacity The total capacity of the instance cluster, which consists of the following three parts:
      • The capacity of preemptible instances.
      • The capacity of pay-as-you-go instances.
      • The supplemental capacity. The Default Billing Method of Supplemental Instances parameter determines the type of instances to supplement when fulfilling the target capacity.
      Target Capacity of Preemptible Instances The part of Target Capacity that preemptible instances account for.
      Target Capacity of Pay-As-You-Go Instances The part of Target Capacity that pay-as-you-go instances account for.
  6. Click Next: Template Configurations.
  7. Configure the template parameters.
    The template configurations include specifying a launch template and making extended configurations that are used to determine alternative instance types. The launch template and extended configurations are associated with the auto provisioning group. After the auto provisioning group is started, the instance types created are determined by Capacity-related Settings.
    1. Select a launch template.
      Specify a launch template and its version. For more information, see Launch templates.

      You can also click View Template to view the launch template information.

    2. Make the extended configurations.
      The launch template only specifies one instance type. You can specify more alternative instance types through the extended configurations. To improve the success rate of scheduling, you must specify at least one extended launch template.
      Parameter Description
      Zone A zone different from that specified in the launch template. This parameter and the VSwitch parameter determine the location of the alternative instance types.
      VSwitch A VSwitch different from that specified in the launch template. This parameter and the Zone parameter determine the location of the alternative instance types.
      Instance Type You can select instance types that share the same instance type family, vCPU, or memory. This allows for more flexibility in scheduling by providing multiple alternative instance types that can be applied to the same scenario.
      Maximum Price The maximum price for created instances with specified types. If the specified maximum price of an instance types is different from the global maximum price, the maximum price is the lower value out of the two.
      Capacity Weight The weight is calculated based on the computing power of a specified instance type and the minimum computing power of a single node of the cluster. A greater weight indicates that the instance has more computing power, and as a result fewer instances are required. For example, when the minimum computing power of a single node is 8 vCPUs and 60 GiB of memory, the weight of the instance type with 8 vCPUs and 60 GiB of memory is 1, and the weight of the instance type with 16 vCPUs and 120 GiB of memory is 2.
      Priority This parameter is used together with the Priority-based policy for creating pay-as-you-go instances. A value of 0 indicates the highest priority. As the value of this parameter increases, the priority decreases. When creating pay-as-you-go instances, the auto provisioning group selects the instance types in descending order of priority.
    3. Click Save.
    4. Configure the capacity-related settings.
      Capacity-related Settings is a set of scheduling policies that the auto provisioning group uses to execute scheduling tasks and deploy the instance cluster with a specified capacity. The instance types of the cluster are specified in Template configurations.
      Parameter Description
      Default Billing Method of Supplemental Instances If the total target capacity of preemptible instances and Pay-As-You-Go instances is less than the capacity of the instance cluster, the auto provisioning group will create instances of the specified type to meet the capacity requirements.
      Policy for Creating Pay-As-You-Go Instances The policy followed when you create Pay-As-You-Go instances. Options:
      • Cost Optimization: Select the instance type of the lowest cost from the alternative instance types.
      • Priority-based: Create instances based on the specified priority. When this option is selected, you must specify the priority in the Extended Configurations area in the next step. For more information, see Template configurations.
        Note If you use a reserved instance to match instances, we recommend that you select the Priority-based policy and set a higher priority for the types of matching instances. After the instances are matched, the reserved instance discount is automatically applied to the created Pay-As-You-Go instances. For more information, see Matching rules of Reserved Instances.
      Policy for Creating Preemptible Instances The scale-out policy followed when you create preemptible instances. Options:
      • Cost Optimization: Select the instance type of the lowest cost from the alternative instance types. When this option is selected, you can set Instance Types Allowed by Cost Optimization Policy to specify the allowed number of instance types. The instance types of the lowest cost are used.
      • Distribution Balancing: Select this option to evenly create instances across zones where you can purchase alternative instance types.
        Note Preemptible instances are reclaimed based on instance types, and instance resources in the same instance family are shared. If you select Distribution Balancing, we recommend that you configure different instance families to avoid all instances being reclaimed at the same time and ensure the cluster remains highly available.
      Instance Types Allowed by Cost Optimization Policy Used together with the Cost Optimization policy for creating preemptible instances, the auto provisioning group will create preemptible instances by using the specified number of instance types of the lowest cost.
      Shutdown Policy for Preemptible Instances The action to be performed on preemptible instances when the auto provisioning group expires or exceeds the target capacity. This parameter must be used together with the Shut Down Instances Upon Group Expiration and Shut Down Excess Instances When Target Capacity Is Exceeded parameters. Options:
      • Stop: Preemptible instances are stopped and their data is retained.
      • Release: Preemptible instances are released and their data is not retained. Released data cannot be recovered.
      Global Maximum Price for Preemptible Instances The maximum price of created preemptible instances. This parameter applies to all instance types. If the specified maximum price of an instance type is different from the global maximum price, the maximum price is the lower value out of the two.
      Shut Down Instances Upon Group Expiration The policy followed when the auto provisioning group expires. When this option is selected, the auto provisioning group will stop or release the instances based on Shutdown Policy for Preemptible Instances after expiration.
      Shut Down Excess Instances When Target Capacity Is Exceeded The policy followed when the capacity of instances in the auto provisioning group exceeds the target capacity. When this option is selected, the auto provisioning group will stop or release the instances based on Shutdown Policy for Preemptible Instances when the target capacity is exceeded.
  8. Click Next: Preview.
  9. Confirm the configurations of the auto provisioning group and template, and click Create.

Result

After an auto provisioning group is created, it will start and attempt to deliver the instance cluster at the specified time. If Continuous Delivery and Maintain Capacity is selected, the auto provisioning group will continuously maintain the instance cluster. When preemptible instances are reclaimed, the auto provisioning group will attempt to create new instances to meet the target capacity and replace unhealthy instances.