Creating a metric-based autoscaling configuration
To create a metric-based autoscaling configuration, see the following steps.
- Open the navigation menu and select Compute. Under Compute, select Autoscaling Configurations.
- Select Create autoscaling configuration.
-
On the Add basic details page, do the following:
- Enter a name for the autoscaling configuration. Avoid entering confidential information.
- Select the compartment to create the autoscaling configuration in.
- Select the Instance pool to apply the autoscaling configuration to.
- Show tagging options: If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
- Select Next.
-
On the Configure autoscaling policy page, select Metric-based autoscaling. Then, do the following:
- Enter a name for the autoscaling policy. Avoid entering confidential information.
- In the Cooldown in seconds box, enter the minimum amount of time to wait between scaling events. The cooldown period gives the system time to stabilize before rescaling. The minimum value is 300 seconds, which is also the default.
- Select the Performance metric that triggers an increase or decrease in the number of instances in the instance pool.
-
In the Scale-out rule area, specify the threshold that the performance metric must reach to increase the pool size. Select a Scale-out operator and Threshold percentage. Then, enter the Number of instances to add to the pool.
For example, when CPU utilization is greater than 90%, add 10 instances to the pool.
-
In the Scale-in rule area, specify the threshold that the performance metric must reach to decrease the pool size. Select a Scale-in operator and Threshold percentage. Then, enter the Number of instances to remove from the pool.
For example, when CPU utilization is less than 20%, remove 5 instances from the pool.
-
In the Scaling limits area, specify the number of instances in the instance pool:
- Minimum number of instances: The minimum number of instances that the pool is allowed to decrease to.
-
Maximum number of instances: The maximum number of instances that the pool is allowed to increase to.
Important
The number of instances that can be provisioned is also limited by your tenancy's service limits. -
Initial number of instances: The number of instances to launch in the instance pool immediately after autoscaling is enabled. After autoscaling retrieves performance metrics, the number of instances is automatically adjusted from this initial number to a number that is based on the scaling limits that you set.
- Select Next.
-
Review the autoscaling configuration, and then click Create.
Autoscaling runs. The cooldown period starts when the instance pool's state changes from Scaling to Running.
Use the autoscaling configuration create command and required parameters to create an autoscaling configuration:
oci autoscaling configuration create --from-json <file://path/to/file.json>
<file://path/to/file.json> is the path to a JSON file that defines the instance details. For information about how to generate an example of the JSON file, see Advanced JSON Options.
For a complete list of flags and variable options for the Compute service CLI commands, see the command line reference for Compute.
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.
Use this API operation to create an autoscaling configuration: