> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/basics/core-infrastructure/compute/auto-scaling-groups.md).

# Auto Scaling Groups

Auto Scaling Groups (ASGs) on Krutrim Cloud provide a managed way to automatically adjust virtual machine (VM) capacity in response to demand. ASGs help users maintain application performance while optimizing cost and operational efficiency by scaling resources up or down based on policy-driven triggers or scheduled actions.

ASGs can be created directly or derived from reusable templates, enabling users to standardize instance configurations and group behaviors across environments.

This document explains how ASGs function on Krutrim Cloud, how to configure and manage them, and how templates, policy configuration, dashboards, and UI behaviors work.

#### Key Concepts

**1) Auto Scaling Group**

An Auto Scaling Group is a logical construct that:

* Launches VMs based on instance configuration.
* Adjusts the number of running VMs automatically.
* Applies policies such as CPU usage, memory usage, or schedule-based triggers.
* Ensures defined minimum, desired, and maximum capacity boundaries.

ASGs are suitable for:

* Web servers and APIs with fluctuating load
* ML inference services
* Queue processing and worker pools
* Batch workloads with predictable schedules

2\) ASG Templates

#### Creating an Auto Scaling Group

**ASG Specification**

1. **Name :** A unique identifier for the ASG within the selected VPC.
2. **Creation Mode:**
   1. From Scratch: All fields start empty.
   2. From Template: Selecting a template pre-populates values. All values remain editable.
3. **Region**
   1. Auto-filled from the global region selector.
   2. User can override via dropdown.
4. **VPC:** Only VPCs in the selected region are shown. Dynamically updated if the region changes.
5. **Subnet:**
   1. Single-select from subnets within the chosen VPC.
   2. Subnets are shown with CIDR and public/private tag.
6. **Security Groups:**
   1. Multi-select.
   2. Lists all security groups associated with the selected VPC.

***

**Instance Configuration**

1. **Instance Name:** Base name used as prefix for VMs launched by this ASG.
2. **Instance Type:** CPU instance types with displayed specifications and per-hour pricing.
3. **Scaling Configuration:**
   1. Minimum capacity
   2. Maximum capacity
   3. Validation:
      1. `min ≤ max`
4. **Bootable Volume:**
   1. Configured with:
      1. Size
      2. Name
      3. Machine image
5. **Additional Storage Volume:**
   1. Users may attach multiple volumes.
   2. All such volumes are **ephemeral** and deleted when the instance terminates.
6. **SSH Key:**
   1. Used for secure access to VMs created by the ASG.

***

**Scaling Policies**

An ASG may include **one of each** of the following policies:

1. **Average CPU Utilization**
2. **Average Memory Utilization**
3. **Scheduled Scaling Action**

All policies are additive but only one policy of each type is allowed.

***

**CPU / Memory Utilization Policies**

Each policy includes:

* **Upscale Target (%):**\
  VM count increases when aggregated usage exceeds this threshold.
* **Downscale Target (%):**\
  VM count decreases when usage falls below this threshold.
* **Scale-out Cooldown:**\
  Prevents immediate re-execution of scale-out logic.
* **Scale-in Cooldown:**\
  Prevents immediate re-execution of scale-in logic.

**Validation rules:**

* Upscale and downscale values may be equal (allowed with warning).
* Downscale target may not exceed upscale target.

***

**Scheduled Actions**

Scheduled policies allow users to define:

* A **scale-up time**
* A **scale-down time**

Both times cannot be identical

***

**Saving as Template**

At the end of the creation process, users may enable:

**Save as Template**

* Creates a template with name **`<ASG Name> Template`**
* Captures full configuration (instance + ASG + policies)
* Template becomes available for future ASG creation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloud.olakrutrim.com/basics/core-infrastructure/compute/auto-scaling-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
