Enterprise Distributed Application Service (EDAS) is seamlessly integrated with instance launch templates. In scenarios such as application creation, scale-out, and auto scaling, you can use an instance launch template to create resources for Elastic Compute Service (ECS) clusters in EDAS. This helps you create resources efficiently.

Introduction

An instance launch template persists ECS instance configurations and helps you create ECS instances. For more information about how to create an instance launch template, see Create a launch template. An instance launch template contains configurations that you can use to create instances. It can include all configurations except for passwords, such as key pairs, RAM roles, instance types, and network configurations. An instance launch template cannot be modified. However, you can create multiple versions of each template and set different parameters for each version. Instance configurations are updated with versions. For more information about how to create another version of the template, see Create a template version. Then, you can create an instance by using any version of the template.

In EDAS, when you create an instance by using an instance launch template or based on existing instance specifications, the instance you create is billed in pay-as-you-go mode. For more information, see Pay-as-you-go. After you release an instance, the billing rules vary with the recycling mode that you select when you create the instance:
  • Release Mode: After an application is scaled in, EDAS automatically releases the instance that is no longer used. You need only to pay for the usage of the instance during its service period.
  • Shutdown and Reclaim Mode: After an application is scaled in, the instance that is no longer used is stopped and is not billed for CPU and memory resources. However, disks such as system disks and data disks, elastic IP addresses (EIPs), and bandwidth are still billed. The public IP address will be recycled and reassigned upon startup, whereas the EIP is retained. You need only to pay a low fee for the storage to retain the instance.

When EDAS directs you to configure the logon credentials for an instance launch template in the ECS console, we recommend that you use an SSH key pair. For more information, see Overview. A key pair is much more secure than a common password because a key pair can prevent brute-force cracking. In addition, it is impossible for others to derive a private key from a public key. In EDAS, for access control between ECS instances or between an ECS instance and a cloud service, we recommend that you use a security group. For more information, see Overview. If you configure a security group when you create an ECS template, the ECS instances that you create by using the template in EDAS belong to the configured security group. Therefore, you can configure security group rules to control access permissions of the created ECS instance.

Prerequisites

An instance launch template is created. For more information, see Create a launch template.
Notice
  • The created instance launch template and your application must be in the same virtual private cloud (VPC). Otherwise, you cannot select the created instance launch template.
  • You must specify a vSwitch for the instance launch template when you select a VPC. Otherwise, the instance launch template cannot be used in EDAS.

Limits

In EDAS, instance launch templates can be used to create instances only for ECS clusters, not for Kubernetes clusters.

Add an instance by using an instance launch template when you create an application

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications.
  3. On the Applications page, select the region in which you want to create an application in the top navigation bar. In the upper part of the page, select the namespace that you want to use. Then, click Create Application in the upper-left corner of the page.
  4. In the Basic Information step, set the Cluster Type, Application Runtime Environment, Application Name, and Application Description parameters, and then click Next. The application description is optional.
    • Cluster Type: Only an ECS cluster allows you to purchase an instance by using an instance launch template. Therefore, select ECS Clusters.
    • Application Runtime Environment: You can select Java, Tomcat, or EDAS-Container (HSF). In this example, EDAS-Container (HSF) is selected.
  5. In the Configurations step, set the Instance Source parameter to Purchase Instance, and then click Next.
    • Environment
      • If you do not have a VPC, namespace, or cluster, EDAS creates a default environment for you.
      • If you have created resources such as VPCs, namespaces, and clusters, a drop-down list is displayed for corresponding resources. You can select a resource from the drop-down list.
    • Instance Source: Select Purchase Instance, and then select Purchase Based on Instance Launch Template for Purchase Method.
      • From the Select a launch template drop-down list, select the template and template version for creating the instance. If no instance launch template is available, you can create a template in the ECS console. For more information, see Create a launch template.
      • Set the Recycling Mode parameter.
      • Quantity: Select the quantity of instances to be purchased, such as 1.
      • Terms of Service: Select Elastic Compute Service Terms of Service | Terms of Service for Images.
  6. In the Advanced Settings step, set the Version and Application Health Check parameters, and then click Create Application. The health check configuration is optional.
    • Version: Enter a version in the format of yyyy-mm-dd hh:mm:ss. You can also enter other version IDs.
    • Application Health Check: optional. You can set the URL for health check, which is used to check whether the application is healthy.
  7. In the Creation Completed step, check information in the Basic Information, Configurations, and Advanced Settings sections, and then click Create Application.

