102
Auto Scaling User Guide Date 2021-10-20

User Guide - docs.otc.t-systems.com

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

Page 1: User Guide - docs.otc.t-systems.com

Auto Scaling

User Guide

Date 2021-10-20

Page 2: User Guide - docs.otc.t-systems.com

Contents

1 Service Overview..................................................................................................................... 11.1 What Is Auto Scaling?............................................................................................................................................................11.2 AS Advantages......................................................................................................................................................................... 21.3 Instance Lifecycle.....................................................................................................................................................................71.4 Use Restrictions..................................................................................................................................................................... 101.5 AS and Other Services......................................................................................................................................................... 121.6 User Permissions................................................................................................................................................................... 141.7 Basic Concepts....................................................................................................................................................................... 14

2 Best Practices......................................................................................................................... 172.1 Setting Up an Automatically Scalable Discuz! Forum..............................................................................................17

3 Quick Start.............................................................................................................................. 203.1 Wizard-based Process of Using AS................................................................................................................................. 203.2 Creating an AS Group Quickly..........................................................................................................................................20

4 AS Management.................................................................................................................... 284.1 AS Group.................................................................................................................................................................................. 284.1.1 Creating an AS Group...................................................................................................................................................... 284.1.2 (Optional) Adding a Load Balancer to an AS Group............................................................................................ 344.1.3 Changing the AS Configuration for an AS Group.................................................................................................. 344.1.4 Enabling an AS Group......................................................................................................................................................354.1.5 Disabling an AS Group.................................................................................................................................................... 364.1.6 Modifying an AS Group................................................................................................................................................... 374.1.7 Deleting an AS Group...................................................................................................................................................... 374.2 AS Configuration................................................................................................................................................................... 384.2.1 Creating an AS Configuration....................................................................................................................................... 384.2.2 Creating an AS Configuration from an Existing ECS Instance........................................................................... 384.2.3 Creating an AS Configuration from a New Specifications Template...............................................................404.2.4 Copying an AS Configuration........................................................................................................................................ 464.2.5 Deleting an AS Configuration....................................................................................................................................... 474.3 AS Policy...................................................................................................................................................................................474.3.1 Overview...............................................................................................................................................................................474.3.2 Creating an AS Policy....................................................................................................................................................... 484.3.3 Managing AS Policies....................................................................................................................................................... 55

Auto ScalingUser Guide Contents

2021-10-20 ii

Page 3: User Guide - docs.otc.t-systems.com

4.4 Scaling Action.........................................................................................................................................................................564.4.1 Dynamic Scaling................................................................................................................................................................ 564.4.2 Scheduled Scaling..............................................................................................................................................................574.4.3 Manual Scaling...................................................................................................................................................................574.4.4 Configuring an Instance Removal Policy................................................................................................................... 584.4.5 Viewing a Scaling Action................................................................................................................................................ 594.4.6 Configuring Instance Protection................................................................................................................................... 604.5 Bandwidth Scaling................................................................................................................................................................ 614.5.1 Creating a Bandwidth Scaling Policy.......................................................................................................................... 614.5.2 Viewing Details About a Bandwidth Scaling Policy...............................................................................................654.5.3 Managing a Bandwidth Scaling Policy.......................................................................................................................654.6 AS Group and Instance Monitoring................................................................................................................................ 674.6.1 Health Check....................................................................................................................................................................... 674.6.2 Recording AS Resource Operations............................................................................................................................. 684.6.3 Adding Tags to AS Groups and Instances................................................................................................................. 714.6.4 Monitoring Metrics........................................................................................................................................................... 734.6.5 Viewing Monitoring Metrics.......................................................................................................................................... 754.6.6 Setting Monitoring Alarm Rules...................................................................................................................................76

5 FAQs..........................................................................................................................................785.1 General..................................................................................................................................................................................... 785.1.1 What Are Restrictions on Using AS?........................................................................................................................... 785.1.2 Are ELB and Cloud Eye Mandatory for AS?..............................................................................................................795.1.3 Does an Abrupt Change on Monitoring Indicator Values Cause an Incorrect Scaling Action?..............795.1.4 How Many AS Policies and AS Configurations Can I Create and Use?.......................................................... 795.1.5 Can AS Automatically Scale Up or Down vCPUs, Memory, and Bandwidth of ECSs?...............................805.1.6 What Is the AS Quota?.................................................................................................................................................... 805.1.7 What Can I Do If a Message Displayed Indicating that the Key Pair Does Not Exist When I Connectto an Instance?..............................................................................................................................................................................805.2 AS Group.................................................................................................................................................................................. 805.2.1 What Can I Do If the AS Group Fails to Be Enabled?........................................................................................... 805.2.2 How Can I Handle an AS Group Exception?............................................................................................................ 815.2.3 What Operation Will Be Suspended After an AS Group Is Disabled?.............................................................825.2.4 Can I Use an ECS ID to Obtain the AS Group Accommodating the ECS?......................................................825.3 AS Policy...................................................................................................................................................................................835.3.1 How Many AS Policies Can Be Enabled?...................................................................................................................835.3.2 What Are the Conditions to Trigger an Alarm in the AS Policy?...................................................................... 835.3.3 What Is a Cooldown Period? Why Is It Required?..................................................................................................835.3.4 What Monitoring Metrics for an AS Group Will Be Affected If OTC Tools Are Not Installed on ECSs?............................................................................................................................................................................................................ 845.3.5 What Can I Do If an AS Policy Fails to Be Enabled?............................................................................................. 845.4 Instance.................................................................................................................................................................................... 845.4.1 How Do I Prevent Instances Manually Added to an AS Group from Being Removed Automatically?............................................................................................................................................................................................................ 84

Auto ScalingUser Guide Contents

2021-10-20 iii

Page 4: User Guide - docs.otc.t-systems.com

5.4.2 Will the Application Data on an Instance Be Retained After the Instance Is Removed from an ASGroup and Deleted?.................................................................................................................................................................... 855.4.3 Can Instances that Have Been Added Based on an AS Policy Be Automatically Deleted When TheyAre No Longer Needed?............................................................................................................................................................ 855.4.4 What Is the Expected Number of Instances?...........................................................................................................855.4.5 How Do I Delete an ECS Created in a Scaling Action?.........................................................................................865.4.6 How Should I Handle Unhealthy Instances in an AS Group?............................................................................ 875.4.7 What Can I Do If Instances in an AS Group Frequently Fail in Health Checks and Are Deleted andThen Created Repeatedly?........................................................................................................................................................ 875.4.8 How Do I Prevent Instances from Being Removed from an AS Group Automatically?............................875.4.9 Why Is an Instance Removed and Deleted from an AS Group Still Displayed in the ECS List?.............885.5 Others....................................................................................................................................................................................... 885.5.1 How Can I Automatically Deploy My Application on an Instance?................................................................. 885.5.2 Why Cannot I Use a Key File to Log In to an ECS?................................................................................................895.5.3 Do I Need to Configure an EIP in an AS Configuration When a Load Balancer Has Been Enabled inan AS Group?................................................................................................................................................................................. 895.5.4 How Can I Enable Automatic Initialization of EVS Disks of Instances that Have Been Added in aScaling Action to an AS Group?.............................................................................................................................................. 89

A Change History...................................................................................................................... 93

B Glossary................................................................................................................................... 98

Auto ScalingUser Guide Contents

2021-10-20 iv

Page 5: User Guide - docs.otc.t-systems.com

1 Service Overview

1.1 What Is Auto Scaling?

AS Introduction

Auto Scaling (AS) automatically adjusts Elastic Cloud Server (ECS) and bandwidthresources to keep up with changes in demand based on pre-configured AS policies.When service demands increase, AS scales out ECS or bandwidth resources toensure stable service capabilities. When service demands decrease, AS scales inECS or bandwidth resources to reduce costs.

Architecture

AS allows you to adjust the number of ECSs in an AS group and bandwidths.

● Scaling control: You can configure AS policies, configure metric thresholds,and schedule when different scaling actions are taken. AS will trigger scalingactions on a repeating schedule, at a specific time, or when the configuredthresholds are reached.

● Policy configuration: You can configure alarm-based, scheduled, and periodicpolicies as needed.

● Alarm-based: You can configure scaling action to be taken when alarmmetrics such as vCPU, memory, disk, and inbound traffic reaches thethresholds.

● Scheduled: You can schedule scaling actions to be taken at a specific time.

● Periodic: You can configure scaling actions to be taken at scheduled intervals,a specific time, or within a particular time range.

● When Cloud Eye generates an alarm for a monitoring metric, for example,CPU usage, AS automatically increases or decreases the number of instancesin the AS group or the EIP bandwidth.

● When the configured triggering time arrives, a scaling action is triggered toincrease or decrease the number of ECS instances or the bandwidth.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 1

Page 6: User Guide - docs.otc.t-systems.com

Figure 1-1 AS architecture

Access MethodsThe public cloud provides a web-based service management platform. You canaccess AS using HTTPS-compliant application programming interfaces (APIs) orthe management console.

● Calling APIsUse this method if you are required to integrate the AS service on the publiccloud into a third-party system for secondary development. For details, see Auto Scaling API Reference.

● Management consoleUse this method if you do not need to integrate AS with a third-party system.After registering on the public cloud, log in to the management console andselect Auto Scaling from the service list on the homepage.

1.2 AS AdvantagesAS automatically adjusts resources to keep up with service demands based on pre-configured AS policies. It enables automatic scaling of resources, reduces costs,

Auto ScalingUser Guide 1 Service Overview

2021-10-20 2

Page 7: User Guide - docs.otc.t-systems.com

improves availability, and ensures high fault tolerance. AS is used for followingscenarios:

● Heavy-traffic forums: The traffic on a popular forum is difficult to predict. ASdynamically adjusts the number of ECS instances based on monitored ECSmetrics, such as vCPU and memory usage.

● E-commerce: During big promotions, E-commerce websites need moreresources. AS automatically increases ECS instances and bandwidths withinminutes to ensure that promotions go smoothly.

● Live streaming: A live streaming website may broadcast popular programsfrom 14:00 to 16:00 every day. AS automatically scales out ECS andbandwidth resources during this period to ensure a smooth viewer experience.

Automatic Resource ScalingAS adds ECS instances and increases bandwidths for your applications when theaccess volume increases and removes unneeded resources when the access volumedrops, ensuring system stability and availability.

● Scaling ECS Instances on DemandAS adjusts ECS instances for an application system based on demand,improving cost management. ECS instances can be scaled dynamically, on aschedule, or manually:– Dynamic scaling

AS adjusts resources using alarm-based policies. For details, see DynamicScaling.

– Scheduled scalingAS adjusts resources using periodic or scheduled policies. For details, seeScheduled Scaling.

– Manual scalingYou can manually change the expected number of instances of an ASgroup, or add or remove instances to or from the AS group. For details,see Manual Scaling.

Consider a train ticket booking application running on the public cloud. Theload of the application may be relatively low during Q2 and Q3 because thereare not many travelers, but relatively high during Q1 and Q4. One commonsolution is to provision servers according to the maximum or average load ofthe application, as shown in Figure 1-2 and Figure 1-3. However, this maywaste resources or be unable to meet demand during peak seasons. If youenable AS for the application, AS automatically adjusts the number of serversto keep up with changes in demand. This allows the application to maintainsteady, predictable performance without wasting money on any unnecessaryresources, as shown in Figure 1-4.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 3

Page 8: User Guide - docs.otc.t-systems.com

Figure 1-2 Over-provisioned servers

Figure 1-3 Insufficient servers

Figure 1-4 Auto-scaled capacity

● Scaling Bandwidth on DemandAS adjusts bandwidth for an application system based on demand, reducingbandwidth costs.There are three types of scaling policies you can use to adjust the IPbandwidth on demand:– Alarm-based policies

You can configure triggers based on metrics such as outbound traffic andbandwidth. When the system detects that the triggering conditions aremet, the system automatically adjusts the bandwidth.

– Scheduled policiesThe system automatically increases, decreases, or adjusts the bandwidthto a fixed value on a fixed schedule.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 4

Page 9: User Guide - docs.otc.t-systems.com

– Periodic policiesThe system periodically adjusts the bandwidth based on a configuredperiodic cycle.

For example, you could use an alarm-based policy to regulate the bandwidthfor a live streaming website.For a live streaming website, service loads are difficult to predict. In thisexample, the bandwidth needs to be dynamically adjusted between 10 Mbit/sand 30 Mbit/s based on metrics such as outbound traffic and inbound traffic.AS can automatically adjust the bandwidth to meet requirements. You justneed to select the relevant EIP and create two alarm policies. One policy is toadd 2 Mbit/s when the outbound traffic is greater than X bytes, with the limitset to 30 Mbit/s. The other policy is to reduce 2 Mbit/s when the outboundtraffic is less than X bytes, with the limit set to 10 Mbit/s.

● Evenly Distributing Instances by AZInstances can be evenly distributed across different AZs to reduce the impactof power or network outage on system stability.A region is a geographic area where resources used by your ECSs are located.Each region contains multiple AZs where resources use independent powersupplies and networks. AZs are physically isolated from one another butinterconnected through an intranet. Each AZ provides cost-effective, low-latency network connections that are unaffected by faults in other AZs.An AS group can contain ECS instances from one or more AZs in a region. Toadjust resources, AS evenly distributes ECS instances across AZs based on thefollowing rules:Evenly distributing new instances to balanced AZsAS can evenly distribute ECS instances across the AZs used by an AS group. Todo it, AS moves new instances to the AZs with the fewest instances.For example, if four instances are evenly distributed in two AZs used by an ASgroup, and a scaling action is triggered to add four more instances to the ASgroup, AS adds two to each AZ.

Figure 1-5 Evenly distributing instances

Auto ScalingUser Guide 1 Service Overview

2021-10-20 5

Page 10: User Guide - docs.otc.t-systems.com

Re-balancing instances across AZsThe load of an AZ may become unbalanced after you have manually added orremoved instances to or from an AS group. The next scaling action willpreferentially re-balance the instances in the AZs.For example, if three instances in an AS group are distributed across AZ 1 andAZ 2, with two in AZ 1 and one in AZ 2, when a scaling action is triggered toadd five more instances to the AS group, AS adds two to AZ 1 and three to AZ2.

Figure 1-6 Re-balancing instances

Enhanced Cost Management

AS enables you to use instances and bandwidth on demand by automaticallyadjusting resources in the system, eliminating wasted resources and reducingcosts.

Higher Availability

AS ensures there are proper resources deployed for your applications.

Using ELB with AS

Working with ELB, AS automatically scales ECS instances based on changes indemand while ensuring that the load of all the instances in an AS group staysbalanced.

After ELB is enabled in an AS group, AS automatically associates a load balancinglistener with any instances added to the AS group. Then, ELB automaticallydistributes traffic to all instances in the AS group through the listener, whichimproves system availability. If the instances in the AS group are running a rangeof different types of applications, you can bind multiple load balancing listeners tothe AS group to listen to each of these applications, improving service scalability.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 6

Page 11: User Guide - docs.otc.t-systems.com

High Fault Tolerance

AS monitors instances in an AS group, and replaces any unhealthy instances itdetects. In addition, AS evenly distributes instances across AZs to ensure systemstability.

1.3 Instance LifecycleAn ECS instance transitions through different statues from the moment it iscreated to its removal.

The instance status changes as shown in Figure 1-7 if you have not added alifecycle hook to the AS group.

Figure 1-7 Instance lifecycle

In trigger conditions 2 and 4, a scaling action is automatically triggered to changethe instance status.

Table 1-1 Instance status

Status Sub-status Status Description Trigger Condition

Initial N/A The instance has notbeen added to an ASgroup.

The status of an instance ischanged to Adding to ASgroup when either of thefollowing occurs:● You manually change

the expected number ofinstances or the systemautomatically addsinstances to an ASgroup in a scalingaction.

● You manually addinstances to the ASgroup.

Adding toAS group

Add aninstance.

When trigger condition1 is met, AS adds theinstance to expand theAS group capacity.

(Optional)Associatetheinstancewith a loadbalancinglistener.

When trigger condition1 is met, AS associatesthe created instancewith the load balancinglistener.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 7

Page 12: User Guide - docs.otc.t-systems.com

Status Sub-status Status Description Trigger Condition

Enabled N/A The instance is addedto the AS group andstarts to process servicetraffic.

The instance status ischanged from Enabled toRemoving from AS groupwhen any of the followingoccurs:● You manually change

the expected number ofinstances or the systemautomatically removesinstances in a scalingaction.

● A health check showsthat an enabledinstance is unhealthy, sothe instance is removedfrom the AS group.

● You manually removean instance from an ASgroup.

Removingfrom ASgroup

(Optional)Disassociate theinstancefrom theloadbalancinglistener.

When trigger condition3 is met, the AS groupstarts to reduceresources anddisassociate theinstance from the loadbalancing listener.

Remove theinstance.

After the instance isunbound from the loadbalancing listener, it isremoved from the ASgroup.

Removed N/A The instance lifecycle inthe AS group ends.

N/A

Instances are added to an AS group manually or through a scaling action. Then,they go through the Adding to AS group, Enabled, and Removing from ASgroup statuses, and are finally removed from the AS group.

If you have added a lifecycle hook to the AS group, the instance statues change asshown in Figure 1-8. When the AS group is performing a scaling action, instancesare suspended by the lifecycle hook and remain in the waiting state until thetimeout period ends or the user manually calls back the instances. You canperform desired operations during the waiting period. For example, you can installor configure software on a newly added instance or download log files from aninstance before it is removed.

Figure 1-8 Instance lifecycle

Auto ScalingUser Guide 1 Service Overview

