Enterprise Distributed Application Service (EDAS) is seamlessly integrated with instance startup templates. In scenarios such as application creation and auto scaling, Elastic Compute Service (ECS) clusters of EDAS allow you to configure an instance startup template as a blueprint for creating resources. This helps improve the efficiency of your resource creation.

Introduction

You can refer to Create a launch template quickly create an ECS instance. An instance startup template can include any configurations except passwords. It can include key pairs, Resource Access Management (RAM) roles, instance type, and network configurations. An instance startup template cannot be modified. However, you can create multiple versions of each template and configure different parameters for each version. Instance configurations updates are shown in version updates. You can create a template version.

In EDAS, when you create an instance by using an instance startup template or based on existing instance specifications, the instance created adopts the Pay-as-you-go mode. When you create an instance, the billing rules after the instance is released vary with the recycling mode you selected:
  • Release: After an application is scaled in, EDAS automatically releases the unused instance. You only need to pay for the usage of the instance during its service period.
  • Shutdown and recycling: After an application is scaled in, the unused instance is stopped and is not billed for CPU and memory resources. However, disks such as system disks and data disks, elastic IP addresses, and bandwidth are still billed. The public IP address will be recycled and reassigned upon startup, while the elastic IP address is retained. You only need to pay a low fee for the storage to retain the instance.

When you configure the logon credentials for an instance startup template in the ECS console, EDAS recommends that you use a Overview. A key pair is much more secure than a common password, which can prevent brute-force cracking. In addition, it is impossible for others to derive a private key from a public key. For access control between ECS instances or between an ECS instance and a cloud product, EDAS recommends that you use a Overview. If you configure a security group when creating an ECS template, the ECS instances that you create by using the template in EDAS will belong to the configured security group. Therefore, you can configure security group rules to control access to the created ECS instance.

Prerequisites

You have Create a launch template in the ECS console.
Notice
  • The created instance startup template and your application must be in the same Virtual Private Cloud (VPC). Otherwise, you cannot select the created instance startup template.
  • You must specify a VSwitch for the instance startup template when selecting a VPC. Otherwise, the instance startup template cannot be used in EDAS.

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

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Application Management > Applications.
  3. On the Applications page, click Create Application in the upper-right corner.
  4. On the Application Information page, select Cluster Type and Application Runtime Environment, enter Application Name and Application Description (optional), and then click Next.
    • Cluster Type: Currently, only an ECS cluster allows you to purchase an instance by using an instance startup template. Therefore, select ECS Cluster.
    • Application Runtime Environment: You can select Java, Tomcat, or EDAS-Container (HSF). In this example, EDAS-Container (HSF) is selected.
  5. On the Application Configuration page, select Deployment Package Source and Demo Type, set Instances to Custom, and then click Next.
    • Environment
      • If you do not have any VPC, namespace, or cluster, EDAS creates a default environment for you.
      • If you have created resources such as VPCs, namespaces, and clusters, you can see a drop-down list of corresponding resources. You can select a resource from the drop-down list.
    • Instances: Select Buy a new instance, and then select Purchase based on instance startup template for Method of Purchase.
      • Select the template and template version for creating the instance from the Select Start Template drop-down list. If no instance startup template is available, you can create a template in the ECS console. For more information, see Create a launch template.
      • Select Recycling Mode.
      • Purchase Quantity: Select the quantity of instances to be purchased, such as 1.
      • Service Agreement: Select ECS Service Terms | Image Service Terms.
  6. On the Apply Advanced Settings page, enter Version and Application Health Check (optional), and then click Create Application.
    • Version: You can click Use Timestamp as Version Number to use the current timestamp as the version number, which is 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. On the Application Creation Complete page, check the application information, application configuration, and advanced settings, and then click Confirm to Create Application.

Add an instance by using an instance startup template for manual scaling

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Application Management > Applications.
  3. Click an application. On the Basic Information page, click Scale Out in the upper-right corner. In the Add an Instance dialog box, set Target Group on the Scale-Out Method tab.
  4. Select Purchase Based on Instance Startup Template for Scale-Out Method.
  5. Select the template and template version, select Recycling Mode, and then click Next.
    • With Binding Template: You must bind an instance startup template to a deployment group. For more information, see Manage instance groups of applications deployed in ECS clusters. Then, select the bound template for scaling.
    • With Specified Template: If you have created multiple templates in the ECS console, you need to select a specific template and version.
  6. On the Purchase Details tab, set Purchase Quantity, select ECS Service Terms | Image Service Terms, and then click Next.
  7. On the Confirm tab, check the quantity of ECS instances that you want purchase and the information about the instance startup template. Verify all the information and click Confirm.
    On the top of the page, the "Automatic purchasing is triggered. Check the real-time information in the application change process." page appears.

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

You can only add instances 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, choose Application Management > Applications, then click an application's name.
  3. On the Application Details page, click Auto Scaling in the upper-right corner.
  4. Enable Scale-Out Rule.
  5. Set the scale-out rule parameters and click Save.
    1. Trigger Indicators: Set the thresholds of RT, Load, and CPU. When the threshold is exceeded, scale-out is triggered.
    2. Trigger Conditions:
      • Any One of the Indicators: Auto scale-out is triggered when the threshold of any metric is exceeded.
      • All Indicators: Auto scale-out is triggered only when the thresholds of all metrics are exceeded.
    3. Last for More Than: indicates 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, auto scale-out is triggered. You can configure the duration based on the sensitivity of the cluster service capabilities.
    4. Application Source: Select Elastic Resources.
      • Building Method: Select Purchase based on instance startup template.
      • Launch Template: Click Select Template. In the Select Start Template dialog box, select the template and template version, select Recycling Mode, and then click OK.
      • Service Agreement: Select ECS Service Terms | Image Service Terms.
      • Advanced Options: Open and set Network Type and Multi-Zone Scaling Policy.
        • Network Type: Specify the network where the application to be scaled out is located, which cannot be changed. If the current network is a VPC, you need to 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 Distribution Balancing Policy.
    5. Number of Instances for Each Scale-Out: indicates the number of instances that are automatically added upon each scale-out. You can configure this parameter based on the service capabilities of a single instance of the application.
    6. Maximum Number of Instances: indicates the maximum number of instances in a cluster. When the maximum number is reached, scale-out stops. You can set this parameter based on the resource quota.

Verify the result

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

References