Add an instance by using an instance launch template when you manually scale out an application

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. On the Applications page, click the name of the desired application.
  3. Click an application. On the application details page, click Scale Out in the upper-right corner. In the Add Instance dialog box, set the Target Group parameter in the Scale-out Method step.
  4. Select Purchase Based on Instance Launch Template for the Scale-Out Method parameter.
  5. Select the template and template version, set the Recycling Mode parameter, and then click Next.
    • Use Bound Template: You must bind an instance launch template to the instance group. For more information, see Bind an instance launch template to the group. Then, select the bound template for the scale-out.
    • Use Specified Template: If you have created multiple templates in the ECS console, you need to select a specific template and a version.
  6. In the Purchase Details step, set the Quantity parameter, select Elastic Compute Service Terms of Service | Terms of Service for Images, and then click Next.
  7. In the Confirm step, check the quantity of ECS instances to be purchased and the information about the instance launch template. Verify all the information and click Confirm.
    In the upper part of the page, the Automatic purchasing is triggered. Check the real-time information in the application change process message appears.

Add an instance by using an instance launch template for auto scaling

You can add instances only for auto scaling of High-Speed Service Framework (HSF) applications in ECS clusters.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. On the Applications page, click the name of the desired application.
  3. On the application details page, click Auto Scaling in the left-side navigation pane.
  4. Turn on Scale-out Rule.
  5. Set the scale-out rule parameters and click Save.
    1. Trigger Metrics: Set the thresholds of RT, Load, and CPU. When a threshold is exceeded, a scale-out is triggered.
    2. Trigger Conditions:
      • Any One of the Metrics: A scale-out is triggered when the threshold of a metric is exceeded.
      • All Metrics: A scale-out is triggered only when the thresholds of all metrics are exceeded.
    3. Last for More Than: the duration when the metric continuously reaches the threshold, in minutes. Within the duration, if the average value of a metric every minute continuously reaches the set threshold, a scale-out is triggered. You can configure the duration based on the sensitivity of the cluster service capabilities.
    4. Application Source: Select Elastic Resources.
      • Creation Method: Select Purchase Based on Instance Launch Template.
      • Launch Template: Click Select Template. In the Select a launch template dialog box, select the template and template version, set the Recycling Mode parameter, and then click OK.
      • Terms of Service: Select Elastic Compute Service Terms of Service | Terms of Service for Images.
      • Advanced Options: Turn it on and set the Network Type and Multi-zone Scaling Policy parameters.
        • Network Type: Specify the network in which the application to be scaled out is located, which cannot be changed. If the network is a VPC, you must specify the vSwitch that is connected to the new instance. If you specify multiple vSwitches, EDAS will automatically allocate vSwitches based on the multi-zone scaling policy.
        • Multi-zone Scaling Policy: You can select Priority Policy or Balanced Distribution Policy.
    5. Number of Instances to Add for Each Scale-Out: the number of instances that are automatically added in each scale-out. You can set this parameter based on the service capabilities of a single instance of the application.
    6. Maximum Number of Instances in Group: the maximum number of instances in a cluster. If the maximum number is reached, the scale-out stops. You can set this parameter based on the resource quota.

Verify the result

After you add an instance by using an instance launch template, you can view the number and status of the application instances on the Instance Information tab.

Additional information