2021-10-20 8

Page 13: User Guide - docs.otc.t-systems.com

In trigger conditions 2, 4, 6, and 8, a scaling action is automatically triggered tochange the instance status.

Table 1-2 Instance status

Status Sub-status Status Description Trigger Description

Initial N/A The instance has notbeen added to an ASgroup.

The status of an instanceis changed to Adding toAS group when either ofthe following occurs:● You manually change

the expected number ofinstances or the systemautomatically addsinstances to an ASgroup in a scalingaction.

● You manually addinstances to the ASgroup.

Adding toAS group

Add aninstance.

When triggercondition 1 is met, ASadds the instance toexpand the AS groupcapacity.

Wait(Adding toAS group)

N/A The lifecycle hooksuspends the instancethat is being added tothe AS group and setsthe instance to be inwaiting state.

The instance status ischanged from Wait(Adding to AS group) toAdding to AS group wheneither of the followingoperations is performed:● The default callback

action is performed.● You manually perform

the callback action.

Adding toAS group

(Optional)Associatethe instancewith a loadbalancinglistener.

When triggercondition 3 is met, ASassociates theinstance with the loadbalancing listener.

Enabled N/A The instance is addedto the AS group andstarts to processservice traffic.

The instance status ischanged from Enabled toRemoving from AS groupwhen any of the followingoccurs:● You manually change

the expected number ofinstances or the systemautomatically removesinstances in a scalingaction.

● A health check showsthat an enabledinstance is unhealthy,so the instance is

Auto ScalingUser Guide 1 Service Overview

2021-10-20 9

Page 14: User Guide - docs.otc.t-systems.com

Status Sub-status Status Description Trigger Description

Removingfrom ASgroup

(Optional)Disassociatethe instancefrom theloadbalancinglistener.

When triggercondition 5 is met,the AS group starts toreduce resources anddisassociate theinstance from theload balancinglistener.

removed from the ASgroup.

● You manually removean instance from an ASgroup.

Wait(Removingfrom ASgroup)

N/A The lifecycle hooksuspends the instancethat is being removedfrom the AS groupand sets the instanceto be in waiting state.

The instance status ischanged from Wait(Removing from ASgroup) to Removing fromAS group when either ofthe following occurs:● The default callback

action is performed.● You manually perform

the callback action.

Removingfrom ASgroup

Remove theinstance.

When triggercondition 7 is met, ASremoves the instancefrom the AS group.

Removed N/A The instance lifecyclein the AS group ends.

N/A

Instances are added to an AS group manually or through a scaling action. Then,they go through the Adding to AS group, Wait (Adding to AS group), Adding toAS group, Enabled, Removing from AS group, Wait (Removing from the ASgroup), and Removing from AS group and are finally removed from the ASgroup.

1.4 Use RestrictionsAS has the following restrictions:

● Only applications that are stateless and can be horizontally scaled can run oninstances in an AS group.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 10

Page 15: User Guide - docs.otc.t-systems.com

NO TE

● A stateless process or application can be understood in isolation. There is no storedknowledge of or reference to past transactions. Each transaction is made as if fromscratch for the first time.

ECSs where are stateless applications running do not store data that needs to bepersisted locally.

Think of stateless transactions as a vending machine: a single request and aresponse.

● Stateful applications and processes, however, are those that can be returned toagain and again. They are performed with the context of previous transactions andthe current transaction may be affected by what happened during previoustransactions.

ECSs where stateful applications are running store data that needs to be persistedlocally.

You can think of stateful transactions as online banking or e-mail, which areperformed with the context of previous transactions.

● AS releases ECS instances automatically, so the instances in AS groups cannotbe used to save application status information (such as session statuses) orrelated data (such as database data and logs). If the application status orrelated data must be saved, you can store the information on separateservers.

● AS does not support capacity expansion or deduction of instance vCPUs andmemory.

● AS requires authentication provided by Identity and Access Management(IAM).AutoScaling Administrator requires permissions of Tenant Guest, ServerAdministrator, CES Administrator, and ELB Administrator.

NO TE

If the Cloud Eye administrator is not available, you can only use an existing alarm tocreate an alarm policy. If the ELB administrator is not available, you can still useexisting load balancers.

● AS resources must comply with quota requirements listed in Table 1-3.

Table 1-3 Quotas

Item Description Default

AS group Maximum number of AS groups per region peraccount

25

ASconfiguration

Maximum number of AS configurations perregion per account

100

AS policy Maximum number of AS policies per AS group 50

Instance Maximum number of instances per AS group 200

Bandwidthscalingpolicy

Maximum number of bandwidth scalingpolicies per region per account

50

Auto ScalingUser Guide 1 Service Overview

2021-10-20 11

Page 16: User Guide - docs.otc.t-systems.com

1.5 AS and Other ServicesAS can work with other cloud services to meet your requirements for differentscenarios.

Figure 1-9 shows the relationships between AS and other services.

Figure 1-9 Relationships between AS and other services

Auto ScalingUser Guide 1 Service Overview

2021-10-20 12

Page 17: User Guide - docs.otc.t-systems.com

Table 1-4 Related services

ServiceName

Description Function Reference

ElasticLoadBalancing(ELB)

After ELB isconfigured, ASautomaticallyassociates ECSinstances to aload balancerlistener whenadding ECSs, andunbinds themwhen removingthe instances.For AS to workwith ELB, the ASgroup and loadbalancer must bein the same VPC.

AS distributestraffic to all ECSsin an AS group.

(Optional) Adding a LoadBalancer to an AS Group

Cloud Eye If an alarm-triggered policyis configured, AStriggers scalingactions when analarm conditionspecified inCloud Eye is met.

AS scalesresources basedon ECS instancestatus monitoredby Cloud Eye.

AS Metrics

ElasticCloudServer(ECS)

ECS instancesadded in ascaling actioncan be managedand maintainedon the ECSconsole.

AS automaticallyadjusts thenumber of ECSinstances.

Dynamically ExpandingResources and ScheduledScaling

VirtualPrivateCloud(VPC)

AS automaticallyadjusts thebandwidths ofEIPs assigned inVPCs and alsosharedbandwidths.

AS automaticallyadjusts thebandwidth.

Creating a BandwidthScaling Policy

CloudTraceService(CTS)

With CTS, youcan record ASoperation logsfor view, audit,andbacktracking.

Log audit Recording AS ResourceOperations

Auto ScalingUser Guide 1 Service Overview

2021-10-20 13

Page 18: User Guide - docs.otc.t-systems.com

ServiceName

Description Function Reference

TagManagement Service(TMS)

If you havemultipleresources of thesame type, TMSenables you tomanage theseresources moreeasily.

Tags Marking AS Groups andInstances

RelationalDatabaseService(RDS)

The prerequisitesfor directlyaccessing an RDSDB instance froma scaled instanceare as follows:● The scaled

instance andthedestinationRDS DBinstance mustbe in thesame VPC.

● The scaledinstance mustbe allowed bythe securitygroup toaccess RDSDB instances.

The scaledinstances canaccess RDS DBinstances.

Connecting to a DBInstance Through a PrivateNetwork

1.6 User PermissionsTwo types of user permissions are provided by default: user management andresource management. User management refers to the management of users,user groups, and user group rights. Resource management refers to the controloperations that can be performed by users on cloud service resources.

For further details, see Permissions.

1.7 Basic Concepts

AS Group

An AS group consists of a collection of instances that apply to the same scenario.It is the basis for enabling or disabling AS policies and performing scaling actions.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 14

Page 19: User Guide - docs.otc.t-systems.com

AS ConfigurationAn AS configuration is a template specifying specifications for the instances to beadded to an AS group. The specifications include the ECS type, vCPUs, memory,image, and disk.

AS PolicyAS policies can trigger scaling actions to adjust the number of instances in an ASgroup. An AS policy defines the condition to trigger a scaling action and theoperation to be performed in a scaling action. When the triggering condition ismet, the system automatically triggers a scaling action.

Scaling ActionA scaling action adds instances to or removes instances from an AS group. Itensures that the number of instances in the application system is the same as theexpected number of instances.

Cooldown PeriodTo prevent an alarm-based policy from being triggered repeatedly by the sameevent, configure a cooldown period. A cooldown period specifies how long anyalarm-triggered scaling action will be disallowed after a previous scaling action iscomplete. This cooldown period does not apply to scheduled or periodic scalingactions.

For example, if you set the cooldown period to 300 seconds (5 minutes), and thereis scaling action scheduled for 10:32, but a previous scaling action was triggered at10:30, any alarm-triggered scaling actions will be denied during the cooldownperiod from 10:30 to 10:35, but scheduled scaling actions will still be triggered at10:32. If the scheduled scaling action ends at 10:36, a new cooldown period startsfrom 10:36 and ends at 10:41.

Bandwidth ScalingAS automatically adjusts the bandwidth based on the bandwidth scaling policyyou configured.

You can create an AS bandwidth policy based on your service requirements. Whenthe trigger condition is met, the AS service automatically increases, decreases, orset the bandwidth to a specified value based on the action you configured. Threetypes of bandwidth scaling policies are available, including the alarm, scheduled,and periodic policy.

RegionA region is a geographic area where the resources used by AS are located.

AZs in the same region can communicate with each other over an intranet, butAZs in different regions cannot.

Cloud data centers are deployed in locations around the world, including Europeand Asia, and AS applies to different regions. Deploying AS in different regionsallows you to tailor policies to better suit your requirements. For example,

Auto ScalingUser Guide 1 Service Overview

2021-10-20 15

Page 20: User Guide - docs.otc.t-systems.com

applications can be designed to meet user requirements in specific regions orcomply with local laws or regulations.

ProjectA project is used to group and isolate OpenStack resources, including compute,storage, and network resources. A project can be a department or a project team.Multiple projects can be created under one account.

Auto ScalingUser Guide 1 Service Overview

2021-10-20 16

Page 21: User Guide - docs.otc.t-systems.com

2 Best Practices

2.1 Setting Up an Automatically Scalable Discuz!Forum

Overview

AS automatically adds instances to an AS group for applications and removesunneeded ones on demand. You do not need to prepare a large number of extraECS instances for an expected marketing activity or unexpected peak hours. Byeliminating the need to deploy those extra instances, AS ensures system reliabilityand reduces your operating costs.

This section describes how to use services, such as AS, ECS, ELB, and VPC to deploya web service that can be automatically scaled in and out, for example, a Discuz!forum.

Prerequisites1. A VPC, subnet, security group, and EIP are available.

2. A load balancer and listener have been created. The VPC obtained in 1 isselected during the load balancer creation.

Auto ScalingUser Guide 2 Best Practices

2021-10-20 17

Page 22: User Guide - docs.otc.t-systems.com

Procedure

Create an ECS and install a MySQL database.

You can create a relational database using the Relational Database Service (RDS)service provided by the cloud platform, or create an ECS and install the databasethere. In this section, we will install a MySQL database on a newly created ECS.

1. Use the created VPC, security group, and EIP for the ECS you create. Forinstructions about how to create an ECS, see Elastic Cloud Server User Guide.

2. When the status of the ECS changes to Running, use Xftp or Xshell to log into the ECS through its EIP, and install and configure a MySQL database.

Create an ECS and deploy a Discuz! forum on it.

1. Create an ECS but do not bind an EIP to it. For instructions about how tocreate an ECS, see Elastic Cloud Server User Guide.

2. Unbind the EIP from the ECS where the MySQL database is installed and bindthe EIP to the ECS where the Discuz! forum is to be deployed.You can access the MySQL database through a private network, so the EIPbound to the ECS where the MySQL database is installed can be unbound andthen bound to the ECS where the Discuz! forum is to be deployed. Thisimproves resource utilization. For detailed operations, see Virtual PrivateCloud User Guide. After binding the EIP, you can access the ECS from theInternet and install various environments, such as PHP and Apache.

3. Deploy the forum.For instructions about how to deploy the Discuz! forum, see officially releasedDiscuz! documentation. When configuring parameters, configure the privateIP address of the ECS where the MySQL database is installed for the databaseserver, and use the username and password authorized for remotely accessingthe ECS where the MySQL database is installed to access the MySQLdatabase. After the configuration is complete, you can unbind the EIP fromthe ECS where the forum is deployed to reduce resource usage.

Create a private image.

Use the ECS where the Discuz! forum is deployed to create a private image. Thisprivate image is used to create the ECSs that will be used for capacity expansion.

1. Only a stopped ECS can be used to create a private image, so stop the ECSwhere the Discuz! forum is deployed before creating a private image. Fordetailed operations, see Elastic Cloud Server User Guide.

2. Use the ECS to create a private image. For details, see Image ManagementService User Guide.

Create an AS group.

An AS group consists of a collection of ECS instances, AS configurations, and ASpolicies that have similar attributes and apply to the same application scenario. AnAS group is the basis for enabling or disabling AS policies and performing scalingactions. You must create an AS group to automatically add or remove ECSinstances to match changes in traffic to the Discuz! forum.

For instructions about how to create an AS group, see Creating an AS Group.During the configuration, use the created VPC, subnet, load balancer, and listener.

Auto ScalingUser Guide 2 Best Practices

2021-10-20 18

Page 23: User Guide - docs.otc.t-systems.com

Create an AS configuration.

The AS configuration lists the basic specifications of the ECSs to be automaticallyadded to the AS group in a scaling action.

For instructions about how to create an AS configuration, see Creating an ASConfiguration from a New Specifications Template. During the configuration,select the private image you created in the preceding step. Configure otherparameters based on service requirements.

Manually add the ECS to the AS group.

On the page providing details about the AS group, click the Instances tab andthen Add to add the ECS where the Discuz! forum is deployed to the AS group. Fordetails, see Manual Scaling. You can enable instance protection on this ECS sothat it will not be automatically removed from the AS group.

Create an AS policy.

An AS policy specifies the conditions for triggering a scaling action. After youcreate an AS policy for the AS group, AS automatically increases or decreases thenumber of instances based on the policy.

You can configure an alarm-based AS policy. When Cloud Eye generates an alarmfor a monitoring metric, such as vCPU usage, AS automatically increases ordecreases the number of instances in the AS group. If traffic fluctuations arepredictable, you can also configure a scheduled or periodic AS policy.

For instructions about how to create an AS policy, see Dynamic Scaling andScheduled Scaling. After an AS policy is created and enabled, if a triggeringcondition is met, the AS group scales in or out as needed.

Auto ScalingUser Guide 2 Best Practices

2021-10-20 19

Page 24: User Guide - docs.otc.t-systems.com

3 Quick Start

3.1 Wizard-based Process of Using ASFigure 3-1 illustrates the wizard-based AS configuration.

Figure 3-1 Wizard-based AS configuration

3.2 Creating an AS Group QuicklyIf you are using AS for the first time, following the wizard-based process is an easyway to create an AS group, AS configuration, and AS policy.

Prerequisites● You have created the required VPCs, subnets, security groups, and load

balancers.

Auto ScalingUser Guide 3 Quick Start

2021-10-20 20

Page 25: User Guide - docs.otc.t-systems.com

● You have obtained the keys for logging in to the instances added by a scalingaction.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Click Create AS Group.5. Set basic information about the AS group, such as Name, Max. Instances,

Min. Instances, and Expected Instances. Table 3-1 lists the parameters.

Table 3-1 AS group parameters

Parameter Description ExampleValue

Region A region is where the AS group is deployed.Resources in different regions cannotcommunicate with each other over internalnetworks. For lower network latency andfaster access to your resources, select theregion nearest to your target users.

N/A

AZ An AZ is a physical location where resourcesuse independent power supply andnetworks. AZs are physically isolated butinterconnected through an internal network.● If you require high availability, buy

servers in difference AZs.● If you require low network latency, buy

servers in the same AZ.To enhance application availability, thesystem evenly distributes your instancesbetween AZs if multiple AZs have beenselected.

N/A

Name Specifies the name of the AS group to becreated.The name can contain up to 64 characters.It can include letters, digits, underscores (_),and hyphens (-).

N/A

Max.Instances

Specifies the maximum number of ECSinstances in an AS group.

0

Auto ScalingUser Guide 3 Quick Start

2021-10-20 21

Page 26: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

ExpectedInstances

Specifies the expected number of ECSinstances in an AS group.After an AS group is created, you canchange this value, which will trigger ascaling action.

0

Min.Instances

Specifies the minimum number of ECSinstances in an AS group.

1

VPC Provides a network for your ECS instances.All ECS instances in the AS group aredeployed in this VPC.

N/A

Subnet You can select up to five subnets. The ASgroup automatically binds all NICs to thecreated ECSs. The first subnet is used by theprimary NIC of an ECS instance by default,and other subnets are used by extensionNICs of the instance.

N/A

Auto ScalingUser Guide 3 Quick Start

2021-10-20 22

Page 27: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

LoadBalancing

This parameter is optional. A load balancerautomatically distributes traffic across allinstances in an AS group to balance theirservice load. It improves fault tolerance ofyour applications and expands applicationservice capabilities.NOTE

● Up to three load balancers can be added toan AS group.

● After multiple load balancers are added to anAS group, multiple services can beconcurrently listened to, thereby improvingscalability. If ELB health check is selected forHealth Check Method, when any one of thelisteners detects that an instance becomesunhealthy, AS will replace the faulty instancewith a functional one.

If you select Classic load balancer,configure the following parameters:● Load Balancer● ListenerIf you select Enhanced load balancer,configure the following parameters:● Load Balancer● Backend ECS Group● Backend Port: specifies the port on

which a backend ECS listens for traffic.● Weight: determines the portion of

requests a backend ECS processescompared to other backend ECSs addedto the same listener.For more information about loadbalancing, see Elastic Load BalancingUser Guide.

N/A

Auto ScalingUser Guide 3 Quick Start

2021-10-20 23

Page 28: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

InstanceRemovalPolicy

Specifies the priority for removing instancesfrom an AS group. If specified conditions aremet, scaling actions are triggered to removeinstances. AS supports the followinginstance removal policies:● Oldest instance created from oldest AS

configuration: The oldest instancecreated from the oldest configuration isremoved from the AS group first.

● Newest instance created from oldestAS configuration: The newest instancecreated from the oldest configuration isremoved from the AS group first.

● Oldest instance: The oldest instance isremoved from the AS group first.

● Newest instance: The newest instance isremoved from the AS group first.

NOTE● Removing instances will preferentially ensure

that the remaining instances are loadbalanced in AZs.

● Manually added ECS instances are the last tobe removed. If AS does remove a manuallyadded instance, it only removes the instancefrom the AS group. It does not delete theinstance. If multiple manually added instancesmust be removed, AS preferentially removesthe earliest-added instance first.

N/A

EIP If EIP has been selected in an ASconfiguration for an AS group, an EIP isautomatically bound to the ECS instanceadded to the AS group. If you selectRelease, the EIP bound to an instance isreleased when the instance is removed fromthe AS group. Otherwise, the systemunbinds the EIP from the instance, but doesnot release it when the instance is removedfrom the AS group.

N/A

Auto ScalingUser Guide 3 Quick Start

2021-10-20 24

Page 29: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

Health CheckMethod

When a health check detects a faulty ECS,AS removes the faulty ECS from the ASgroup and adds a new one. The healthcheck is implemented using any of thefollowing methods:● ECS health check: checks ECS instance

running status. If an instance is stoppedor deleted, it is considered as unhealthy.This method is selected by default. Usingthis method, the AS group periodicallydetermines the running status of eachECS instance based on the health checkresult. If the health check results showthat an instance is unhealthy, AS removesthe instance from the AS group.

● ELB health check: determines ECSrunning status using a load balancinglistener. This health check method isavailable only when the AS group uses aload balancing listener. When a loadbalancing listener detects that an ECS isfaulty, AS removes the ECS from the ASgroup.

N/A

Health CheckInterval

Specifies the health check period for an ASgroup. You can set a proper health checkinterval, such as 10 seconds, 1 minute, 5minutes, 15 minutes, 1 hour, and 3 hoursbased on the site requirements.

5 minutes

EnterpriseProject

Specifies the enterprise project to which theAS group belongs. If an enterprise project isconfigured for an AS group, ECSs created inthis AS group also belong to this enterpriseproject. If you do not specify an enterpriseproject, the default enterprise project willbe used.NOTE

● Value default indicates the default enterpriseproject. Resources that are not allocated toany enterprise projects under your account aredisplayed in the default enterprise project.

● Enterprise project is an upgraded version ofIAM. It allocates and manages resources ofdifferent projects.

N/A

AdvancedSettings

Configure notifications and tags.You can select Do not configure orConfigure now.

N/A

Auto ScalingUser Guide 3 Quick Start

2021-10-20 25

Page 30: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

NotificationMode

This parameter is optional. If this parameteris selected, the system will notify you ofscaling action results by email after ascaling action is complete.The mailbox is specified when you registeryourself on the cloud.

N/A

Tag If you have many resources of the sametype, you can use tags to manage yourresources. You can identify specifiedresources quickly using the tags allocated tothem.Each tag contains a key and a value. Youcan specify the key and value for each tag.● Key

– The key must be specified.– The key must be unique to the AS

group.– The key can include up to 36

characters. Only digits, letters,underscores (_), and hyphens (-) areallowed.

● Value– The value is optional.– A key can have only one value.– The value can include up to 43

characters. Only digits, letters,underscores (_), and hyphens (-) areallowed.

N/A

6. Click Next.7. On the displayed page, you can use an existing AS configuration or create an

AS configuration. For details, see Creating an AS Configuration from anExisting ECS Instance and Creating an AS Configuration from a NewSpecifications Template.

8. Click Next.9. (Optional) Add an AS policy to an AS group.

On the displayed page, click Add AS Policy.Configure the required parameters, such as the Policy Type, Scaling Action,and Cooldown Period. For details, see Dynamic Scaling and ScheduledScaling.

Auto ScalingUser Guide 3 Quick Start

2021-10-20 26

Page 31: User Guide - docs.otc.t-systems.com

NO TE

● If a scaling action is triggered by an AS policy, the cooldown period is whateverconfigured for that AS policy.

● If a scaling action is triggered by manually changing the expected number of instancesor by other actions, the cooldown period is whatever configured for the AS group.

10. Click Create Now.11. Check the AS group, AS configuration, and AS policy information. Click

Submit.12. Confirm the creation result and go back to the AS Groups page as prompted.

After the AS group is created, its status changes to Enabled.

Auto ScalingUser Guide 3 Quick Start

2021-10-20 27

Page 32: User Guide - docs.otc.t-systems.com

4 AS Management

4.1 AS Group

4.1.1 Creating an AS Group

Scenarios

An AS group consists of a collection of instances and AS policies that have similarattributes and apply to the same application scenario. An AS group is the basis forenabling or disabling AS policies and performing scaling actions. The pre-configured AS policy automatically adds or deletes instances to or from an ASgroup, or maintains a fixed number of instances in an AS group.

When creating an AS group, specify an AS configuration for it. Additionally, addone or more AS policies for the AS group.

Creating an AS group involves the configuration of the maximum, minimum, andexpected numbers of instances and the associated load balancer.

Notes

ECS types available in different AZs may vary. When creating an AS group, choosean AS configuration that uses an ECS type available in the AZs used by the ASgroup.

● If the ECS type specified in the AS configuration is not available in any of theAZs used by the AS group, the following situations will occur:– If the AS group is disabled, it cannot be enabled again later.– If the AS group is enabled, its status will become abnormal when

instances are added to it.● If the ECS type specified in the AS configuration is only available in certain

AZs used by the AS group, the ECS instances added by a scaling action areonly deployed in the AZs where that ECS type is available. As a result, theinstances in the AS group may not be evenly distributed.

Auto ScalingUser Guide 4 AS Management

2021-10-20 28

Page 33: User Guide - docs.otc.t-systems.com

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Click Create AS Group.5. Set parameters, such as Name, Max. Instances, Min. Instances, and

Expected Instances. Table 4-1 describes the key parameters to be configured.

Table 4-1 AS group parameters

Parameter

Description ExampleValue

Region A region is where the AS group is deployed.Resources in different regions cannotcommunicate with each other over internalnetworks. For lower network latency and fasteraccess to your resources, select the region nearestto your target users.

N/A

AZ An AZ is a physical location where resources useindependent power supply and networks. AZs arephysically isolated but interconnected through aninternal network.● If you require high availability, buy servers in

difference AZs.● If you require low network latency, buy servers

in the same AZ.To enhance application availability, the systemevenly distributes your instances between AZs ifmultiple AZs have been selected.

N/A

Name Specifies the name of the AS group to be created.The name can contain up to 64 characters. It caninclude letters, digits, underscores (_), andhyphens (-).

N/A

Max.Instances

Specifies the maximum number of ECS instancesin an AS group.

1

ExpectedInstances

Specifies the expected number of ECS instances inan AS group.After an AS group is created, you can change thisvalue, which will trigger a scaling action.

0

Min.Instances

Specifies the minimum number of ECS instances inan AS group.

0

Auto ScalingUser Guide 4 AS Management

2021-10-20 29

Page 34: User Guide - docs.otc.t-systems.com

Parameter

Description ExampleValue

VPC Provides a network for your ECS instances.All ECS instances in the AS group are deployed inthis VPC.

N/A

Subnet You can select up to five subnets. The AS groupautomatically binds all NICs to the created ECSinstances. The first subnet is used by the primaryNIC of an ECS instance by default, and othersubnets are used by extension NICs of theinstance.

N/A

LoadBalancing

This parameter is optional. A load balancerautomatically distributes traffic across allinstances in an AS group to balance their serviceload. It improves fault tolerance of yourapplications and expands application servicecapabilities.NOTE

● Up to three load balancers can be added to an ASgroup.

● After multiple load balancers are added to an ASgroup, multiple services can be concurrently listenedto, thereby improving service scalability. If ELBhealth check is selected for Health Check Method,when any one of the listeners detects that aninstance becomes unhealthy, AS will replace it with anew one.

If you select Classic load balancer, configure thefollowing parameters:● Load Balancer● ListenerIf you select Enhanced load balancer, configurethe following parameters:● Load Balancer● Backend ECS Group● Backend Port: specifies the port on which a

backend ECS listens for traffic.● Weight: determines the portion of requests a

backend ECS processes compared to otherbackend ECSs added to the same listener.For more information about load balancing,see Elastic Load Balancing User Guide.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 30

Page 35: User Guide - docs.otc.t-systems.com

Parameter

Description ExampleValue

InstanceRemovalPolicy

Controls which instances are first to be removedduring scale in. If specified conditions are met,scaling actions are triggered to remove instances.You can choose from any of the following instanceremoval policies:● Oldest instance created from oldest AS

configuration: The oldest instance createdfrom the oldest configuration is removed fromthe AS group first.

● Newest instance created from oldest ASconfiguration: The newest instance createdfrom the oldest configuration is removed fromthe AS group first.

● Oldest instance: The oldest instance isremoved from the AS group first.

● Newest instance: The latest instance isremoved from the AS group first.

NOTE● AS always balances instances across AZs first,

regardless of which removal policy is used.● Manually added ECS instances are the last to be

removed. If AS does remove a manually addedinstance, it only removes the instance from the ASgroup. It does not delete instance. If multiplemanually added instances must be removed, ASpreferentially removes the earliest-added instancefirst.

Oldestinstancecreatedfrom oldestASconfiguration

EIP If EIP has been selected in an AS configuration foran AS group, an EIP is automatically bound to theECS instance added by a scaling action to the ASgroup. If you select Release, the EIP bound to aninstance is released when the instance is removedfrom the AS group. Otherwise, the system unbindsthe EIP from the instance, but does not release itwhen the instance is removed from the AS group.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 31

Page 36: User Guide - docs.otc.t-systems.com

Parameter

Description ExampleValue

HealthCheckMethod

When a health check detects an unhealthy ECSinstance, AS replaces it with a new one. You canchoose from either of the following health checkmethods:● ECS health check: checks ECS instance health

status. If an instance is stopped or deleted, it isconsidered to be unhealthy. This method isselected by default. Using this method, the ASgroup periodically evaluates the running statusof each instance based on the health checkresults. If the health check results show that aninstance is unhealthy, AS removes the instancefrom the AS group.

● ELB health check: determines ECS runningstatus using a load balancing listener. When aload balancing listener detects that an instanceis unhealthy, AS removes the instance from theAS group.

N/A

HealthCheckInterval

Specifies the length of time between healthchecks. You can set a health check interval, suchas 10 seconds, 1 minute, 5 minutes, 15 minutes, 1hour, or 3 hours, based on the servicerequirements.

5 minutes

Enterprise Project

Specifies the enterprise project to which the ASgroup belongs. If an enterprise project isconfigured for an AS group, ECSs created in thisAS group also belong to this enterprise project. Ifyou do not specify an enterprise project, thedefault enterprise project will be used.NOTE

● Value default indicates the default enterpriseproject. Resources that are not allocated to anyenterprise projects under your account are displayedin the default enterprise project.

● Enterprise project is an upgraded version of IAM. Itallocates and manages resources of differentprojects.

N/A

AdvancedSettings

Configure notifications and tags.You can select Do not configure or Configurenow.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 32

Page 37: User Guide - docs.otc.t-systems.com

Parameter

Description ExampleValue

NotificationMode

This parameter is optional. If this parameter isselected, the system will notify you of scalingaction results by email after a scaling action iscomplete.The notifications will be sent to the email addressyou specified when you registered yourself on thecloud.

N/A

Tag If you have many resources of the same type, youcan use tags to more easily manage yourresources. You can identify specified resourcesquickly using the tags allocated to them.Each tag contains a key and a value. You canspecify the key and value for each tag.● Key

– The key must be specified.– The key must be unique to the AS group.– The key can include up to 36 characters. It

can include digits, letters, underscores (_),and hyphens (-).

● Value– The value is optional.– A key can have only one value.– The value can include up to 43 characters. It

can include digits, letters, underscores (_),and hyphens (-).

N/A

6. Click Next.

7. On the displayed page, you can use an existing AS configuration or create anAS configuration. For details, see Creating an AS Configuration from anExisting ECS Instance and Creating an AS Configuration from a NewSpecifications Template.

8. Click Next.

9. (Optional) Add an AS policy to an AS group.

On the displayed page, click Add AS Policy.

Configure the required parameters, such as the Policy Type, Scaling Action,and Cooldown Period. For details, see Dynamic Scaling and ScheduledScaling.

NO TE

● If a scaling action is triggered by an AS policy, the cooldown period is whateverconfigured for that AS policy.

● If a scaling action is triggered by manually changing the expected number of instancesor by other actions, the cooldown period is whatever configured for the AS group.

Auto ScalingUser Guide 4 AS Management

2021-10-20 33

Page 38: User Guide - docs.otc.t-systems.com

10. Click Create Now.11. Check the AS group, AS configuration, and AS policy information. Click

Submit.12. Confirm the creation result and go back to the AS Groups page as prompted.

After the AS group is created, its status changes to Enabled.

4.1.2 (Optional) Adding a Load Balancer to an AS GroupElastic Load Balancing (ELB) automatically distributes incoming traffic acrossmultiple backend servers based on configured forwarding policies. ELB expandsthe service capabilities of applications and improves their availability byeliminating single points of failure (SPOFs).

If ELB functions are required, perform the operations provided in this section toadd a load balancer to your AS group. The load balancer added to an AS groupdistributes application traffic to all instances in the AS group when an instance isadded to or deleted from the AS group.

Only a created load balancer can be bound to an AS group, and the AS group andload balancer must be in the same VPC. For details about how to create a loadbalancer, see Elastic Load Balancing User Guide. To add a load balancer for an ASgroup, perform the following operations:

● When creating an AS group, configure parameter Load Balancing to add aload balancer. For details, see Creating an AS Group.

● If the AS group is not enabled, contains no instance, and has no scaling actionongoing, you can modify Load Balancing to add a load balancer for the ASgroup. For details, see Modifying an AS Group.

4.1.3 Changing the AS Configuration for an AS Group

ScenariosIf you need to change the specifications of ECS instances in an AS group, changingthe AS configuration used by the AS group is an easy way to help you get there.

Effective Time of New AS ConfigurationAfter you change the AS configuration for an AS group, the new AS configurationwill not be used until any ongoing scaling actions are complete.

For example, if there is a scaling action ongoing for an AS group, and you changethe AS configuration of the AS group from as-config-A to as-config-B, as-config-A is still used for the instances that are being added in the ongoing scaling action.

as-config-B will take effect in the next scaling action.

Figure 4-1 Changing the AS configuration

Auto ScalingUser Guide 4 AS Management

2021-10-20 34

Page 39: User Guide - docs.otc.t-systems.com

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.4. Click the name of the AS group for which you want to change the AS

configuration. On the Basic Information page, click Change Configurationto the right of Configuration Name.You can also locate the row containing the target AS group and choose More> Change Configuration in the Operation column.

5. In the displayed Change AS Configuration dialog box, select another ASconfiguration to be used by the AS group.

6. Click OK.

4.1.4 Enabling an AS Group

ScenariosYou can enable an AS group to automatically scale in or out capacity.

After an AS group is enabled, its status changes to Enabled. AS monitors the ASpolicy and triggers a scaling action for AS groups only in Enabled state. After anAS group is enabled, AS triggers a scaling action to automatically add or removeinstances if the number of instances in the AS group is different from the expectednumber of instances.

● Only AS groups in the Disabled state can be enabled.● Only AS groups in the Abnormal state can be forcibly enabled. You can

choose More > Forcibly Enable to enable an abnormal AS group. Forciblyenabling an AS group does not have adverse consequences.

● After you create an AS group and add an AS configuration to an AS group,the AS group is automatically enabled.

Enabling an AS Group1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.4. In the AS group list, locate the row containing the target AS group and click

Enable in the Operation column. You can also click the AS group name andthen Enable to the right of Status on the Basic Information page to enablethe AS group.

5. In the Enable AS Group dialog box, click Yes.

Forcibly Enabling an AS Group1. Log in to the management console.

Auto ScalingUser Guide 4 AS Management

2021-10-20 35

Page 40: User Guide - docs.otc.t-systems.com

2. Click in the upper left corner to select a region and a project.

3. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling. Then click the AS Groups tab.

4. In the AS group list, locate the row containing the target AS group and selectForcibly Enable from the More drop-down list in the Operation column. Youcan also click the AS group name and then Forcibly Enable to the right ofStatus on the Basic Information page to enable the AS group.

5. In the Forcibly Enable AS Group dialog box, click Yes.

4.1.5 Disabling an AS Group

Scenarios

If you need to stop an instance in an AS group for configuration or upgrade,disable the AS group before performing the operation. This prevents the instancefrom being deleted in a health check. When the instance status is restored, youcan enable the AS group again.

If a scaling action keeps failing and being retried (the failure cause can be viewedon the Elastic Cloud Server page) for an AS group, use either of the followingmethods to stop the action from being repeated:

● Disable the AS group. Then, after the scaling action fails, it will not be retried.Enable the AS group again when the environment recovers or after replacingthe AS configuration.

