Hello and welcome. In this demonstration, I'm going to show you how you can work with auto-scaling. We are going to have a look at how we can create an instance configuration, create an instance pool, and finally create an auto-scaling configuration. Let's get started. As you can see, currently I'm inside the OCI console, logged in as the compute admin user. If I click on the Hamburger menu, click on Compute, click on Compute. Under compute, let me show you the different constructs that we'll be working with. We will be working with instance configurations. We'll first create an instance configuration, and then we will create an instance pool and finally we will define an autoscaling configuration. Let's get started. The very first thing that we will do is we'll create an instance configuration. As you can see, the instance configuration is a template that defines the settings to use when creating compute instances. Before we start the demonstration, let me show you the policies that you require before you can perform these operations. The first policy is let users manage compute instance configurations, instance pools, and cluster networks. These are the policies that you need to add. This is the first policy. Then the second policy is let users manage, compute autoscaling configurations. These are the policies. Now what I have done is I have gone ahead and added these five policies to identity and access management service. This is the prerequisite. I can return back to the OCI console and create my instance configuration. Let's do that. Let me click on Create Instance Configuration. I can give it a name, Demo instance configuration. I can select the compartment. I can specify the availability domain option under placement and if you click on Show Advanced Options, you can also specify the capacity type. Then you can select the image and the shape. I'm fine with Oracle Linux 8 and I'm also find with VM.Standard.E4.Flex. From a networking standpoint, I can select the existing virtual network. I can select the existing subnet. I may choose to assign a public IPv4 address, and then I need to add the SSH keys. Let me very quickly do that. I'll paste the public keys over here. The rest, all the settings remain the same. As of now, I'm not attaching any block volume, so I can click on Create. You can see that this demo instance configuration is now available and you can find the details of it under instance configuration information. Now the second step is to create an instance pool. Now there are two ways in which you can do it. If I return back to the compute, you can go to the instance pool and create the instance pool from here. We know that instance pool is a mechanism to manage multiple compute instances as a group. The second option is to go to the instance configuration, click on Demo Instance Configuration, and then create the instance pool from here. Let me do that. Let me click on Create Instance Pool. I can give it a name, demo instance pool and then I can select the compartment, and then I have to specify the initial number of instances. Let me make it two. Let me click on Next. Now I have to configure the pool placement so I can select the availability domain and then I have to select a virtual cloud network and then let me select a subnet. You can add another availability domain. This time let me select AD 2 and then select the same VCM and select subnet A. Let me click on Next. Let me click on Create. You'll see that the demo instance pool is getting provision, and as we defined, the target instance count is two. You can monitor the work request under the resources. Now when this demo instance pool is provisioning, if I scroll down and show you thae test instances, you can see that there are two instances that are getting provisioned. Why? Because when we created this demo instance pool, we specify the target instance count as two, and hence, two instances are getting provisioned. You also have the option to add a load balancer to an instance pool so that the traffic can be distributed across these attached instances. Now we see that both these instances are running. This first instance is running in availability domain 1, and the second one is running in availability domain 2. You also see that the demo instance pool is also running. Now if I return back to the compute, let me go ahead and create an autoscaling configuration. This is the third construct and the final one. Let me click on Create Autoscaling Configuration and I will just give it a name , Demo autoscaling config. I'll select this compartment and I can select the instance pool that I created, Demo instance pool. Then I can click on Next. Now, there are two types of policies that you can configure. The first is metric-based auto scaling that is going to use the performance metrics like CPU utilization to trigger auto scaling events. The second is scheduled-based auto scaling. When you are going to define a cron expression and you can also configure the auto scaling events to take place at a specific time that you scheduled. I will go with metric-based auto scaling. You can see the Instance Pool information and the instance configuration information over here. You can also see the shape configuration. Now, let me configure auto scaling policy. Let me just give it a name, demo auto scaling policy. I can also define the cool down timer. This cool down timer is the minimum period of time between scaling actions. The minimum value is 300 seconds. I will define that. Then I can define the performance metric. I have two options here. I can go for CPU utilization or I can go for memory utilization. In this case, I will select CPU utilization and then I can define the scale out and the scale in rules. I can define the scale out if the CPU utilization is greater than, let's say 85 percent, I want to add one instance and under the scaling rule, I can define if the CPU utilization is, let's say less than 60 percent, remove one instance. That means one instance will get terminated. This CPU utilization is going to be the average CPU utilization of all the instances that are running in the Instance Pool. You can also define the scaling limits, What's the minimum? What is the maximum? You see the initial number of instances I have already defined as two, so I can now define the minimum number as one and the maximum number as three. Now let me click on "Next" and click on "Create". This is how I create my auto scaling configuration. You see that the auto scaling configuration is now enabled. Now if I return back to compute and I go to the instance pool, initially there were two instances running but if I go to the compute and go to the auto scaling configuration, and go to the auto scaling configuration that I defined, there, I had defined a policy that if the CPU utilization is less than 60 percent, I want to remove one instance rate and therefore, if I go to the Instance Pool, you can see the status scaling. When I say scaling, it also means scaling in. That is what we call as horizontal scaling, both scale out and scale in operations are supported. Now you see that the Instance Pool is running but if I look at the attached instances, that is just one. This instance got terminated and if I look at the work request, terminate instance in pool. This operation got succeeded. You see terminating one instance from the Instance Pool, and you are also able to see the message terminated one out of one requested instances. As of now, there is just one instance that is running, and this is the instance. I have demonstrated how scaling operation is performed, now let me demonstrate how you can scale out, how you can add another instance by increasing the CPU utilization. Let me go ahead and connect to this instance. I'll copy the public IP address. Let me try to do an SSH to this particular instance. I will do ssh opc@public IP. Let me go ahead and download the extra packages repository. Now it is installed. Now if I go ahead and install the stress package, yes, so this is done. Now let me fire this command. This command is going to increase the CPU utilization. I'll just minimize it. What I will do is I'll go to the instance pool. Currently you see that in the Instance Pool, there is just one instance that is running. Now in some time you will see another instance coming up. Now you can see that another instance is getting provisioned. If I look at the work request, you can see that create instance in pool and create instance for instance configuration. These are the operations that are currently in progress. Why is this instance getting launched? Because we generated the stress. If you look at the metrics, you'll see that the CPU utilization actually went up. It's currently 100 percent and based on what we have defined in the auto scaling configuration, if have the CPU utilization is greater than 85 percent, then I define the condition to add an instance, and hence, this instance is now added and the instance count is now back to two. This instance is now added. This marks the end of this demonstration where we looked at how to create instance configuration, how to create instance pool, and how to create auto scaling configuration for facilitating scale out and scale in operations. I hope you found this demonstration useful. Thanks for watching.