1. Home
  2. Training Library
  3. Alibaba Cloud
  4. Courses
  5. Using Auto Scaling to Support Your Alibaba Cloud Workloads

Scaling Configuration


Start course

This course explores Alibaba Auto Scaling. We'll look at the main applications of the Auto Scaling service and you'll follow along with practical demonstrations direct from the Alibaba Cloud platform to learn how to use each auto scaling service.

Learning Objectives

  • Get a basic understanding of Alibaba Auto Scaling
  • Learn about key auto scaling concepts
  • Understand the core functions of auto scaling, including scaling group,s scaling configurations, and scaling rules
  • Learn how to trigger scaling manually and how to create triggers for automatic scaling events

Intended Audience

This course is intended for anyone looking to use auto scaling to manage their Alibaba Cloud workloads, as well as anyone studying for the ACP Cloud Computing certification exam.


To get the most out of this course, you should have a basic understanding of the Alibaba Cloud platform.


Welcome back. We're now ready to talk about scaling configuration. So how do you query a scaling configuration? How do you see its current state? Well, scaling configurations have the following lifecycle states. There's just two. Active and inactive. The scaling group will use the scaling configuration that is in the active state, whenever it creates a new ECS instance. Inactive scaling configurations are still part of the group, but they're not used to create ECS instances. So there can only be one active configuration at a time. And that is the configuration that the scaling group will use in order to create new ECS instances.

What about creating a scaling configuration? Well, the scaling configuration defines the configuration of the ECS instances, which will be added to the scaling group by any scaling activities that are triggered. You can modify a scaling configuration after it's created. Any ECS instances created by the new scaling configuration will still work as expected. And you can create up to 10 scaling configurations for one scaling group. Let's take a look at how to query the status of configurations and create new scaling configurations in the console.

So we're back in the console, looking at our scaling group from earlier. You can see that the state is disabled. That's because we don't have any scaling configurations yet, so we can't enable our scaling group. I could just click here to add one, but I'd like to show you where you can see the status of the scaling configurations. So first, I'll click on the scaling group ID number here and from here, you'll see that I can take a look at the scaling configuration that's currently active here in the top left corner of the console.

So what I'll do, is I'll click add scaling configuration, and we'll go ahead and create a new one. And you'll notice that what this essentially does, is takes us to the ECS purchase page. And you'll see that I have no option here to create subscription instances. That's because auto-scaling groups can only automatically add and remove pay-as-you-go or preemptible instances. So let's choose an instance type here. We'll go with a 2 VCPUs, 8G's of RAM. This is a g6e.large. And we can also choose some alternative, similar instance classes to use, in case this type isn't available. This way if our preferred type is sold out or unavailable in the zone we've selected, then we'll still be able to proceed with our scaling activity, successfully.

So let's add a few more options here. Great. So these are the options that we use when we're creating new ECS instances. The instance can be any of these three classes. And I need to choose an operating system. Let's just go with Ubuntu. Normally you would have a custom image or a shared image that you would work from that also holds the code for your application. In my case, I'll just go with standard Ubuntu. We'll use a 40 GB disk and we will not assign a public IP address for now. And then I need to choose a security group. I've already got this Singapore web SG group set up.

Next I'll go do system configuration. I need to choose log on credentials for my instances. You'll notice that Key Pair is the only option here. Either Key Pair of set later. You can not use passwords to create auto-scaling instances. So if I want to proceed, I'm going to have to go ahead and create a Key Pair. So, let's do that right now. Scaling the group key. We'll give it an easy name and we'll choose auto create. I'll click okay. And a copy of the PEM file with the key in it will be downloaded automatically. Now I can go back to the scaling configuration and I should be able to choose my scaling group key. So, let's do that.

I will not give my instances any particular naming pattern. And you can see we're now ready to create our scaling configuration. Whoops, I need to do one more thing. I need a name for my scaling config. "Test_ scaling_config." That should be an okay name. And then we'll click create. And if we want, we can enable the scaling configuration right here. We can make this the default active scaling configuration for our scaling group. So, let's go ahead and do that. I'll click enable. And now we have an active scaling configuration for our group.

If we wanted, at this point, we can apply that scaling configuration by clicking okay. It will now become the active scaling configuration. And at this point we can even enable our scaling group. Now that there's an active scaling configuration, we can turn on the scaling group as well. So, let's go ahead and do that. I will click okay and we'll turn on the scaling group, which should start creating and adding new ECS instances to the group. Remember under basic information, we set the size of the group, the minimum size, to two. So in a moment, we should start adding two new instances to the group. So, we'll wait for that to happen and we'll come back to the console later. In the meantime, let's go back to the slides.

Of course, if you need to, you can also delete a scaling configuration. However, there are two requirements you have to meet before you can delete a scaling configuration. Number one, the scaling configuration cannot be active. And number two, the scaling group cannot contain instances, which were created by the scaling configuration that you want to delete. So, say our scaling group has two ECS instances in it, that were created from the current scaling configuration. First, I need to remove those instances, then I can disable the scaling configuration. And then finally, once it's disabled, I'll be able to delete it. I'll save the deletion step for later on in our console demo, since there are some other things I'd like to show you. In particular, before we delete anything, I want to show you how to set up scaling rules.

About the Author
Learning Paths

Alibaba Cloud, founded in 2009, is a global leader in cloud computing and artificial intelligence, providing services to thousands of enterprises, developers, and governments organizations in more than 200 countries and regions. Committed to the success of its customers, Alibaba Cloud provides reliable and secure cloud computing and data processing capabilities as a part of its online solutions.