● Disable the AS group and change the expected number of instances to thenumber of existing instances. Then after the scaling action fails, the scalingaction will not be retried.

After an AS group is disabled, its status changes to Disabled. AS does notautomatically trigger any scaling actions for a Disabled AS group. When an ASgroup has an in-progress scaling action, the scaling action does not stopimmediately after the AS group is disabled.

You can disable an AS group when its status is Enabled or Abnormal.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.

3. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling. Then click the AS Groups tab.

4. In the AS group list, locate the row containing the target AS group and clickDisable in the Operation column. You can also click the AS group name andthen Disable to the right of Status on the Basic Information page to disablethe AS group.

5. In the Disable AS Group dialog box, click Yes.

Auto ScalingUser Guide 4 AS Management

2021-10-20 36

Page 41: User Guide - docs.otc.t-systems.com

4.1.6 Modifying an AS Group

ScenariosYou can modify an AS group if needed. The values of the following parameterscan be changed: Name, Max. Instances, Min. Instances, Expected Instances,Cooldown Period, Health Check Method, Health Check Interval, Enterpriseproject, Instance Removal Policy, EIP, and Notification Mode.

NO TE

Changing the value of Expected Instances will trigger a scaling action. AS will automaticallyincrease or decrease the number of instances to the value of Expected Instances.

If the AS group is not enabled, contains no instances, and has no scaling actionongoing, you can modify Subnet and Load Balancing configurations.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.

4. In the AS group list, locate the AS group you want to modify and chooseMore > Modify in the Operation column.You can also click the AS group name to switch to the Overview page, andclick Modify in the upper right corner.

5. In the Modify AS Group dialog box, modify related data, for example, theexpected number of instances.

6. Click OK.

4.1.7 Deleting an AS Group

ScenariosYou can delete an AS group when it is no longer required.

● If an AS group is not required during a specified period of time, you areadvised to disable it but not delete it.

● An AS group can be deleted only when it has no instances and no scalingaction is being performed.

● When an AS group is deleted, its AS policies and the alarm rules generatedbased those AS policies will be automatically deleted.

Procedure1. Log in to the management console.

2. Click in the upper left corner and select the desired region and project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.

Auto ScalingUser Guide 4 AS Management

2021-10-20 37

Page 42: User Guide - docs.otc.t-systems.com

4. In the AS group list, locate the row containing the target AS group andchoose More > Delete in the Operation column.

5. In the displayed Delete AS Group dialog box, click Yes.

4.2 AS Configuration

4.2.1 Creating an AS ConfigurationAn AS configuration defines the specifications of the ECS instances to be added toan AS group. The specifications include the ECS image and system disk size.

Scenarios● When you create an AS group, create a new AS configuration or use an

existing AS configuration.● Create the required AS configuration on the Instance Scaling page.● Change the AS configuration on the AS group details page.

Methods● Create an AS configuration from an existing ECS instance.

If you create an AS configuration from an existing ECS instance, the vCPU,memory, image, disk, and ECS type are the same as those of the selectedinstance by default. For details, see Creating an AS Configuration from anExisting ECS Instance.

● Create an AS configuration from a new specifications template.If you have special requirements on the ECSs for resource expansion, use anew specifications template to create the AS configuration. For details, seeCreating an AS Configuration from a New Specifications Template.

4.2.2 Creating an AS Configuration from an Existing ECSInstance

Scenarios

You can use an existing ECS instance to rapidly create an AS configuration. In sucha case, the parameter settings, such as the vCPUs, memory, image, disk, and ECStype in the AS configuration are the same as those of the selected instance bydefault.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Click Create AS Configuration.

Auto ScalingUser Guide 4 AS Management

2021-10-20 38

Page 43: User Guide - docs.otc.t-systems.com

5. Set the parameters for the AS configuration. Table 4-2 lists the ASconfiguration parameters.

Table 4-2 AS configuration parameters

Parameter Description ExampleValue

Region A region is where an AS configuration resides. N/A

Name Specifies the name of an AS configuration. N/A

Configuration Template

Select Use specifications of an existing ECSand click Select ECS.The ECS type, vCPUs, memory, image, anddisk information in the AS configuration arethe same as those of the selected ECS bydefault.

Usespecifications of anexisting ECS

EIP An EIP is a static public IP address bound toan ECS in a VPC. Using the EIP, the ECSprovides services externally.The following options are provided:● Do not use

An ECS without an EIP cannot access theInternet. However, it can still be used as aservice ECS or deployed in a cluster on aprivate network.

● Automatically assignAn EIP with a dedicated bandwidth isautomatically assigned to each ECS. Thebandwidth size is configurable.

Automatically assign

Key Pair A key pair is used for ECS loginauthentication. If you select this mode, createor import a key pair on the Key Pair page.NOTE

If you use an existing key, make sure that you havesaved the key file locally. Without the key, you willnot be able to log in to your instance.

N/A

AdvancedSettings

This allows you to configure User Data.You can select Do not configure orConfigure now.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 39

Page 44: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

User Data Enables an ECS to automatically inject userdata when the ECS starts for the first time.This configuration is optional. If this functionis enabled, the ECS automatically injects userdata during its first startup.For details, see Elastic Cloud Server UserGuide.The following two methods are available:● As text: allows you to enter the user data

in the text box below.● As file: allows you to inject a script or

other files when you create an ECS.NOTE

● For Linux, if you use passwordauthentication, this function is notsupported.

● If the selected image does not support userdata injection, this function is notsupported.

-

6. Click Create Now.

7. If you want to use the newly created AS configuration, add it to the AS group.For details, see Changing the AS Configuration for an AS Group.

4.2.3 Creating an AS Configuration from a New SpecificationsTemplate

Scenarios

If you have special requirements on the ECS instances for resource expansion, usea new specifications template to create the AS configuration. In such a case, ECSinstances that have the specifications specified in the template will be added tothe AS group in scaling actions.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.

3. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

4. Click Create AS Configuration.

5. Set the parameters for the AS configuration. Table 4-3 lists the ASconfiguration parameters.

Auto ScalingUser Guide 4 AS Management

2021-10-20 40

Page 45: User Guide - docs.otc.t-systems.com

Table 4-3 AS configuration parameters

Parameter Description Example Value

Region A region is where an AS configurationresides.

N/A

Name Specifies the name of the ASconfiguration to be created.

N/A

Configuration Template

Select Create a new specificationstemplate.If this option is selected, configureparameters, such as the vCPUs, memory,image, disk, and ECS type, to create anew AS configuration.

Create a newspecificationstemplate

Specifications

The public cloud provides various ECStypes for different application scenarios.For more information, see Elastic CloudServer User Guide.Configure the ECS specifications,including vCPUs, memory, image type,and disk, according to the ECS type.

Memory-optimized ECS

Auto ScalingUser Guide 4 AS Management

2021-10-20 41

Page 46: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

Image ● Public imageA public image is a standard, widelyused image. It contains an OS andpreinstalled public applications and isavailable to all users. You canconfigure the applications or softwarein the public image as needed.

● Private imageA private image is an image availableonly to the user who created it. Itcontains an OS, preinstalled publicapplications, and the user's privateapplications. Using a private image tocreate ECSs frees you fromconfiguring multiple ECSs repeatedly.NOTE

If you select an encrypted image, youmust grant key management system(KMS) access rights to EVS. Otherwise,encryption cannot be used. If you haverights granting permission, grant the KMSaccess rights to EVS. If you do not havethe permission, contact the user havingthe security administrator rights to grantthe KMS access rights. For details, seeIdentity and Access Management UserGuide.● Encrypted: indicates that the image

has been encrypted.● KMS Key Name: specifies the name of

the key used by the encrypted image.By default, the name is ims/default.

● Xrole Name: EVSAccessKMS:indicates that EVS has obtained theKMS access rights.

For more information about encryptedimages, see Image Management ServiceUser Guide.

● Shared imageA shared image is a private imageshared by another public cloud user.

Public image

Auto ScalingUser Guide 4 AS Management

2021-10-20 42

Page 47: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

License Type Specifies a license type for using an OSor software on the public cloud. If theimage you selected is free of charge, thisparameter is unavailable. If the imageyou selected is billed, such as an Ubuntu,SUSE, Oracle Linux, or Windows ServerEdition image, this parameter isavailable.● Use license from the system

Allows you to use the license providedby the public cloud . Obtaining theauthorization of such a license isbilled.

● Bring your own license (BYOL)Allows you to use your existing OSlicense. In such a case, you do notneed to apply for a license again.

For more information about the licensetype, see Elastic Cloud Server UserGuide.

Bring your ownlicense (BYOL)

Auto ScalingUser Guide 4 AS Management

2021-10-20 43

Page 48: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

Disk Includes system disks and data disks.● System Disk

Common I/O: uses Serial AdvancedTechnology Attachment (SATA) drivesto store data.High I/O: uses serial attached SCSI(SAS) drives to store data.Ultra-high I/O: uses solid state disk(SSD) drives to store data.If the image based on which an ECS iscreated is encrypted, the system diskof the ECS is automatically encrypted.In addition, the name of theencrypted key is displayed on thepage.

● Data DiskYou can create multiple data disks foran ECS instance and encrypt them. Inaddition, you can specify a data diskimage for exporting data.When encrypting a data disk, selectEncryption for it. KMS access rightsmust be granted to EVS for using theencryption feature. If you have rightsgranting permission, grant the KMSaccess rights to EVS. If you do nothave the permission, contact the userhaving the security administratorrights to grant the KMS access rights.For details, see Identity and AccessManagement User Guide.– Xrole Name: EVSAccessKMS:

indicates that EVS has obtainedthe KMS access rights.

– KMS Key Name: specifies thename of the key used by theencrypted data disk. By default,the name is evs/default.

– KMS Key ID: specifies the ID of thekey used by the encrypted datadisk.

For more information about EVS diskencryption, see Elastic Volume ServiceUser Guide.

Common I/O forSystem Disk

Auto ScalingUser Guide 4 AS Management

2021-10-20 44

Page 49: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

SecurityGroup

Controls ECS access within or betweensecurity groups by defining access rules.ECSs added to a security group areprotected by the access rules you define.

N/A

EIP An EIP is a static public IP address boundto an ECS in a VPC. Using the EIP, theECS provides services externally.The following options are provided:● Do not use

An ECS without an EIP cannot accessthe Internet. However, it can still beused as a service ECS or deployed in acluster on a private network.

● Automatically assignAn EIP with a dedicated bandwidth isautomatically assigned to each ECS.You can set the bandwidth size.

Automaticallyassign

Key Pair A key pair is used for ECS loginauthentication. If you select this mode,create or import a key pair on the KeyPair page.NOTE

If you use an existing key, make sure that youhave saved the key file locally. Without thekey, you will not be able to log in to yourinstance.

N/A

AdvancedSettings

This parameter allows you to configureand User Data.You can select Do not configure orConfigure now.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 45

Page 50: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

User Data Enables an ECS to automatically injectuser data when the ECS starts for thefirst time. This configuration is optional.After this function is enabled, the ECSautomatically injects user data during itsfirst startup.For details, see Elastic Cloud ServerUser Guide.The following methods are available:● As text: allows you to enter the user

data in the text box below.● As file: allows you to inject script files

or other files when you create an ECS.NOTE

● For Linux, if you use passwordauthentication, this function is notsupported.

● If the selected image does not supportuser data injection, this function is notsupported.

-

6. Click Create Now.7. If you want to use the newly created AS configuration, add it to the AS group.

For details, see Creating an AS Group or Changing the AS Configurationfor an AS Group.

8. (Optional) Enable the AS group.If the AS group is in Disabled state, enable it. For details, see Enabling an ASGroup.

4.2.4 Copying an AS Configuration

ScenariosYou can copy an existing AS configuration.

When copying an AS configuration, you can modify parameter settings, such asthe configuration name, ECS specifications, and image of the existing ASconfiguration to rapidly add a new AS configuration.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Click the AS Configurations tab, locate the row containing the target AS

configuration, and click Copy in the Operation column.

Auto ScalingUser Guide 4 AS Management

2021-10-20 46

Page 51: User Guide - docs.otc.t-systems.com

5. On the Copy AS Configuration page, modify parameter settings, such asName, Specifications, and Image.

6. Click OK.

4.2.5 Deleting an AS Configuration

ScenariosWhen you no longer need an AS configuration, you can delete it as long as the ASconfiguration is not used by an AS group. You can delete a single AS configurationor delete them batches.

Procedure1. Log in to the management console.

2. Click in the upper left corner and select the desired region and project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Click the AS Configurations tab page, locate the row containing the target

AS configuration, and click Delete in the Operation column to delete this ASconfiguration. You can also select multiple AS configurations to be deletedand click Delete in the upper part of the AS configuration list to delete themall at once.

4.3 AS Policy

4.3.1 OverviewAS policies can trigger scaling actions to adjust bandwidth or the number ofinstances in an AS group. An AS policy defines the conditions for triggering ascaling action and the operation that will be performed. When the triggeringcondition is met, a scaling action is triggered automatically.

NO TE

If multiple AS policies are applied to an AS group, a scaling action is triggered as long asany of the AS policies is invoked, provided that the AS policies do not conflict with eachother.

AS supports the following policies:● Alarm policy: AS automatically adjusts the number of instances in an AS

group or sets the number of instances to the configured value when an alarmis generated for a configured metric, such as CPU Usage.

● Scheduled policy: AS automatically increases or decreases the number ofinstances in an AS group or sets the number of instances to the configuredvalue at a specified time.

● Periodic policy: AS automatically increases or decreases the number ofinstances in an AS group or sets the number of instances to the configuredvalue at a configured interval, such as daily, weekly, and monthly.

Auto ScalingUser Guide 4 AS Management

2021-10-20 47

Page 52: User Guide - docs.otc.t-systems.com

Resource Adjustment Modes● Dynamic

AS adjusts the number of instances or bandwidth when an alarm policy istriggered.This mode is suitable for scenarios where workloads are unpredictable. Alarmpolicies are used to trigger scaling actions based on real-time monitoring data(such as CPU usage) to dynamically adjust the number of instances in the ASgroup.

● PlannedAS adjusts the number of instances or bandwidth when a periodic orscheduled policy is triggered.This mode is suitable for scenarios where workloads are periodic.

● ManualAS allows you to adjust resources by manually adding instances to an ASgroup, removing instances from an AS group, or changing the expectednumber of instances.

4.3.2 Creating an AS Policy

ScenariosYou can manage instances in an AS group through AS policies. This sectiondescribes how to create an AS policy.

Creating an Alarm Policy1. Log in to the management console.

1. Click in the upper left corner to select a region and a project.2. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.3. Locate the row containing the target AS group and click View AS Policy in

the Operation column.4. On the AS Policies page, click Add AS Policy.5. Set the parameters listed in Table 4-4.

Table 4-4 AS policy parameters

Parameter Description Example Value

Policy Name Specifies the name of the ASpolicy to be created.

as-policy-p6g5

Policy Type Select Alarm. Alarm Policy

Auto ScalingUser Guide 4 AS Management

2021-10-20 48

Page 53: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

Alarm Rule Specifies whether a new alarmrule is to be created (Create)or an existing alarm rule willbe used (Use existing).To create an alarm rule,configure the followingparameters:● Rule Name

Specifies the name of thenew alarm rule, for example,as-alarm-7o1u.

● Trigger ConditionSpecifies a monitoringmetric and condition fortriggering a scaling action.For example, when CPUUsage becomes higher than70%, AS automaticallytriggers a scaling action.

● Monitoring IntervalSpecifies the interval (suchas five minutes) at whichthe alarm status is updatedbased on the alarm rule.

● Consecutive OccurrencesSpecifies the number ofsampling points when analarm is triggered. IfOccurrences is set to n, thesampling points of thealarm rule are the samplingpoints in n consecutivesampling periods. Only if allthe sampling points meetthe threshold configured forthe alarm rule will thealarm rule status berefreshed as the Alarmstatus.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 49

Page 54: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

Scaling Action Specifies an action and thenumber or percentage ofinstances.The following scaling actionoptions are available:● Add

Adds instances to an ASgroup when the scalingaction is performed.

● ReduceRemoves instances from anAS group when the scalingaction is performed.

● Set toSets the expected number ofinstances in an AS group toa specified value.

● Add 1 instance● Add 10% instances

The number ofinstances to beadded is 10% of thecurrent number ofinstances in the ASgroup. If the productof the currentnumber of instancesand the percentageis not an integer, ASautomatically roundsthe value up ordown:– If the value is

greater than 1, itis rounded down.

– If the value isgreater than 0but less than 1, itis rounded up to1.

Auto ScalingUser Guide 4 AS Management

2021-10-20 50

Page 55: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

CooldownPeriod

To prevent an alarm policyfrom being repeatedly invokedby the same event, you can seta cooldown period.A cooldown period specifieshow long any alarm-triggeredscaling action will bedisallowed after a previousscaling action is complete.The cooldown period does notapply to scheduled or periodicscaling actions. However, ASrecounts the cooling durationafter a scheduled or periodicscaling action is complete.For example, suppose that thecooldown period is set to 300seconds (5 minutes), and ascheduled policy is specified totrigger a scaling action at10:32, and a previous scalingaction triggered by an alarmpolicy ends at 10:30. Anyalarm-triggered scaling actionwill then be denied during thecooldown period from 10:30 to10:35, but the scaling actionscheduled for 10:32 will stilltake place. If the scheduledscaling action ends at 10:36, anew cooldown period starts at10:36 and ends at 10:41.NOTE

● If a scaling action is triggeredby an AS policy, the cooldownperiod is whatever configuredfor that AS policy.

