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), 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 to buy credits. For the charges of a group, see Billing for TIR Auto Scaling Groups.
Take a snapshot of the VM
Section titled “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.
Create the group
Section titled “Create the group”- In TIR, open your project. In the side menu, under Compute, select Auto Scaling Groups, then select Create Auto Scaling Group.
- Open the Snapshots tab and select your snapshot.
- Keep the name TIR fills in under Auto Scaling Group Name.
- 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.
- 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.
- 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.
- 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.
- 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.
Watch the group add a VM
Section titled “Watch the group add a VM”-
On the group’s page, open Overview and copy the
ssh root@<public IP>command under Connect. Sign in from a terminal on your computer. -
Start a busy process on the VM so its CPU goes up. Run this command once for each vCPU of the plan:
yes > /dev/null & -
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.
-
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 explains how the group decides. When you finish, stop the busy process on the VM:
pkill yesDelete the group
Section titled “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. The steps in full are in Delete an Auto Scaling Group.
What to do next
Section titled “What to do next”- 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 changes the number of VMs at times you set.
- Set up health checks replaces a VM whose application stops answering.
- Connect a load balancer sends traffic to the whole group.
If the launch fails, see Troubleshooting TIR Auto Scaling Groups.