Creating a Scaling Plan
Last updated: 2020-02-25 15:22:15PDF
To create a complete AS plan, go through the three steps below:
Here we demonstrate creating AS plan in the console. If you prefer using APIs, see API Usage Sample .
Creating a Launch Configuration
A launch configuration defines the information that is required for a scaling group to launch CVM (Cloud Virtual Machine) instances. The information includes CVM's image, storage, network, security group, and login method.
Creating a launch configuration is Free of charge .
- Log in to the AS console .
- In the left sidebar, click Launch Configuration To go to the launch configuration management page.
Selecting a Region
- Select the project and region for the launch configuration, as shown below:
In the upper part of the console, select the target region. CVM instances and CLB instances must be the same region as the one specified for the launch configuration. For example, if Guangzhou is specified for the launch configuration, only CVM instances in Guangzhou will be automatically added to the scaling group. For a scaling group in Guangzhou, you cannot add CVM instances or bind CLB instances in any region (e.g., Shanghai, Beijing, Hong Kong (China), Toronto) other than Guangzhou.
- Click [Create], in the pop-up page Enter Launch configuration basic information.
Selecting a Model
On the "Create instance" page, Enter Launch configuration name, select availability zone, select Model. as shown below:
- Enter a name for your launch configuration.
- Select the same model as the CVM instance that you want to bind to the scaling group.
Selecting an Image
When creating a launch configuration, you can use either public or custom image.
We recommend using a "custom image" where the application environment has already been set up.
- If you select a public image, the CVM instances created in a scaling group will have a "clean" operating system-you need to manually set up the application environment.
- Custom image enables batch production. You can create an image of a CVM instance with application environment deployed, and then use the image to batch create many CVM instances which will have the same application environment as the original instance.
For more information about how to create a CVM instance bound to a scaling group, see Creating a Custom Image .
Selecting Storage and Bandwidth
On the "3. Select storage and bandwidth" page, choose the disk and network.
If you specify a CBS (Cloud Block Storage) disk as the system disk, then you can create a data disk using data disk snapshots.
Disk data snapshot makes it easier to store Big data:. When data disk A creates a snapshot file, users can use the snapshot file to quickly clone multiple disks to achieve the purpose of rapid deployment of the server.
When a new CVM instance is added to Auto Scaling, if you've specified a snapshot for the data disk in launch configuration, CBS automatically mounts a data disk in the launched CVM instance to copy data.
In this case, the data disk must be correctly mounted in the CVM instance to automatically scale out the scaling group.. To auto-mount data disk in a new CVM instance, some additional operations on snapshot's original instance are required before setting up the automatic scaling. For more information, please see: The method of automatically mounting a data disk when using Custom image and the new instance of Launch snapshot of the data disk .
AS is free of charge, but the added CVM instances, disks and networks are pay-as-you-go. Prices will be shown based on your configurations.
- In "4. On the set Security Group and Host page, select the login method and security group. By default, Auto Scaling-created CVM instances are protected by Cloud Security and Cloud Monitor for free. as shown below:
- After the configuration is completed, you will see an entry on the launch configuration list,
Creating a Scaling Group
A scaling group contains a collection of CVM instances that follow the same policies and have a shared purpose.
- Log in to the AS console .
- In the left sidebar, click Scaling Group To go to the scaling group management page.
Creating a Scaling Group
- Click [Create], in the pop-up page Enter Scaling group basic information. among Required. as shown below:
- A scaling group maintains the number of CVM instances too meet the desired capacity between the minimum and maximum capacity values.
- The starting instance quantity defines the default number of CVM instances in the scaling group.
- If a scaling group has a number of CVM instances less than the minimum scaling capacity value, it will automatically increase the number of instances to meet the minimum condition.
- If a scaling group has a number of CVM instances greater than the maximum scaling capacity value, it will automatically terminate instances until the number of instances is equal to the maximum value allowed.
- Select an existing launch configuration or create a new one.
- Select the network, availability zone, and removal policy.
- (Optional) Associate with an existing CLB instance or create a new one.
After the configuration is completed, you will see this entry on the scaling group list,
Add instance (optional)
Add the instance we want to bind to the instance list. After the configuration is completed, you will see this entry on the launch configuration list, as shown below:
If you are unable to add/remove a CVM instance to/from the list, please check the maximum and minimum capacity values you specified.
Creating a Scaling Policy
You can use scaling policies to increase or decrease the number of CVM instances in your scaling group:
- Create a Scheduled action To perform scheduled scaling, which can be set to run periodically.
- Create an Alarm trigger policy To perform scaling adjusted by Cloud Monitor metrics (e.g., CPU utilization and memory usage).
Creating a Scheduled Scaling Action
Scheduled Scaling works better in business scenarios where volume is stable and predictable. You can use it to automatically add/remove CVM instances at a specified point of time or periodically to meet changing needs, increase machine utilization, and reduce expenses on deployment and instances.
- On the Scaling group Page, click "Scaling group" to go to the scaling group management page.
- Select the "Scheduled Action" tab and click CREATE .
- Specify the timing job name, execution time and execution activities and other information on the Create page. You can also select Duplicate to run the scheduled action on a periodic basis.
- After the configuration is completed, you will see the created scheduled action on the list,
Creating an Alarm Trigger Policy
If you want to adjust the scaling based on CVM metrics, you can create an alarm-triggered policy. This policy helps you automatically adjust (increase or decrease) the number of instances in your scaling group to handle dynamic volumes, increase machine utilization, and reduce expenses on deployment and instances.
- By default, a ping is created in a scaling group to trigger the alarm that tells you to replace unhealthy servers.
- Before using the alarm trigger policy, you need to install a new version of Cloud Monitor Agent in Image of CVM. Installation method see synonyms at installation Install the monitoring component .
- On the Scaling group Page, click a Scaling group ID to go to the scaling group management page.
- Select the "Alarm Trigger Policy" tab and click CREATE .
- Set the Alarm Trigger Policy. When the Alarm Trigger policy is in effect, the scaling group adjusts the number of instances or the percentage of the instance by Cloud Monitor metrics (e.g., CPU utilization, memory usage, and bandwidth).
You can also copy the policy to another scaling group.
- After the configuration is completed, you will see the created alarm trigger policy on the list on the page.