● If a scaling action is triggeredby manually changing theexpected number of instancesor by other actions, thecooldown period is whateverconfigured for the AS group.

300

6. Click OK.

The newly added AS policy is displayed on the AS Policy tab. In addition, theAS policy is in Enabled state by default.

Auto ScalingUser Guide 4 AS Management

2021-10-20 51

Page 56: User Guide - docs.otc.t-systems.com

Creating a Scheduled or Periodic Policy1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.4. Locate the row containing the target AS group and click View AS Policy in

the Operation column.5. On the AS Policies page, click Add AS Policy.6. Configure the parameters listed in Table 4-5.

Table 4-5 Parameter description

Parameter Description Example Value

Policy Name Specifies the name of the ASpolicy to be created.

as-policy-p6g5

Policy Type Select Scheduled or Periodicfor expanding resources at aspecified time.If you select Periodic, you arerequired to configure two moreparameters:● Interval

– One day– One week– One month

● Time RangeSpecifies a time range duringwhich the AS policy can betriggered.

N/A

Time Zone The default value is GMT+08:00.GMT+08:00, Beijing, China time,is 8:00 hours ahead ofGreenwich Mean Time.

GMT+08:00

Triggered At Specifies a time at which the ASpolicy is triggered.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 52

Page 57: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

Scaling Action Specifies an action and thenumber of instances.The following scaling actionoptions are available:● Add

Adds instances to an ASgroup when the scalingaction is performed.

● ReduceRemoves instances from anAS group when the scalingaction is performed.

● Set toSets the expected number ofinstances in an AS group to aspecified value.

● Add 1 instance● Add 10% instances

The number ofinstances to beadded is 10% of thecurrent number ofinstances in the ASgroup. If the productof the currentnumber of instancesand the percentageis not an integer, ASautomaticallyrounds the value upor down:– If the value is

greater than 1, itis rounded down.

– If the value isgreater than 0but less than 1, itis rounded up to1.

Auto ScalingUser Guide 4 AS Management

2021-10-20 53

Page 58: User Guide - docs.otc.t-systems.com

Parameter Description Example Value

CooldownPeriod

To prevent an alarm policy frombeing repeatedly invoked by thesame event, you can set acooldown period.Specifies how long any alarm-triggered scaling action will bedisallowed after a previousscaling action is complete.The cooldown period does notapply to scheduled or periodicscaling actions. However, ASrecounts the cooling durationafter a scheduled or periodicscaling action is complete.For example, suppose that thecooldown period is set to 300seconds (5 minutes), and ascheduled policy is specified totrigger a scaling action at 10:32,and a previous scaling actiontriggered by an alarm policyends at 10:30. Any alarm-triggered scaling action willthen be denied during thecooldown period from 10:30 to10:35, but the scaling actionscheduled for 10:32 will stilltake place. If the scheduledscaling action ends at 10:36, anew cooldown period starts at10:36 and ends at 10:41.NOTE

● If a scaling action is triggeredby an AS policy, the cooldownperiod is whatever configuredfor that AS policy.

● If a scaling action is triggeredby manually changing theexpected number of instancesor by other actions, thecooldown period is whateverconfigured for the AS group.

300

7. Click OK.The newly added AS policy is displayed on the AS Policy tab. In addition, theAS policy is in Enabled state by default.

Auto ScalingUser Guide 4 AS Management

2021-10-20 54

Page 59: User Guide - docs.otc.t-systems.com

NO TE

If you have created scheduled or periodic AS policies that are invoked at the same time, ASwill execute the one created later. This constraint does not apply to alarm-triggered ASpolicies.

4.3.3 Managing AS Policies

Scenarios

An AS policy specifies the conditions for triggering a scaling action as well as theoperation that will be performed. If the conditions are met, a scaling action istriggered automatically.

This section describes how to manage an AS policy, including modifying, enabling,disabling, executing, and deleting an AS policy.

Modifying an AS Policy

If a particular AS policy cannot meet service requirements, you can modify theparameter settings of the policy.

1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.4. Locate the row containing the target AS group and click View AS Policy in

the Operation column. On the displayed page, locate the row containing thetarget AS policy and choose More > Modify in the Operation column.

5. In the displayed Modify AS Policy dialog box, modify the parameters andclick OK.

Enabling an AS Policy

An AS policy can trigger scaling actions only when it and the AS group are bothenabled. You can enable one or more AS policies for an AS group as required.

● Before enabling multiple AS policies, ensure that the AS policies do notconflict with one another.

● An AS policy can be enabled only when its status is Disabled.

Locate the row containing the target AS group and click View AS Policy in theOperation column. On the displayed page, locate the row containing the targetAS policy and click Enable in the Operation column. To concurrently enablemultiple AS policies, select these AS policies and click Enable in the upper part ofthe AS policy list.

Disabling an AS Policy

If you do not want a particular AS policy to trigger any scaling actions within aspecified period of time, you can disable it.

Auto ScalingUser Guide 4 AS Management

2021-10-20 55

Page 60: User Guide - docs.otc.t-systems.com

● If all of the AS policies configured for an AS group are disabled, no scalingaction will be triggered for this AS group. However, if you manually changethe value of Expected Instances, a scaling action will still be triggered.

● You can disable an AS policy only when its status is Enabled.

Locate the row containing the target AS group and click View AS Policy in theOperation column. On the displayed page, locate the row containing the targetAS policy and click Disable in the Operation column. To concurrently disablemultiple AS policies, select these AS policies and click Disable in the upper part ofthe AS policy list.

Manually Executing an AS PolicyYou can make the number of instances in an AS group reach the expected numberof instances immediately by manually executing an AS policy.

● You can manually execute an AS policy if the scaling conditions configured inthe AS policy are not met.

● You can manually execute an AS policy only when the AS group and AS policyare both in Enabled state.Locate the row containing the target AS group and click View AS Policy inthe Operation column. On the displayed page, locate the row containing thetarget AS policy and click Execute Now in the Operation column.

Deleting an AS PolicyYou can delete an AS policy that will not be used for triggering scaling actions.

An AS policy can be deleted even when the scaling action triggered by the policyis in progress. Deleting the AS policy does not affect a scaling action that hasalready started.

Locate the row containing the target AS group and click View AS Policy in theOperation column. On the displayed page, locate the row containing the targetAS policy and choose More > Delete in the Operation column.

To concurrently delete multiple AS policies, select these AS policies and clickDelete in the upper part of the AS policy list.

4.4 Scaling Action

4.4.1 Dynamic ScalingBefore using AS to perform scaling actions, you must specify how to perform thescaling actions to dynamically expand resources.

If the demands change frequently, you can configure alarm-based policies to scaleresources. When the conditions for invoking an AS policy are met, ASautomatically changes the expected number of instances to trigger a scalingaction to scale up or down resources. For details about how to create an alarmpolicy, see Creating an AS Policy.

Consider a train ticket booking application. If the CPU usage of the instances thatrun the application goes up to 90%, an instance needs to be added to ensure that

Auto ScalingUser Guide 4 AS Management

2021-10-20 56

Page 61: User Guide - docs.otc.t-systems.com

services run properly. If the CPU usage drops down to 30%, an instance needs tobe deleted to prevent resource waste. To meet the requirements, you canconfigure two alarm policies. One policy is used to add one instance if themaximum CPU usage exceeds 90%. The other policy is used to remove an instanceif the minimum CPU usage drops below 30%.

4.4.2 Scheduled ScalingTo satisfy demands that change regularly, you can configure a scheduled orperiodic policy to scale resources at specified time or periodically. For details abouthow to create a scheduled or periodic policy, see Creating an AS Policy.

Take an online course selection web application as an example. This application isfrequently used when a semester starts and seldom used during other parts of theyear. You can configure two scheduled policies to scale resources at the beginningof each semester. The first policy is used to add an instance when the courseselection starts, and the second policy is used to remove an instance when thecourse selection ends.

4.4.3 Manual Scaling

ScenariosYou can manually add or remove instances to or from an AS group, or changingthe expected number of instances.

ProcedureAdding instances to an AS group

If an AS group is enabled and has no ongoing scaling action, and the currentnumber of instances is less than the maximum, you can manually add instances tothe AS group.

Before adding instances to an AS group, ensure that the following conditions aremet:

● The instances are not in other AS groups.● The instances are in the same VPC as the AS group.● The instances are in the AZs used by the AS group.● After the instances are added, the total number of instances is less than or

equal to the maximum number of instances allowed.● Up to 10 instances can be added at a time.

To add instances to an AS group, perform the following steps:

1. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

2. Click the AS Groups tab and then the name of the target AS group.3. On the AS group details page, click the Instances tab and then Add.4. Select the instances to be added and click OK.

Removing instances from an AS group

Auto ScalingUser Guide 4 AS Management

2021-10-20 57

Page 62: User Guide - docs.otc.t-systems.com

You can remove an instance from an AS group, update the instance or fix aninstance fault, and add the instance back to the AS group. An instance removedfrom the AS group no longer carries any application traffic.

You can modify the AS configuration for an AS group at any time, but the newconfiguration will not be applied to any instances that are running. To apply thenew configuration, stop an instance, and the system will replace it with a new onethat has the specifications specified in the new configuration. You can also removethe instance from the AS group, update the instance, and add then instance backto the AS group.

There are some restrictions on instance removal:

● The AS group cannot have a scaling action in progress, the instances must beenabled, and the total number of instances after removal cannot be less thanthe minimum number of instances specified.

● Instances can be removed from an AS group and deleted only if the AS grouphas no scaling action ongoing, and the instances are automatically createdand enabled, and are not used by Storage Disaster Recovery Service (SDRS).

● Instances manually added to an AS group can only be removed. They cannotbe removed and deleted.

● A maximum of 10 instances can be removed at a time.

To remove an instance from an AS group, perform the following steps:

1. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

2. Click the AS Groups tab and then the name of the target AS group.3. Click the Instances tab, locate the row containing the target instance, and

click Remove or Remove and Delete in the Operation column.4. To delete multiple instances from an AS group, select the check boxes in front

of them and click Remove or Remove and Delete.

To delete all instances from an AS group, select the check box on the left of Nameand click Remove or Remove and Delete.

Changing the expected number of instances

Manually change the expected number of instances to add or reduce the numberof instances in an AS group for expanding resources.

For details, see Modifying an AS Group.

4.4.4 Configuring an Instance Removal PolicyWhen instances are automatically removed from your AS group, the instances thatare not in the currently used AZs will be removed first. Besides, AS will checkwhether instances are evenly distributed in the currently used AZs. If the loadamong AZs is unbalanced, AS balances load among AZs when removing instances.If the load among AZs is balanced, AS removes instances following the pre-configured instance removal policy.

AS supports the following instance removal policies:

● Oldest instance: The oldest instance is removed from the AS group first. Usethis policy if you want to upgrade instances in an AS group to a new ECS type.

Auto ScalingUser Guide 4 AS Management

2021-10-20 58

Page 63: User Guide - docs.otc.t-systems.com

You can gradually replace instances of the old type with instances of the newtype.

● Newest instance: The newest instance is removed from the AS group first.Use this policy if you want to test a new AS configuration but do not want tokeep it in production.

● Oldest instance created from oldest AS configuration: The oldest instancecreated from the oldest configuration is removed from the AS group first. Usethis policy if you want to update an AS group and phase out the instancescreated from a previous AS configuration.

● Newest instance created from oldest AS configuration: The newestinstance created from the oldest configuration is removed from the AS groupfirst.

NO TE

Manually added instances are the last to be removed, and if AS does remove a manuallyadded instance, it only removes the instance. It does not delete the instance. If multiplemanually added instances must be removed, AS preferentially removes the earliest-addedinstance first.

4.4.5 Viewing a Scaling Action

ScenariosThis section describes how to check whether a scaling action has been performedand how to view scaling action details.

Viewing Scaling ActionsThe following steps illustrate how to view scaling actions of an AS group.

1. Log in to the management console.2. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling.3. Click the AS Groups tab and then the name of the target AS group.4. Click the Monitoring tab and view scaling actions. On the Monitoring page,

you can view changes in the number of instances and metrics such as CPUUsage.

Viewing Historical Scaling ActionsThe following steps illustrate how to view the historical records of scaling actionsof an AS group.

1. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

2. Click the AS Groups tab and then the name of the target AS group.3. Click the Scaling Actions tab. This page displays historical scaling actions of

an AS group, including instance scaling and load balancer migration.Scaling Action ID, Status, Scaling Action Type, Description, Start Time, and

End Time of scaling actions are displayed. Click before the scaling action

Auto ScalingUser Guide 4 AS Management

2021-10-20 59

Page 64: User Guide - docs.otc.t-systems.com

ID to view the resource name, status, and failure cause. You can also use thefiltering function in the upper right corner to view scaling actions in aspecified period.

4.4.6 Configuring Instance Protection

Scenarios

To control whether a particular instance can be removed automatically from an ASgroup, use instance protection. Once configured, when AS automatically scales inthe AS group, the instance that is protected will not be removed.

Prerequisites

Instance protection does not protect instances from the following:● Health check replacement if the instance fails health checks● Manual removal

NO TE

● Instance protection does not protect unhealthy instances because such instancescannot provide services.

● By default, instance protection does not take effect on the ECSs that are newlycreated in or added to an AS group.

● If an instance is removed from an AS group, its instance protection setting is lost.

Enabling Instance Protection1. Log in to the management console.

2. Click in the upper left corner and select the desired region and project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.4. Click the name of the target AS group.5. Click the Instances tab. Select one or more instances and choose Enable

Instance Protection from the More drop-down list. In the displayed EnableInstance Protection dialog box, click Yes.

Disabling Instance Protection1. Log in to the management console.

1. Click in the upper left corner and select the desired region and project.2. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.3. Click the name of the target AS group.4. Click the Instances tab. Select one or more instances and choose Disable

Instance Protection from the More drop-down list. In the displayed DisableInstance Protection dialog box, click Yes.

Auto ScalingUser Guide 4 AS Management

2021-10-20 60

Page 65: User Guide - docs.otc.t-systems.com

4.5 Bandwidth Scaling

4.5.1 Creating a Bandwidth Scaling Policy

ScenariosYou can automatically adjust your purchased EIP bandwidth and sharedbandwidth using a bandwidth scaling policy. This section describes how to create abandwidth scaling policy.

When creating a bandwidth scaling policy, you need to configure basicinformation. The system supports three types of bandwidth scaling policies: alarm-based, scheduled, and periodic.

The basic information for creating a bandwidth scaling policy includes the policyname, policy type, and trigger condition.

Creating an Alarm-based Bandwidth Scaling Policy1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.4. Click Create Bandwidth Scaling Policy.5. Set parameters, such as the policy name, policy type, and trigger condition.

For details, see Creating a Bandwidth Scaling Policy.

Table 4-6 Alarm policy parameters

Parameter Description ExampleValue

Region Specifies the region where the AS group resides. N/A

PolicyName

Specifies the name of the bandwidth scalingpolicy.The name consists of only letters, digits,underscores (_), and hyphens (-).

N/A

EIP Specifies the public network IP address whosebandwidth needs to be scaled.

N/A

Policy Type Select Alarm. Alarm

Auto ScalingUser Guide 4 AS Management

2021-10-20 61

Page 66: User Guide - docs.otc.t-systems.com

Parameter Description ExampleValue

Alarm Rule You can use an existing alarm rule or create anew one.To create an alarm rule, configure the followingparameters:● Rule Name

Specifies the name of the new alarm rule, forexample, as-alarm-7o1u.

● Trigger ConditionSelect a monitoring metric and triggercondition based on the metric. Table 4-7 liststhe supported monitoring metrics. Anexample value is Outbound Bandwidth Avg.> 100 bit/s.

● Monitoring IntervalSpecifies the period for the metric, forexample, 5 minutes.

● Consecutive OccurrencesSpecifies the number of consecutive times,for example, one time, for triggering ascaling action during a monitoring period.

N/A

ScalingAction

Specifies the execution action in the AS policy.The following scaling action options areavailable:● Add

When a scaling action is triggered, thebandwidth is increased.

● ReduceWhen a scaling action is triggered, thebandwidth is decreased.

● Set toThe bandwidth is set to a fixed value.NOTE

The step (minimum unit for bandwidthadjustment) varies depending on the bandwidthvalue range. The bandwidth will be automaticallyadjusted to the nearest value according to theactual step.● If the bandwidth is less than or equal to 300

Mbit/s, the default step is 1 Mbit/s.● If the bandwidth ranges from 300 Mbit/s to

500 Mbit/s, the default step is 50 Mbit/s.

N/A

CooldownPeriod

Specifies a period of time in the unit of secondafter each scaling action is complete. During thecooldown period, scaling actions triggered byalarms will be denied. Scheduled and periodicscaling actions are not restricted.

300s

Auto ScalingUser Guide 4 AS Management

2021-10-20 62

Page 67: User Guide - docs.otc.t-systems.com

Table 4-7 Monitoring metrics supported by the alarm policy

Metric Description

Inbound Bandwidth Indicates the network rate of inbound traffic.

Inbound Traffic Indicates the network traffic going into the cloudplatform.

Outbound Bandwidth Indicates the network rate of outbound traffic.

Outbound Traffic Indicates the network traffic going out of the cloudplatform.

6. After setting the parameters, click Create Now.

The newly created bandwidth scaling policy is displayed on the BandwidthScaling page and is in Enabled state by default.

Creating a Scheduled or Periodic Bandwidth Scaling Policy1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.4. Click Create Bandwidth Scaling Policy.5. Set parameters, such as the policy name, policy type, and trigger condition.

For details, see Table 4-8.

Table 4-8 Scheduled or periodic policy parameters

