Alibaba Auto Scaling
The course is part of this learning path
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.
- 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
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 will now take a look at manual operations. What I'm talking about here is manual scaling operations. So you can execute a scaling rule by hand, and then we'll add or remove ECS instances. You can execute a scaling rule given the following conditions. If the scaling group is active and no other scaling activities executing, then your scaling rule will be executed directly without waiting for the cool-down. If the number of ECS instances to be added by your scaling rule, plus the number of instances already in the group exceeds the max value, then your total new instances to be added will be adjusted down so that you no longer exceed the max value. The same is true for the MinSize. If the number of instances you're going to remove, will take the group below the MinSize value, then the number of instances actually removed will be adjusted down or up when your scaling rule is triggered.
If a scaling group is active and no scaling activity is being executed for the scaling group, adding an ECS instance will execute directly without waiting for the cool-down. If the number of ECS instances to be added by the scaling rule again exceeds the max size, the operation will fail. So the actual add operation will fail. Manually added ECS instances are not associated with your scaling configuration in the scaling group, so they don't count here.
Removing an ECS instance. Removal depends on the reclaim mode you chose. Instances will either be stopped if you chose shutdown and reclaim mode, or they'll be released if you chose release mode. When a manually added ECS instance is removed from a scaling group, the instance is not stopped or released. If a scaling group is active and no scaling activity is being executed for the group, your ECS instance removal will occur immediately without waiting for the cool-down. If the number of existing ECS instances in the scaling group minus the number of ECS instances to be removed is less than the MinSize value, then of course, the operation will fail, similar to what happens when you try to add an instance and it will take the group above the maximum size.
Let's try executing some add and remove rules in our scaling group and see what happens. Once again, we're back in the console. Let's try executing our scale up to rule, which should add an additional two instances to our group. Our group currently contains two instances. We should be able to add two more with no problem, because that will bring us to a total of four. The maximum size of the group is, of course, five. So let's execute that scale-up rule. Click okay, and let's see what happens after we execute. So the rule has now executed. Let's go take a look at our scaling group.
We'll go to the basic information page, and in a moment we should be able to see that there's a total of four here. Two are in-service already, meaning they're ready to serve requests and two more are being added. So in fact, the rule did take the group up to the new size, which is four total instances. Let's wait a minute for those instances to become active. Sure enough, we see that the activity executed successfully, you can see the last scaling activity was add two instances. It was successful, and we now have four instances in our group. Let's try to execute that scaling activity or that scaling rule again.
So I'll go back to scaling rules and we'll try again. This time, if I really added two instances, I would grow my group to a total of six, four plus two, six instances. Of course, that's bigger than the maximum size limit of five that I set on my scaling group. So this should succeed, but it should only be able to add one instance. So let's click on execute and okay. And then once the rule has executed, we'll go back to the basic info page and we'll see what's happening. You can see that the scaling activity actually is, add one instance, but was adjusted down to one from the two that the rule specified because the maximum number of instances we can add here is five. That's the maximum upper limit on our group. Let's wait for that to execute. And sure enough, after waiting for a while, the group size has grown to five instances in service and our scaling activity has succeeded. Let's now go in the opposite direction and try scaling the group down.
So I'll go back to scaling rules and now we'll try executing our scale down two activity. So I'll click execute, and then I'll click okay. And just for fun, let's try to re execute that again right now during the cool-down period. Let's see what happens. It says, "The scaling group to which the specified scaling rule belongs has scaling activities in progress". So there's already a scaling activity happening. This rule can't be triggered right now. So let's go cancel that and go back to basic info and let's see, we should now be removing two instances. And in fact, we're already done. We've already removed two of the five, bringing our total down to three.
Let's execute the rule one more time. So I'll go back, scale down two, and click execute. This time we should be okay. And sure enough, we can execute the rule again. Let me go back. Excuse me. When we go back to the basic settings page, we're removing one. So why is that? Well, there were three in the group before, and we tried to remove two, which would have taken the total down to one. The minimum size of the group is two, so we can't remove two. We can only remove one from the three, taking the total size of the group down to two. And you can see that that has now succeeded and the group is back where we started at two instances. That's all for this portion of the course. When we come back in our next section, we'll take a look at how we can trigger a scaling rule based on an event, such as a change in CPU or memory usage.
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.