This topic describes how to create an auto provisioning group in the ECS console. The created group will provision an instance cluster based on your configurations.

Prerequisites

  • Your account is granted permissions on Auto Provisioning.
    Note When you access the Auto Provisioning page for the first time, follow the instructions to assign the AliyunECSAutoProvisioningGroupRole RAM role to your account.
  • A launch template is created. For more information, see Create a launch template.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Deployment & Elasticity > Auto Provisioning.
  3. In the top navigation bar, select a region.
  4. Click Create Auto Provisioning Group.
  5. Configure the parameters in the Capacity Configuration section.
    These parameters determine the total capacity of the auto provisioning group and the capacity ratio of preemptible ECS instances to pay-as-you-go ECS instances. The following table describes the parameters.
    Parameter Description
    Group Name The name of the auto provisioning group. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
    Target Capacity The capacity that the auto provisioning group is scheduled to provision. You can specify this capacity in terms of the number of ECS instances or vCPUs. You can select Use Pay-as-you-go Instances to Provide Computing Power and then specify the capacity of pay-as-you-go ECS instances to be provisioned.
    Pay-as-you-go Instance Capacity The capacity of pay-as-you-go ECS instances that the auto provisioning group is scheduled to provision. You can specify this capacity in terms of the number of ECS instances or vCPUs.
  6. Configure the parameters in the Instance Configuration section.
    These parameters determine the attributes of the ECS instances to be provisioned, such as instance types, images, security groups, networks, and VSwitches. You must specify a launch template as the configuration source. Then, you can add one or more alternative instance configurations to increase the success rate of creating ECS instances.
    1. Configuration Source: Select a launch template and a template version from the drop-down lists.
    2. Instance Configuration: At least one instance configuration is required in the auto provisioning group. You can click Add Instance Configuration to add multiple alternative instance configurations.
      The following table describes the parameters in the Instance Configuration section. These parameters appear only after a launch template and a template version are selected.
      Parameter Description
      Specify VSwitch The VSwitch which to connect to the ECS instances provisioned by the auto provisioning group. You can specify VSwitches from different zones to provide zone redundancy. If ECS instances fail to be created in a zone due to insufficient resources, the auto provisioning group attempts to create ECS instances in other zones. This helps increase the creation success rate.
      Instance Type The alternative instance type. You can specify multiple instance types to improve provisioning flexibility. If ECS instances of an instance type fail to be created due to insufficient resources, the auto provisioning group attempts to create ECS instances of other instance types. This helps increase the creation success rate. You can click Add Instance Type to add alternative instance types.

      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 selected configuration source are provided to facilitate selection. You can also select other instance types.

      Price Limit The maximum hourly price for a preemptible ECS instance of a specific instance type. Before you specify the price, you can click Price History in the Actions corresponding to the instance type to view its price trend. Specify an appropriate hourly price for a preemptible instance of each instance type. Inappropriate prices may result in out-of-control costs or cause a failure to meet the target capacity. You can use one of the following methods to specify a maximum hourly price to bid for preemptible instances of an instance type:
      • Select Automatic Bidding. The real-time market price is used as the maximum hourly price for the bid. This way, preemptible ECS instances will not fail to be created due to a low bid, and the instance costs change with the market price.
      • Choose Set Maximum Price > Maximum Price, and then set a maximum hourly price. This way, preemptible ECS instances fail to be created if your bid is less than the market price, and out-of-control instance costs are prevented.
      • Choose Set Maximum Price > Pay-as-you-go Price, and then set a percentage of the pay-as-you-go price as the maximum hourly price. This way, you can have some savings over pay-as-you-go prices. For example, if you set the percentage to 50%, preemptible ECS instances fail to be created when the market price is higher than 50% of the pay-as-you-go price.
    3. Preemptible Instance Interruption Settings: The action to be taken on preemptible ECS instances when the auto provisioning group scales in.
      The following table describes the options for this parameter.
      Option Description
      Release Preemptible ECS instances are released.
      Stop Instances Preemptible ECS instances are stopped. The auto provisioning group first uses these instances when it scales out.
    4. Provisioning Policy: the policy used to create ECS instances.
      The following table describes the options for this parameter.
      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 ECS instances.
      Note Preemptible ECS instances may be reclaimed due to market price changes or insufficient resources. The lower reclaim rate, the better.
      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 multiple instance configurations.
      Note Preemptible ECS instances are reclaimed based on their instance types, and instance resources in the same instance family are shared. If you select Balanced Distribution Policy, we recommend that you configure instance types from different instance families to prevent instances being reclaimed at the same time and ensure high availability of the instance cluster.
  7. Configure the 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 attempts to create an instance cluster with the target capacity only once. If instances fail to be created, the auto provisioning group makes no attempts to create the instances again.
    • Continuous Delivery and Maintain Capacity: After the auto provisioning group is started, it continuously attempts to create an instance cluster with the target capacity. The auto provisioning group continuously compares the real-time capacity with the target capacity. If a gap exists between the real-time capacity and the target capacity, the auto provisioning group automatically scales in or out 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 unless you delete it.
    • Specify End Time: Specify a 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 all instance types. If the specified maximum hourly price specific to an instance type is different from the global maximum hourly price, the lower one of the two prices is used.
    Instance Shutdown Settings
    • Shut Down Instances Upon Group Expiration: stops instances in the auto provisioning group when it expires.
    • Shut Down Excessive Instances When Target Capacity Is Exceeded: stops the instances that exceed the target capacity in the auto provisioning group.
  8. Click Create Provisioning Group.

Result

After the auto provisioning group is created, it is started and attempts to provision the instance cluster at the specified time. If Continuous Delivery and Maintain Capacity is selected for Group Type, the auto provisioning group continuously maintains the instance cluster. The auto provisioning group attempts to create new instances to meet the target capacity when preemptible instances are reclaimed, and replaces unhealthy instances in a timely manner.