Parameter

Description ExampleValue

Region Specifies the region where the AS group resides. N/A

PolicyName

Specifies the name of the bandwidth scalingpolicy.The name consists of only letters, digits,underscores (_), and hyphens (-).

as-policy-p6g5

EIP Specifies the public network IP address whosebandwidth needs to be scaled. This parameter ismandatory when Resource Type is set to EIP.

N/A

Auto ScalingUser Guide 4 AS Management

2021-10-20 63

Page 68: User Guide - docs.otc.t-systems.com

Parameter

Description ExampleValue

PolicyType

Specifies the policy type. You can select ascheduled or periodic policy.If you select Periodic, you are required toconfigure two more parameters:● Time Range

Specifies a time range during which the ASpolicy can be triggered.

● Interval– One day– One week– One month

N/A

TriggeredAt

Specifies a time at which the AS policy istriggered.

N/A

ScalingAction

Specifies the action to be performed.The following scaling action options are available:● Add

When a scaling action is triggered, thebandwidth is increased.

● ReduceWhen a scaling action is triggered, thebandwidth is decreased.

● Set toThe bandwidth is set to a fixed value.NOTE

The step (minimum unit for bandwidth adjustment)varies depending on the bandwidth value range. Thebandwidth will be automatically adjusted to thenearest value according to the actual step.● If the bandwidth is less than or equal to 300

Mbit/s, the default step is 1 Mbit/s.● If the bandwidth ranges from 300 Mbit/s to 500

Mbit/s, the default step is 50 Mbit/s.

N/A

Cooldown Period

Specifies a period of time in the unit of secondafter each scaling action is complete. During thecooldown period, scaling actions triggered byalarms will be denied. Scheduled and periodicscaling actions are not restricted.

300s

6. After setting the parameters, click Create Now.

Auto ScalingUser Guide 4 AS Management

2021-10-20 64

Page 69: User Guide - docs.otc.t-systems.com

4.5.2 Viewing Details About a Bandwidth Scaling Policy

Scenarios

You can view details about a bandwidth scaling policy, including its basicinformation and execution logs. Policy execution logs record details about policyexecution. This section describes how to create a bandwidth scaling policy.

Procedure1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.4. On the Bandwidth Scaling page, click the name of a bandwidth scaling

policy to go to the page showing its basic information and view its details.You can view basic information about the scaling policy, including PolicyType, Trigger Condition, and Scaling Action.

Viewing Execution Logs of a Bandwidth Scaling Policy

In the Policy Execution Logs area on the bandwidth scaling policy details page,you can view the policy execution logs. Policy execution logs record the executionstatus, execution time, original value, and target value of a bandwidth scalingpolicy.

4.5.3 Managing a Bandwidth Scaling Policy

Scenarios

You can adjust the bandwidth through a bandwidth scaling policy.

This section describes how to manage bandwidth scaling policies, includingenabling, disabling, modifying, deleting, and immediately executing a bandwidthscaling policy.

NO TE

The bandwidth scaling policy corresponding to a released EIP still occupies the policy quota.Only the account and its IAM users with the global permission can manage the ASbandwidth policy.

Enabling a Bandwidth Scaling Policy

A bandwidth scaling policy can be enabled only when its status is Disabled.

1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.

Auto ScalingUser Guide 4 AS Management

2021-10-20 65

Page 70: User Guide - docs.otc.t-systems.com

4. In the bandwidth scaling policy list, locate the row containing the targetpolicy and click Enable in the Operation column.

5. In the displayed Enable Bandwidth Scaling Policy dialog box, click Yes.

Disabling a Bandwidth Scaling Policy

A bandwidth scaling policy can be disabled only when its status is Enabled.

1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.4. In the bandwidth scaling policy list, locate the row containing the target

policy and click Disable in the Operation column.5. In the displayed Disable Bandwidth Scaling Policy dialog box, click Yes.

NO TE

After a bandwidth scaling policy is disabled, its status changes to Disabled. AS doesnot automatically trigger any scaling action based on a Disabled bandwidth scalingpolicy.

Modifying a Bandwidth Scaling Policy1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.

3. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Bandwidth Scaling.

4. In the bandwidth scaling policy list, locate the row containing the targetpolicy and click the policy name to switch to its details page.Click Modify in the upper right corner of the page.You can also locate the row containing the target policy, click More in theOperation column, and select Modify.

5. Modify parameters. You can modify the following parameters of a bandwidthscaling policy: Policy Name, EIP, Policy Type, Scaling Action, and CooldownPeriod.

6. Click OK.

NO TE

A bandwidth scaling policy which is being executed cannot be modified.

Deleting a Bandwidth Scaling Policy1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.

Auto ScalingUser Guide 4 AS Management

2021-10-20 66

Page 71: User Guide - docs.otc.t-systems.com

4. In the bandwidth scaling policy list, locate the row containing the targetpolicy, click More in the Operation column, and select Delete.

5. In the displayed Delete Bandwidth Scaling Policy dialog box, click Yes.You can also select one or more scaling policies and click Delete above thelist to delete one or more scaling policies.

NO TE

● You can delete a bandwidth scaling policy when you no longer need it. If you do notneed it only during a specified period of time, you are advised to disable rather thandelete it.

● A bandwidth scaling policy can be deleted only when it is not being executed.

Executing a Bandwidth Scaling PolicyBy executing a bandwidth scaling policy, you can immediately adjust thebandwidth to that configured in the bandwidth scaling policy, instead of having towait until the trigger condition is met.

1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Bandwidth Scaling.4. In the bandwidth scaling policy list, locate the row that contains the target

policy and click Execute Now in the Operation column.5. In the displayed Execute Bandwidth Scaling Policy dialog box, click Yes.

You can also go to the bandwidth scaling policy details page and click ExecuteNow in the upper right corner.

NO TE

● A bandwidth scaling policy can be executed only when the policy is enabled and noother bandwidth scaling policy is being executed.

● Executing a bandwidth scaling policy does not affect automatic adjustment of thebandwidth when the trigger condition of the policy is met.

4.6 AS Group and Instance Monitoring

4.6.1 Health CheckA health check removes abnormal instances from an AS group. Then, AS adds newinstances to the AS group so that the number of instances is the same as theexpected number. There are two types of AS group health check.

● ECS health check: checks ECS instance running status. If an instance isstopped or deleted, it is considered as abnormal. ECS health check is thedefault health check mode for an AS group. The AS group periodically usesthe check result to determine the running status of every instance in the ASgroup. If the health check results show that an instance is unhealthy, ASremoves the instance from the AS group.

Auto ScalingUser Guide 4 AS Management

2021-10-20 67

Page 72: User Guide - docs.otc.t-systems.com

● ELB health check: determines ECS instance running status using a loadbalancing listener. If the AS group uses load balancers, the health checkmethod can also be ELB health check. If you add multiple load balancers toan AS group, an ECS instance is considered to be healthy only when all loadbalancers detect that the instance status is healthy. If any load balancerdetects that an instance is unhealthy, the instance will be removed from theAS group.

In both ECS health check and ELB health check methods, AS removes unhealthyinstances from AS groups. However, the removed instances are processeddifferently in the following two scenarios:

For instances automatically added to an AS group during scaling actions, ASremoves and deletes them. For instances manually added to an AS group, AS onlyremoves them from the AS group.

When an AS group is disabled, checking instance health status continues.However, AS will not remove instances.

4.6.2 Recording AS Resource Operations

Scenarios

AS can use the Cloud Trace Service (CTS) to record resource operations. CTS canrecord operations performed on the management console, operations performedby calling APIs, and operations triggered within the cloud system.

If you have enabled CTS, when a call is made to the AS API, the operation will bereported to CTS which will then deliver the operation record to a specified OBSbucket for storage. With CTS, you can record operations associated with AS forlater query, audit, and backtrack operations.

Obtaining AS Information in CTS

After you enable CTS in the application system, the system logs the API callingoperations performed on AS resources. On the Cloud Trace Service console, youcan view operation records for the last 7 days. To obtain more operation records,you can enable the Object Storage Service (OBS) and synchronize operationrecords to the OBS in real time.

Table 4-9 list the AS operations that can be recorded by CTS.

Table 4-9 AS operations that can be recorded by CTS

Operation Resource Type Trace Name

Creating anAS group

scaling_group createScalingGroup

Modifying anAS group

scaling_group modifyScalingGroup

Deleting anAS group

scaling_group deleteScalingGroup

Auto ScalingUser Guide 4 AS Management

2021-10-20 68

Page 73: User Guide - docs.otc.t-systems.com

Operation Resource Type Trace Name

Enabling anAS group

scaling_group enableScalingGroup

Disabling anAS group

scaling_group disableScalingGroup

Creating anASconfiguration

scaling_configuration createScalingConfiguration

Deleting anASconfiguration

scaling_configuration deleteScalingConfiguration

Deleting ASconfigurationsin batches

scaling_configuration batchDeleteScalingConfiguration

Creating anAS policy

scaling_policy createScalingPolicy

Modifying anAS policy

scaling_policy modifyScalingPolicy

Deleting anAS policy

scaling_policy deleteScalingPolicy

Enabling anAS policy

scaling_policy enableScalingPolicy

Disabling anAS policy

scaling_policy disableScalingPolicy

Executing anAS policy

scaling_policy executeScalingPolicy

Removing aninstance

scaling_instance removeInstance

Removinginstances inbatches

scaling_instance batchRemoveInstances

Addinginstances inbatches

scaling_instance batchAddInstances

Enablinginstanceprotection ina batch

scaling_instance batchProtectInstances

Auto ScalingUser Guide 4 AS Management

2021-10-20 69

Page 74: User Guide - docs.otc.t-systems.com

Operation Resource Type Trace Name

Disablinginstanceprotection ina batch

scaling_instance batchUnprotectInstances

Deleting a tag scaling_tag deleteScalingTag

Creating orUpdating atag

scaling_tag updateScalingTag

Viewing Audit Logs1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Click Service List. Choose Management & Governance > Cloud Trace

Service.4. Click Trace List in the navigation pane on the left.5. You can use filters to query traces. The following filters are available:

– Trace Source, Resource Type, and Search BySelect a filter criterion from the drop-down list.When you select Trace name for Search By, you need to select a specifictrace name.When you select Resource ID for Search By, you need to select or enter aspecific resource ID.When you select Resource name for Search By, you need to select orenter a specific resource name.

– Operator: Select a specific operator (at user level rather than tenantlevel).

– Trace Status: Available options include All trace statuses, normal,warning, and incident. You can only select one of them.

– Time range: In the upper right corner of the page, you can query traces inthe last one hour, last one day, last one week, or within a customizedperiod of time.

6. Click to the left of the required trace to expand its details.7. Locate the required trace and click View Trace in the Operation column. A

dialog box is displayed, showing the trace content.

CTS Log EntriesEach log entry consists of a trace in JSON format. A log entry indicates an AS APIrequest, including the requested operation, the operation date and time, operationparameters, and information about the user who sends the request. The userinformation is obtained from the Identity and Access Management (IAM) service.

The following example shows CTS log entries for the CreateScalingPolicy action:

Auto ScalingUser Guide 4 AS Management

2021-10-20 70

Page 75: User Guide - docs.otc.t-systems.com

{"time": "2016-12-15 15:27:40 GMT+08:00","user": {"name": "xxxx","id": "62ff83d2920e4d3d917e6fa5e31ddebe","domain": {"name": "xxx","id": "30274282b09749adbe7d9cabeebcbe8b"}},"request": {"scaling_policy_name": "as-policy-oonb","scaling_policy_action": {"operation": "ADD","instance_number": 1},"cool_down_time": "","scheduled_policy": {"launch_time": "2016-12-16T07:27Z"},"scaling_policy_type": "SCHEDULED","scaling_group_id": "ec4051a7-6fbd-42d2-840f-2ad8cdabee34"},"response": {"scaling_policy_id": "6a38d488-664b-437a-ade2-dc45f96f7f4c"},"code": 200,"service_type": "AS","resource_type": "scaling_policy","resource_name": "as-policy-oonb","resource_id": "6a38d488-664b-437a-ade2-dc45f96f7f4c","source_ip": "10.190.205.233","trace_name": "createScalingPolicy","trace_rating": "normal","trace_type": "ConsoleAction","api_version": "1.0","record_time": "2016-12-15 15:27:40 GMT+08:00","trace_id": "f627062b-c297-11e6-a606-eb2c0f48bec5"}

4.6.3 Adding Tags to AS Groups and Instances

ScenariosIf you have many resources of the same type, you can use a tag to manageresources flexibly. You can identify specified resources quickly using the tagsallocated to them.

Using a tag, you can assign custom data to each AS group. You can organize andmanage AS groups, for example, classify AS group resources by usage, owner, orenvironment.

Each tag contains a key and a value. You can specify the key and value for eachtag. A key can be a category associated with certain values, such as usage, owner,and environment.

For example, if you want to distinguish the test environment and productionenvironment, you can allocate a tag with the key environment to each AS group.For the test environment, the key value is test and for the productionenvironment, the key value is production. You are advised to use one or moregroups of consistent tags to manage your AS group resources.

After you allocate a tag to an AS group, the system will automatically add the tagto the instances automatically created in the AS group. If you add a tag to an AS

Auto ScalingUser Guide 4 AS Management

2021-10-20 71

Page 76: User Guide - docs.otc.t-systems.com

group or modify the tag, the new tag will be added to the ECSs automaticallycreated in the AS group. Creating, deleting, or modifying the tag of an AS groupwill have no impact on the ECSs in the AS group.

Restrictions of Using Tags

You must observe the following rules when using tags:● Each AS group can have a maximum of 10 tags added to it.● Each tag contains a key and a value.● You can set the tag value to an empty character string.● If you delete an AS group, all tags of it will also be deleted.

Adding a Tag to an AS Group1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.3. Under Computing, click Auto Scaling. In the navigation pane on the left,

choose Instance Scaling. Then click the AS Groups tab.4. Click the AS group name. On the AS group details page, click the Tags tab

and then click Add Tag.5. Set the parameters listed in Table 4-10.

Table 4-10 Tag naming rules

Parameter Requirement Example Value

Tag Key ● The value cannot be empty.● An AS group has a unique key.● A key can contain a maximum of 36

characters, including only digits,letters, hyphens (-), and underscores(_).

Organization

Tag Value ● The value can be an emptycharacter string.

● A key can have only one value.● A tag value can contain a maximum

of 43 characters, including onlydigits, letters, hyphens (-), andunderscores (_).

Apache

6. Click OK.

Modifying or Deleting Tags of an AS Group1. Log in to the management console.

1. Click in the upper left corner to select a region and a project.

Auto ScalingUser Guide 4 AS Management

2021-10-20 72

Page 77: User Guide - docs.otc.t-systems.com

2. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling. Then click the AS Groups tab.

3. Click the AS group name. On the Overview page, click the Tags tab.

4. Locate the row that contains the tag and click Edit or Delete in theOperation column.

After clicking Edit, configure required parameters. For details, see Table 4-10.

After you click Delete, the added tag will be deleted.

4.6.4 Monitoring MetricsTable 4-11 lists the AS metrics supported by Cloud Eye.

Table 4-11 AS metrics

MetricID

Metric Description ValueRange

Monitored Object&Dimension

MonitoringInterval(RawData)

cpu_util CPUUsage

CPU usage of an ASgroupFormula: Total CPUusage of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Percent

≥0% Object:AS groupDimension:AutoScalingGroup

5minutes

mem_util

MemoryUsage

Memory usage of an ASgroupFormula: Total memoryusage of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: PercentNOTE

This metric is unavailableif the image has no OTCTools installed.

≥0% Object:AS groupDimension:AutoScalingGroup

5minutes

instance_num

NumberofInstances

Number of available ECSinstances in an AS groupFormula: Total numberof ECS instances inEnabled state in the ASgroup

≥0 Object:AS groupDimension:AutoScalingGroup

5minutes

Auto ScalingUser Guide 4 AS Management

2021-10-20 73

Page 78: User Guide - docs.otc.t-systems.com

MetricID

Metric Description ValueRange

Monitored Object&Dimension

MonitoringInterval(RawData)

network_incoming_bytes_rate_inband

InbandIncomingRate

Number of incomingbytes per second on anECS in an AS groupFormula: Total inbandincoming rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Byte/s

≥0Byte/s

Object:AS groupDimension:AutoScalingGroup

5minutes

network_outgoing_bytes_rate_inband

InbandOutgoingRate

Number of outgoingbytes per second on anECS in an AS groupFormula: Total inbandoutgoing rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Byte/s

≥0Byte/s

Object:AS groupDimension:AutoScalingGroup

5minutes

disk_read_bytes_rate

DisksReadRate

Number of bytes readfrom an AS group persecondFormula: Total disksread rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Byte/s

≥0Byte/s

Object:AS groupDimension:AutoScalingGroup

5minutes

disk_write_bytes_rate

DisksWriteRate

Number of bytes writtento an AS group persecondFormula: Total diskswrite rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Byte/s

≥0Byte/s

Object:AS groupDimension:AutoScalingGroup

5minutes

Auto ScalingUser Guide 4 AS Management

2021-10-20 74

Page 79: User Guide - docs.otc.t-systems.com

MetricID

Metric Description ValueRange

Monitored Object&Dimension

MonitoringInterval(RawData)

disk_read_requests_rate

DisksReadRequests

Number of readrequests per second sentto an ECS disk in an ASgroupFormula: Total disksread rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Request/s

≥0request/s

Object:AS groupDimension:AutoScalingGroup

5minutes

disk_write_requests_rate

DisksWriteRequests

