--- title: "Get started with TIR Auto Scaling Groups" description: "Build a TIR Auto Scaling Group from a snapshot of one of your VMs, scale on CPU usage, watch it add a VM, and then delete it." content_type: "get-started" product: "tir-auto-scaling" platform: "TIR" url: "/tir/tir-auto-scaling/get-started/" --- # Get started with TIR Auto Scaling Groups Build a small Auto Scaling Group from a snapshot of one of your VMs, push its CPU up so the group adds a VM, and delete the group when you finish. You need a TIR project in Delhi or Chennai, permission to create Auto Scaling Groups in it (see [TIR Access Control](/tir/tir-iam/)), and a CPU VM in the project that is **Running** or **Stopped**. On a prepaid account, you also need enough credit to start the group's VMs; see [Pay now in TIR](/tir/tir-billing/how-to/pay-now/) to buy credits. For the charges of a group, see [Billing for TIR Auto Scaling Groups](/tir/tir-auto-scaling/concepts/billing-options/). ## Take a snapshot of the VM Every VM in a group starts as a copy of one snapshot. Take a snapshot of your VM, and wait until it shows **Ready**. The steps are in [Create a VM snapshot](/tir/tir-snapshots/how-to/create-a-vm-snapshot/). ## Create the group 1. In TIR, open your project. In the side menu, under **Compute**, select **Auto Scaling Groups**, then select **Create Auto Scaling Group**. 2. Open the **Snapshots** tab and select your snapshot. 3. Keep the name TIR fills in under **Auto Scaling Group Name**. 4. Under **Select Computing Resource**, keep the plan family and pick a size under **Configuration**. A group runs on CPU plans only, and every VM uses this plan and is billed at its price. A small size is enough here. 5. Under **Scaling**, set **Minimum VMs** to 1 and **Maximum VMs** to 2. The group always keeps its VM count between the minimum and the maximum. 6. Keep **Usage-based** in **Policy** and **CPU utilization** as the metric, with the target at 60. The group adds a VM when the average CPU of its VMs stays above 60 percent. 7. Under **Network & Security**, pick your SSH key in **SSH Keys**. To add a new key, select **Click here**. Then pick a **Security Group** that opens port 22. 8. Select **Create Auto Scaling Group**. TIR opens the group's page and launches the first VM. When the VM is ready, the group is **Running**. For every field of the form, see [Create an Auto Scaling Group](/tir/tir-auto-scaling/how-to/create-an-auto-scaling-group/). ## Watch the group add a VM 1. On the group's page, open **Overview** and copy the `ssh root@` command under **Connect**. Sign in from a terminal on your computer. 2. Start a busy process on the VM so its CPU goes up. Run this command once for each vCPU of the plan: ```bash yes > /dev/null & ``` 3. Keep an eye on **CPU utilization** on **Overview**. The reading covers the last 2 minutes. When usage has stayed above the target for the wait that the group's **Scaling behavior** sets, the group adds a VM. With the default **Balanced** preset, that wait is 150 seconds, and the group's **State** is then **Scaling out**. 4. **Scaling Activity** records the change as "Added 1 VM", with the reason, such as "CPU utilization reached 72% (target 60%)." Both VMs are on **VMs & Monitoring**. [Scale on usage](/tir/tir-auto-scaling/how-to/scale-on-usage/) explains how the group decides. When you finish, stop the busy process on the VM: ```bash pkill yes ``` ## Delete the group A running group bills for its VMs until you stop or delete it. To delete it, open the **More actions** menu on the group's page, select **Delete**, tick the box that confirms the deletion, and select **Delete**. Its VMs are terminated, and anything stored on their disks is deleted with them. Your snapshot and your source VM stay. Once you have finished with the snapshot, delete it as described in [Delete a VM snapshot](/tir/tir-snapshots/how-to/delete-a-vm-snapshot/). The steps in full are in [Delete an Auto Scaling Group](/tir/tir-auto-scaling/how-to/delete-an-auto-scaling-group/). ## What to do next - [How auto scaling works](/tir/tir-auto-scaling/concepts/how-auto-scaling-works/) explains the minimum, the maximum, and how long a group waits before it adds or removes a VM. - [Scale on a schedule](/tir/tir-auto-scaling/how-to/scale-on-a-schedule/) changes the number of VMs at times you set. - [Set up health checks](/tir/tir-auto-scaling/how-to/set-up-health-checks/) replaces a VM whose application stops answering. - [Connect a load balancer](/tir/tir-auto-scaling/how-to/connect-a-load-balancer/) sends traffic to the whole group. If the launch fails, see [Troubleshooting TIR Auto Scaling Groups](/tir/tir-auto-scaling/troubleshooting/tir-auto-scaling/).