Number of writerequests per second sentto an ECS disk in an ASgroupFormula: Total diskswrite rates of all ECSinstances in an ASgroup/Number of ECSinstances in the ASgroupUnit: Request/s

≥0request/s

Object:AS groupDimension:AutoScalingGroup

5minutes

NO TE

● The image based on which the target ECS is created must have OTC Tools installed.Otherwise, Memory Usage will be unavailable. For details about how to install the OTCTools, visit https://github.com/UVP-Tools/UVP-Tools/.

● OSs determine whether the Memory Usage, Inband Outgoing Rate, and InbandIncoming Rate metrics are supported. For details, see Elastic Cloud Server User Guide.

4.6.5 Viewing Monitoring Metrics

Scenarios

The cloud platform provides Cloud Eye to help you obtain the running status ofyour ECS instances. This section describes how to view details of AS group metricsto obtain information about the status of the ECS instances in the AS group.

Prerequisites

The ECS is running properly.

Auto ScalingUser Guide 4 AS Management

2021-10-20 75

Page 80: User Guide - docs.otc.t-systems.com

NO TE

● Monitoring metrics such as CPU Usage and Disks Read Rate are available only whenthere is at least one instance in an AS group. If not, only the Number of Instancesmetric is available.

● Monitoring data is not displayed for a stopped, faulty, or deleted instance. After such aninstance restarts or recovers, the monitoring data is available.

Viewing Monitoring Metrics on Auto Scaling1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.

3. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling. Then click the AS Groups tab.

4. On the AS Groups page, find the AS group to view monitoring data and clickits name.

5. Click the Monitoring tab to view the monitoring data.

You can view data of the last one, three, 12, or 24 hours, or last 7 days. If youwant to view data for a longer time range, click View details to go to the

Cloud Eye page, hover your mouse over a graph, and click .

Viewing Monitoring Metrics on Cloud Eye1. Log in to the management console.

2. Click in the upper left corner to select a region and a project.

3. Under Management & Governance, select Cloud Eye.

4. In the navigation pane on the left, choose Cloud Service Monitoring > AutoScaling.

5. Locate the row that contains the target AS group and click View Metric inthe Operation column to view monitoring data.

You can view data of the last one, three, 12, or 24 hours, or last 7 days. Hover

your mouse over a graph and click to view data for a longer time range.

NO TE

It can take a period of time to obtain and transfer the monitoring data. Therefore, wait fora while and then check the data.

4.6.6 Setting Monitoring Alarm Rules

Scenarios

Setting alarm rules allows you to customize the monitored objects and notificationpolicies and determine the running status of your ECS instances at any time.

Auto ScalingUser Guide 4 AS Management

2021-10-20 76

Page 81: User Guide - docs.otc.t-systems.com

Procedure1. Log in to the management console.

2. Click in the upper left corner and select the desired region and project.3. Under Management & Governance, select Cloud Eye.4. In the navigation pane, choose Alarm Management > Alarm Rules.5. On the Alarm Rules page, click Create Alarm Rule to create an alarm rule

for the AS service or modify an existing alarm rule of the AS service.6. After setting the parameters, click Create.

NO TE

● For more information about how to set alarm rules, see Cloud Eye User Guide.● You can create alarm rules on the Cloud Eye console to dynamically expand

resources.

Auto ScalingUser Guide 4 AS Management

2021-10-20 77

Page 82: User Guide - docs.otc.t-systems.com

5 FAQs

5.1 General

5.1.1 What Are Restrictions on Using AS?Only applications that are stateless and can be horizontally scaled can run oninstances in an AS group. AS automatically releases ECS instances. Therefore, theinstances in AS groups cannot be used to save application status information(such as session statuses) and related data (such as database data and logs).

If the application status or related data must be saved, you can store theinformation on separate servers.

Table 5-1 Quotas

Item Description Default

AS group Maximum number of AS groups per region peraccount

25

ASconfiguration

Maximum number of AS configurations perregion per account

100

AS policy Maximum number of AS policies per AS group 50

Instance Maximum number of instances per AS group 200

Bandwidthscalingpolicy

Maximum number of bandwidth scaling policiesper region per account

50

● AS requires authentication provided by Identity and Access Management(IAM).

Auto ScalingUser Guide 5 FAQs

2021-10-20 78

Page 83: User Guide - docs.otc.t-systems.com

The AS administrator account requires permissions of the tenant guest, ECSadministrator, Cloud Eye administrator, and ELB administrator.

NO TE

If the Cloud Eye administrator is not available, you can only use an existing alarm tocreate an alarm policy. If the ELB administrator is not available, you can still useexisting load balancers.

● AS resources must comply with quota requirements listed in Table 5-2.

Table 5-2 Quotas

Item Description Default

AS group Maximum number of AS groups per region peraccount

25

ASconfiguration

Maximum number of AS configurations perregion per account

100

AS policy Maximum number of AS policies per AS group 50

Instance Maximum number of instances per AS group 200

Bandwidthscalingpolicy

Maximum number of bandwidth scalingpolicies per region per account

50

5.1.2 Are ELB and Cloud Eye Mandatory for AS?AS can work independently or work together with ELB and Cloud Eye.

Cloud Eye does not require additional fees and is enabled by default. You canenable the ELB service when required. For example, if distributed clusters arerequired, you can enable the ELB service.

5.1.3 Does an Abrupt Change on Monitoring Indicator ValuesCause an Incorrect Scaling Action?

No. Monitoring data used by AS is from Cloud Eye. The monitoring interval ofCloud Eye can be set to 5 minutes, 20 minutes, or 1 hour. Therefore, an abruptchange of monitoring indicator values will not cause an incorrect scaling action.

In addition, AS allows you to configure the cooldown period to preventunnecessary scaling actions caused by frequently reported alarms. You cancustomize the cooldown period.

5.1.4 How Many AS Policies and AS Configurations Can ICreate and Use?

You can create up to 25 AS groups and 100 AS configurations by default. An ASgroup supports 1 AS configuration and 50 AS policies at a time.

Auto ScalingUser Guide 5 FAQs

2021-10-20 79

Page 84: User Guide - docs.otc.t-systems.com

If the default configurations fail to meet your service requirements, contact theadministrator.

5.1.5 Can AS Automatically Scale Up or Down vCPUs, Memory,and Bandwidth of ECSs?

Currently, AS can automatically scale up or down bandwidths, and scale in or outECS instances in an AS group.

5.1.6 What Is the AS Quota?

What Is Quota?

Quotas are enforced for service resources on the platform to prevent unforeseenspikes in resource usage. Quotas can limit the number or amount of resourcesavailable to users, for example, how many AS groups you can create. You canapply for increasing quotas if necessary.

This section describes how to view the usage of each type of AS resource and thetotal quotas in a specified region.

How Do I View My Quotas?1. Log in to the management console.

2. Click in the upper left corner and select the desired region and project.

3. In the upper right corner of the page, click .The Service Quota page is displayed.

4. View the used and total quota of each type of resources on the displayedpage.If a quota cannot meet service requirements, apply for a higher quota.

5.1.7 What Can I Do If a Message Displayed Indicating thatthe Key Pair Does Not Exist When I Connect to an Instance?

A key pair is specific to each user. If the key pair of a user who is under the sameaccount as you is configured in an AS configuration, you cannot use the ASconfiguration to manually provision resources.

If you want to perform operations on such an AS configuration, let the userchoose password authentication as the login mode.

5.2 AS Group

5.2.1 What Can I Do If the AS Group Fails to Be Enabled?See section "How Can I Handle an AS Group Exception?"

Auto ScalingUser Guide 5 FAQs

2021-10-20 80

Page 85: User Guide - docs.otc.t-systems.com

5.2.2 How Can I Handle an AS Group Exception?The handling method varies depending on the possible cause.

● Issue description: Insufficient quota for ECSs, EVS disks, or EIPs.Possible cause: insufficient quotaHandling method: Increase the quota or delete unnecessary resources, andthen enable the AS group.

● Issue description: The VPC or subnet does not exist.Possible cause: The VPC service encounters an exception or resources havebeen deleted.Handling method: Wait until the VPC service recovers, or modify parametersof the VPC and subnet in the AS group, and then enable the AS group.

● Issue description: The ELB listener or backend ECS group does not exist, andthe load balancer is unavailable.Possible cause: The ELB service encounters an exception or resources havebeen deleted.Handling method: Wait until the ELB service recovers, or modify load balanceparameters in the AS group, and then enable the AS group.

● Issue description: The number of backend ECSs that you add to the ELBlistener exceeds the upper limit.Possible cause: If classical load balancer is used by an AS group, instancesadded to the AS group are automatically added to the ELB listener. Amaximum of 300 backend ECSs can be added to an ELB listener.Handling method: Remove the backend ECSs that are both not required andnot in the AS group from the listener. Then enable the AS group.

● Issue description: The image used by the AS configuration, the flavor, or thekey pair does not exist.Possible cause: Resources have been deleted.Handling method: Change the AS configuration for the AS group and thenenable the AS group.

● Issue description: The subnet you select does not have enough private IPaddresses.Possible cause: Private IP addresses in the subnet used by the AS group havebeen used up.Handling method: Modify the subnet information and enable the AS group.

● Issue description: The ECS resources of this type in the selected AZ have beensold out.Possible cause: ECSs of this type have been sold out or are not supported inthe AZ selected for the AS group. ECSs of this type are the ECS flavor selectedin the AS configuration.Handling method: Change the AS configuration for the AS group and thenenable the AS group. If there is no instance in the AS group, you can alsochange the AZ for the AS group and then enable the AS group.

● Issue description: The selected specifications and the disk do not match.Possible cause: The ECS type in the AS configuration does not match the disktype, leading to the ECS creation failure.

Auto ScalingUser Guide 5 FAQs

2021-10-20 81

Page 86: User Guide - docs.otc.t-systems.com

Handling method: Change the AS configuration for the AS group and thenenable the AS group.

● Issue description: The selected specifications and the image do not match.Possible cause: The ECS type in the AS configuration does not match theimage, leading to the ECS creation failure.Handling method: Change the AS configuration for the AS group and thenenable the AS group.

● Issue description: Storage resources of this type have been sold out in theselected AZ.Possible cause: Storage resources of this type have been sold out or are notsupported in the AZ selected for the AS group. Storage resources of this typerefer to the system and data disk types selected for the AS configuration.Handling method: Change the AS configuration for the AS group and thenenable the AS group. If there is no instance in the AS group, you can alsochange the AZ for the AS group and then enable the AS group.

● Issue description: A system error has occurred.Possible cause: An error has occurred in the AS service, peripheral service, ornetwork.Handling method: Try again later or contact technical support.

● Issue description: The specification defined in the AS configuration isunavailable.Handling method: Change specifications by creating an AS configuration asprompted by the error message and use this AS configuration for the ASgroup. Then enable the AS group.

● Issue description: The selected AS configuration cannot be used by the ASgroup.Handling method: Create an AS configuration as prompted by the errormessage and use this AS configuration for the AS group. Then enable the ASgroup.

5.2.3 What Operation Will Be Suspended After an AS Group IsDisabled?

After an AS group is disabled, the group will not automatically any trigger scalingactions, but the on-going scaling action will continue. Scaling policies will nottrigger any scaling actions. After you manually change the number of expectedinstances, no scaling action is triggered although the number of actual instances isnot equal to that of expected instances.

The health check continues to check the health status of the instances but doesnot remove the instances.

5.2.4 Can I Use an ECS ID to Obtain the AS GroupAccommodating the ECS?

No.

To obtain details about an AS group and the ECSs in the group, perform thefollowing operations:

Auto ScalingUser Guide 5 FAQs

2021-10-20 82

Page 87: User Guide - docs.otc.t-systems.com

Step 1 Log in to the AS console.

Step 2 On the AS Groups tab page, click the name of the target AS group.

Step 3 Click the Instances tab to view the instances in the AS group.

----End

5.3 AS Policy

5.3.1 How Many AS Policies Can Be Enabled?Enable one or more AS policies as required.

5.3.2 What Are the Conditions to Trigger an Alarm in the ASPolicy?

Alarms will be triggered by metrics of CPU Usage, Memory Usage, InbandIncoming Rate, Inband Outgoing Rate, Disk Read Rate, Disk Write Rate, Disk ReadRequests, and Disk Write Requests. These alarms will in turn trigger the policy toincrease or decrease instances in the AS group.

5.3.3 What Is a Cooldown Period? Why Is It Required?A cooldown period is a period of time after each scaling action is complete.During the cooldown period, scaling actions triggered by alarms will be denied.Scheduled and periodic scaling actions are not restricted.

Before an instance is added to the AS group, it requires 2 to 3 minutes to executethe configuration script to install and configure applications. The time variesdepending on many factors, such as the instance specifications and startup scripts.Therefore, if an instance is put into use without cooldown after started, the systemwill continuously increase instances until the load decreases. After the newinstances take over services, the system detects that the load is too low anddecreases instances in the AS group. A cooldown prevents the AS group fromrepeatedly triggering unnecessary scaling actions.

The following uses an example to introduce the cooling principles:

When a traffic peak occurs, an alarm policy is triggered. In this case, ASautomatically adds an instance to the AS group to help handle the addeddemands. However, it takes several minutes for the instance to start. After theinstance is started, it takes a certain period of time to receive requests from ELB.During this period, alarms may be triggered continuously. As a result, an instanceis added each time an alarm is triggered. If you set a cooldown time, after aninstance is started, AS stops adding new instances according to the alarm policyuntil the specified period of time (300 seconds by default) passes. Therefore, thenewly started instance has time to start processing application traffic. If an alarmis triggered again after the cooldown period elapses, AS starts another instanceand the cooldown period takes effect again.

Auto ScalingUser Guide 5 FAQs

2021-10-20 83

Page 88: User Guide - docs.otc.t-systems.com

5.3.4 What Monitoring Metrics for an AS Group Will BeAffected If OTC Tools Are Not Installed on ECSs?

If OTC Tools have not been installed on ECSs, Cloud Eye can monitor the OutbandIncoming Rate and Outband Outgoing Rate. However, it cannot monitor theMemory Usage, Inband Incoming Rate, and Inband Outgoing Rate, which reducesdata accuracy of the CPU usage.

For details about monitoring metrics supported by AS, see Table 1-4.

If OTC Tools are not installed on ECSs, AS cannot obtain the memory usage,inband incoming rate, and inband outgoing rate.

5.3.5 What Can I Do If an AS Policy Fails to Be Enabled?● Description: The alarm rule does not exist.

Possible cause: The alarm rule used in the alarm policy is deleted.Handling method: Change the alarm rule used in the alarm policy and enablethe AS policy again.

● Description: The triggering time of the periodic policy falls outside theeffective time range of the policy.Possible cause: The effective time of the periodic policy has expired.Handling method: Change the start time and end time of the periodic policyand enable the policy again.

● Description: The triggering time of the scheduled policy must be later thanthe current time.Possible causes: The triggering time of the scheduled policy has expired.Handling method: Change the triggering time of the scheduled policy andenable the policy again.

● Description: A system error has occurred.Handling method: Try again later or contact technical support.

5.4 Instance

5.4.1 How Do I Prevent Instances Manually Added to an ASGroup from Being Removed Automatically?

If you have manually added N instances into an AS group and do not want theseinstances to be removed automatically, you can use either of the followingmethods to ensure this:

Method 1

Perform following configurations in the AS group:

● Set the minimum number of instances in the AS group to N or greater thanN.

Auto ScalingUser Guide 5 FAQs

2021-10-20 84

Page 89: User Guide - docs.otc.t-systems.com

● Set Instance Removal Policy to Oldest instance created from oldest ASconfiguration or Newest instance created from oldest AS configuration.

Based on the scaling rules, the manually added instances do not correspond toany AS configuration (because they are not created using the AS configuration).Therefore, the instances automatically created using the AS configuration areremoved at first. Only when such instances are removed, the instances manuallyadded are removed. Since you have set the minimum number of instances to N orgreater than N, the instances manually added are not selected.

Note: If the instances manually added are stopped or they malfunction, they areregarded as unhealthy and removed from the AS group. This is because healthcheck ensures that instances in the AS group must be healthy.

Method 2

Enable instance protection for the N instances. For details, see ConfiguringInstance Protection.

You can enable instance protection for the N instances at the same time. When anAS group reduces the capacity, protected instances will not be removed from theAS group. Note: Instances that fail to pass a health check will still be removedfrom the AS group.

5.4.2 Will the Application Data on an Instance Be RetainedAfter the Instance Is Removed from an AS Group andDeleted?

No. AS automatically releases ECS instances. You must ensure that instances in theAS group do not store application status information or important data, such assessions, databases, and logs. If you want to store your application status, you canstore it on an independent server (such as ECS) or database (such as RDSdatabase).

5.4.3 Can Instances that Have Been Added Based on an ASPolicy Be Automatically Deleted When They Are No LongerNeeded?

Yes. They can be automatically deleted if one AS policy has been added to triggerscaling actions to delete the instance.

5.4.4 What Is the Expected Number of Instances?The expected number of instances refers to the number of ECSs that are expectedto run in an AS group. It is between the minimum number of instances and themaximum number of instances. You can manually change the expected number ofinstances or change it based on the scheduled, periodic, or alarm policies.

You can set this parameter when creating an AS group. If this value is greater than0, a scaling action is performed to add the required number of ECSs after the ASgroup is created. You can also change this value manually or by scaling policiesafter the AS group is created.

Auto ScalingUser Guide 5 FAQs

2021-10-20 85

Page 90: User Guide - docs.otc.t-systems.com

If you manually change this value, the current number of ECSs is not consistentwith the expected number. A scaling action is performed to adjust the number ofECSs to the expected number.

If a scaling policy is triggered to add two ECSs to the AS group, the system willadd two to the expected number. Then, a scaling action is performed to add twoECSs so that the number of ECSs in the AS group is the same as the expectednumber.

5.4.5 How Do I Delete an ECS Created in a Scaling Action?

Handling Methods

Method 1

1. Log in to the management console.

2. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

3. Click the target AS group name on the AS Groups page.

4. On the AS group details page, click the Instances tab.

5. Locate the row that contains the target instance and click Remove andDelete in the Operation column.

NO TE

To delete multiple instances, select the check boxes in front of them and click Removeand Delete.

Method 2

1. Log in to the management console.

2. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

3. Click the target AS group name on the AS Groups page.

4. On the AS group details page, click the AS Policies tab.

5. Click Add AS Policy. In the displayed Add AS Policy dialog box, add an aspolicy to reduce instances as needed or set the number of instances to aspecified value.

Method 3

1. Log in to the management console.

1. Under Computing, click Auto Scaling. In the navigation pane on the left,choose Instance Scaling.

2. Click the target AS group name on the AS Groups page.

3. On the AS group details page, click Modify in the upper right corner.

4. In the displayed Modify AS Group dialog box, change the value of ExpectedInstances.

Auto ScalingUser Guide 5 FAQs

2021-10-20 86

Page 91: User Guide - docs.otc.t-systems.com

5.4.6 How Should I Handle Unhealthy Instances in an ASGroup?

In normal cases, you do not need to handle unhealthy instances because the ASservice periodically checks the health status of instances in an AS group. When anAS group is enabled, unhealthy instances are removed and new instances arecreated to ensure that the number of expected instances is the same as currentinstances. When an AS group is disabled, checking instance health statuscontinues. However, AS will not remove instances.

It should be noted that if the ELB health check mode is selected, ELB sendsheartbeat messages to backend ECSs through an intranet. Therefore, to ensurethat the ELB health check can run properly, ensure that your ECS can be accessedthrough an intranet. Perform the following steps to check this:

1. In the Listener area, locate the row containing the target listener and clickView in the Health Check column. A dialog box is displayed.– Health Check Protocol: Ensure that the protocol has been configured

and port has been enabled for the ECS to be checked.– Check Path: If HTTP is used for the health check, ensure that the health

check path for backend ECSs is correct.2. Check whether software (such as firewall) on the ECS masks the source IP

address performing the health check.3. Check whether the rules of backend ECS security groups and network ACL

allow access by 100.125.0.0/16, and configure the protocol and port used forhealth check. Obtain the health check protocol and port from the dialog boxdisplayed in step 1.– If the default health check mode is used, service ports of the backend

ECSs must be enabled.– If the health check port is different from service ports of the ECSs,

communication between the service ports of the ECSs and health checkport must be enabled.

4. If the issue persists, contact technical support.

5.4.7 What Can I Do If Instances in an AS Group FrequentlyFail in Health Checks and Are Deleted and Then CreatedRepeatedly?

The security group rule of the instance must allow communication with the100.125.0.0/16 network, and the protocol and port number must be the same asthose used by ELB for health checks. Otherwise, the health check will fail. As aresult, the instances will be deleted and created again and again.

5.4.8 How Do I Prevent Instances from Being Removed froman AS Group Automatically?

You can enable instance protection for in-service instances in an AS group. Afterthe configuration, when AS automatically reduces the number of instances in anAS group, the in-service instances with instance protection enabled will not beremoved. You can also set the minimum number of instances for an AS group and

Auto ScalingUser Guide 5 FAQs

2021-10-20 87

Page 92: User Guide - docs.otc.t-systems.com

the instance removal policy to ensure that an AS group has some in-serviceinstances.

Unhealthy instances are removed from an AS group and new instances arecreated. Therefore, do not stop or delete instances that have been added to an ASgroup on the ECS console. The stopped or deleted instances are consideredunhealthy and automatically removed from the AS group. Even when an AS groupis disabled, AS checks the status of instances in the AS group. In this case,however, unhealthy instances will not be removed from the AS group.

5.4.9 Why Is an Instance Removed and Deleted from an ASGroup Still Displayed in the ECS List?

If an instance automatically added to an AS group is protected, it is only removedout of the AS group, but not deleted, so that it can still be used by other services.

An instance that is being used by other services are protected generally. Forexample, an instance is used by IMS for creating a private image, or used bystorage DR.

5.5 Others

5.5.1 How Can I Automatically Deploy My Application on anInstance?

To enable automatic application deployment on instances automatically added toan AS group, you need to create a private image which contains applicationsoftware and automatic startup settings. When creating an AS group, select theprivate image you have created for the AS configuration. In this way, applicationswill be automatically deployed on instances that are added to the AS group. Theprocedure is as follows:

1. Before creating a private image, install the application and set it toautomatically start upon system startup on the ECS instance which you willuse to create the private image.

2. Create a private image. For details, see Image Management Service UserGuide.

3. Create an AS configuration. For details, see Creating an AS Configurationfrom a New Specifications Template. Ensure that the image in the ASconfiguration is the private image created in 2.

4. Click the AS Groups tab and then click the name of the target AS group.5. Click Change Configuration to the right of Configuration Name. In the

displayed dialog box, select the AS configuration created in 3 and click OK.After new instances are added to the AS group in the next scaling action, youcan check whether the required application has been installed on theinstances. If any issue occurs, contact technical support.

Auto ScalingUser Guide 5 FAQs

2021-10-20 88

Page 93: User Guide - docs.otc.t-systems.com

5.5.2 Why Cannot I Use a Key File to Log In to an ECS?

Issue DescriptionWhen I used a key file to attempt to log in to an instance in an AS group, thelogin failed.

Possible CausesThe image in the AS configuration of the AS group is your private one, and theCloud-Init tool had not been installed when you created the private image.

If the Cloud-Init tool had not been installed when you created a private image,you would fail to customize the ECS configuration. In such a case, you can log into the ECS only using the original image password or key pair.

Handling Method1. Check whether the ECS must be logged in to.

– If yes, use the original image password or key pair to log in to this ECS.The original image password or key pair is the OS password or key pairconfigured when the private image was created.

– If no, go to step 2.2. Changing the AS configuration for the AS group. For details, see Changing

the AS Configuration for an AS Group.

NO TE

Make sure that the Cloud-Init or Cloudbase-Init tool has been installed in the image of themodified AS configuration. For instructions about how to install the Cloud-Init orCloudbase-Init tool, see Image Management Service User Guide.

After the AS configuration is modified, you can use the key file to log in to thenew ECSs that are added when the AS action is performed in the AS group. In sucha case, you do not need to use the original image password or key pair to log in tothe new ECSs any more.

5.5.3 Do I Need to Configure an EIP in an AS ConfigurationWhen a Load Balancer Has Been Enabled in an AS Group?

No. If you have enabled a load balancer in an AS group, you do not have toconfigure an EIP in the AS configuration. The system automatically adds instancesin the AS group to the load balancer. These instances will provide services via theEIP bound to the load balancer.

5.5.4 How Can I Enable Automatic Initialization of EVS Disksof Instances that Have Been Added in a Scaling Action to anAS Group?

ScenariosAfter an ECS instance is created, EVS disks attached to the instance must beinitialized. If multiple instances are added to the AS group in scaling actions, you

Auto ScalingUser Guide 5 FAQs

2021-10-20 89

Page 94: User Guide - docs.otc.t-systems.com

must manually initialize the EVS disks of each instance, which requires a longperiod of time.

This section describes how to configure scripts to enable automatic initialization ofEVS disks, including disk partitioning and attaching specified directories. Thescripts can only be used to initialize one EVS disk.

This section uses CentOS 6.5 as an example. For details about how to configureDHCP on other OSs, see the relevant OS documentation.

Procedure1. Log in to the instance as user root.2. Run a command to switch to the directory storing the script:

cd /script directoryAn example is as follows:cd /home

3. Run the following command to create a script:vi script nameAn example is as follows:vi fdisk_mount.sh

4. Press i to go to the script editing page.The following script is used as an example to show how to implementautomatic initialization of one data disk:#!/bin/bash bash_scripts_name=fdisk_mount.sh ini_path=/home/fdisk.ini disk= size= mount= partition= function get_disk_from_ini() { disk=`cat $ini_path|grep disk| awk -F '=' '{print $2}'` if [ $disk = "" ] then echo "disk is null in file,exit" exit fi result=`fdisk -l $disk | grep $disk` if [ $result = 1 ] then echo "disk path is not exist in linux,exit" exit fi } function get_size() { size=`cat $ini_path| grep size|awk -F '=' '{print $2}'` if [ $size = "" ] then echo "size is null,exit" exit fi }

Auto ScalingUser Guide 5 FAQs

2021-10-20 90

Page 95: User Guide - docs.otc.t-systems.com

function make_fs_mount() { mkfs.ext4 -T largefile $partition if [ $? -ne 0 ] then echo "mkfs disk failed,exit" exit fi dir=`cat $ini_path|grep mount |awk -F '=' '{print $2}'` if [ $dir = "" ] then echo "mount dir is null in file,exit" exit fi if [ ! -d $dir ] then mkdir -p $dir fi mount $partition $dir if [ $? -ne 0 ] then echo "mount disk failed,exit" exit fi echo "$partition $dir ext3 defaults 0 0" >> /etc/fstab } function remove_rc() { cat /etc/rc.local | grep $bash_scripts_name if [ $? ne 0 ] then sed -i '/'$bash_scripts_name'/d' /etc/rc.local fi } ################## start ####################### ##1. Check whether the configuration file exists.if [ ! -f $ini_path ] then echo "ini file not exist,exit" exit fi ##2. Obtain the device path for the specified disk from the configuration file.get_disk_from_ini ##3. Obtain the size of the size partition from the configuration file.get_size ##4. Partition the disk.fdisk $disk <<EOF n p 1 1 $size w EOF partition=`fdisk -l $disk 2>/dev/null| grep "^/dev/[xsh].*d" | awk '{print $1}'` ##5. Format the partition and attach the partition to the specified directory.make_fs_mount ##6. Change startup items to prevent re-execution of the scripts.

Auto ScalingUser Guide 5 FAQs

2021-10-20 91

Page 96: User Guide - docs.otc.t-systems.com

remove_rc echo 'SUCESS'

5. Press Esc, enter :wq, and press Enter to save the changes and exit.6. Run the following command to create the configuration file:

vi fdisk.ini7. Press i to go to the file editing page.

The drive letter, size, and directory of the EVS disk are configured in theconfiguration file. You can change the settings based on the followingdisplayed information.disk=/dev/xdev size=+100G mount=/opt/test

8. Press Esc, enter :wq, and press Enter to save the changes and exit.9. Run the following command to open configuration file rc.local:

vi /etc/rc.local10. Press i to add the following content to the rc.local file:

/home/fdisk_mount.shAfter the rc.local file is configured, the EVS disk initialization script will beautomatically executed when the ECS starts.

11. Press Esc, enter :wq, and press Enter to save the changes and exit.12. Create a private image using an ECS.13. Create an AS configuration.

When you specify the AS configuration information, select the private imagecreated in the preceding step and select an EVS disk.

14. Create an AS group.When you configure the AS group, select the AS configuration created in thepreceding step.After the AS group is created, EVS disks of new instances added in scalingactions to this AS group will be automatically initialized based on theconfiguration in the private image.

Auto ScalingUser Guide 5 FAQs

2021-10-20 92

Page 97: User Guide - docs.otc.t-systems.com

A Change History

Released On Description

2021-10-20 This release incorporates the following changes:Modified the following content:● Optimized the description of AS group parameters in

sections Creating an AS Group Quickly and Creating anAS Group.

● Optimized the description of AS configuration parametersin sections Creating an AS Configuration from anExisting ECS Instance and Creating an AS Configurationfrom a New Specifications Template.

2020-10-19 This release incorporates the following changes:Added section "Access Methods".

2019-04-18 Accepted in OTC-4.0/Agile-05.2019.

2019-04-09 Added the following content:● Added viewing historical scaling actions in Viewing a

Scaling Action.● Added link from AS and Other Services to Scheduled

Scaling.Modified the following content:Modified description of parameter Enterprise Project inCreating an AS Group Quickly.

Auto ScalingUser Guide A Change History

2021-10-20 93

Page 98: User Guide - docs.otc.t-systems.com

Released On Description

2019-02-28 Added the following content:● Added description of parameter Enterprise Project.● Added Overview.● Added Creating an AS Policy.● Added Managing a Bandwidth Scaling Policy.● Added execution of a bandwidth scaling policy in

Managing a Bandwidth Scaling Policy.Modified the following content:● Optimized content about the AS policy and bandwidth

scaling policy.● Optimized Dynamic Scaling and Scheduled Scaling.● Modified descriptions and pictures in What Is Auto

Scaling?● Presented the relationship between services in a table in

AS and Other Services.● Modified the method for viewing a scaling action in

Viewing a Scaling Action.● Modified the link from Creating an AS Group to Creating

an AS Policy.Deleted the following sections:● Enabling a Bandwidth Scaling Policy● Disabling a Bandwidth Scaling Policy● Modifying a Bandwidth Scaling Policy● Deleting a Bandwidth Scaling Policy

2019-01-31 Modified the following content:● Organized FAQs by category.● Added FAQs What Is the Expected Number of

Instances?, What Operation Will Be Suspended After anAS Group Is Disabled?, What Can I Do If Instances in anAS Group Frequently Fail in Health Checks and AreDeleted and Then Created Repeatedly?, What Are theConditions to Trigger an Alarm in the AS Policy?, andDo I Need to Configure an EIP in an AS ConfigurationWhen a Load Balancer Has Been Enabled in an ASGroup?

● Optimized FAQs How Can I Automatically Deploy MyApplication on an Instance? and What Is a CooldownPeriod? Why Is It Required?

2018-09-14 Accepted in OTC-3.2.

Auto ScalingUser Guide A Change History

2021-10-20 94

Page 99: User Guide - docs.otc.t-systems.com

Released On Description

2018-08-30 Modified the following content:● The cooldown period starts after a scaling action is

complete and the default cooldown period is 300 seconds.● Added FAQ "What Is a Cooldown Period? How Is It

Calculated?"● Added the application scenarios of the scaling bandwidth

in Bandwidth Scaling.● Optimized values of parameter EIP in Creating an AS

Configuration from an Existing ECS Instance andCreating an AS Configuration from a New SpecificationsTemplate.

● Optimized some UI strings and operation steps.

2018-08-21 Modified the following content:Optimized content in Setting Up an Automatically ScalableDiscuz! Forum, Creating an AS Group Quickly, DynamicScaling, Creating a Bandwidth Scaling Policy, and HealthCheck.

2018-07-30 Modified the following content:● Added the bandwidth scaling feature.● Added parameter Security Group to "Using a New

Template to Create an AS Configuration".● Added FAQ "Will the Data on an Instance Be Retained

After the Instance Is Removed from an AS Group andDeleted?"

● Added 10s and 1 min as new options for the health checkinterval in Creating an AS Group.

2018-06-30 Modified the following content:● Added FAQ "What Can I Do If an AS Policy Fails to Be

Enabled?"● Added FAQ "How Do I Prevent ECSs in an AS Group from

Being Removed Automatically?"

2018-05-30 Modified the following content:● Added "View Audit Logs" to Recording AS Resource

Operations.● Added Monitoring Metrics.● Added Viewing Monitoring Metrics.● Added Setting Monitoring Alarm Rules.● Added FAQ "What Can I Do If the AS Group Fails to Be

Enabled?"● Added FAQ "How Should I Handle Unhealthy Instances in

an AS Group?"

Auto ScalingUser Guide A Change History

2021-10-20 95

Page 100: User Guide - docs.otc.t-systems.com

Released On Description

2018-04-30 Modified the following content:● Added FAQ "How Do I Delete an ECS Created in a Scaling

Action?"

2018-03-30 Modified the following content:● Optimized description of the instance health check.

2018-01-30 Modified the following content:● Added description of forcible AS group deletion.● Added description of classic and enhanced ELB.

2017-11-30 Modified the following content:● Added AS metrics.● Added the function of expanding or reducing the number

of instances in an AS group according to the percentagepreset in the AS policy.

2017-09-30 Modified the following content:● Added a section for instance protection.● Added a section for best practices.

2017-07-30 Modified the following content:● Optimized the wizard-based AS group creation process.

You must create or use an existing AS configuration aftercreating an AS group.

● Added Change AS Configuration in the More drop-downlist and View AS Policy in the Operation column on theAS Groups page.

● Added the function of marking AS groups and instances.● Optimized "Creating an AS Group Quickly" and "Creating

an AS Group".● Supported multiple projects.

2017-03-30 Added the following content:User permissions

2017-01-20 Added the following content:● Added license type selection during AS configuration

creation.● Supported private image encryption and optional data disk

encryption as well as encryption mode configurationduring AS configuration creation.

2016-12-30 Added the following content:● Added parameter EIP for configuring an AS configuration.● Added parameter AZ for configuring an AS group.

Auto ScalingUser Guide A Change History

2021-10-20 96

Page 101: User Guide - docs.otc.t-systems.com

Released On Description

2016-10-19 Added the following content:Added Cloud-Init.

2016-07-15 Added the following content:Added the image type: shared image.

2016-03-14 This issue is the first official release.

Auto ScalingUser Guide A Change History

2021-10-20 97

Page 102: User Guide - docs.otc.t-systems.com

B Glossary

For details about the terms involved in this document, see Glossary.

Auto ScalingUser Guide B Glossary

2021-10-20 98