# Cloud Instances and Images

> How a cloud server starts from a saved disk in about a minute. How more copies are added when it gets busy, and removed after.

**Course:** [Virtualization and Cloud Computing](https://learn.benibix.com/learn/infrastructure-virtualization)  
**Time:** 12 min

**After this lesson you can:**

- Start a cloud instance from a machine image
- Explain why images make servers identical
- Say how the cloud decides to add a server

## From a saved disk to many identical servers

A cloud instance is a virtual machine you rent from a cloud provider, paid for while it runs. It starts from a machine image: a saved disk with the system and software already set up. Starting one takes about a minute. Autoscaling then adds or removes copies as the load rises and falls.

The image is what makes this work. Without one, each new server needs its software installed by hand or by script, which is slow and easy to get slightly wrong. With one, every copy starts out exactly the same.

Each instance has a type that sets its size, such as 2 vCPUs and 4 GB of memory. You pick the type, the image and the zone, and the cloud starts it. Bigger types cost more per hour.

Clouds offer ready-made images for Ubuntu, Debian, Windows and more. Most teams then build their own on top, with their app already inside. A new version of the app means a new image.

Autoscaling watches a number, such as how busy the CPUs are. When it stays over a line, say 70%, for a few minutes, it starts another instance from the image. When load drops, it removes the extras. You set a smallest and a largest count.

That only works if instances keep nothing that matters on their own disk. Uploads, sessions and the database live somewhere shared. Then any copy can be removed at any time, and nothing is lost.

The mistake is to log into one running instance and fix something by hand. The fix lives only on that copy. The next one autoscaling starts comes from the old image, and the bug is back.

```bash
aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type t3.small \
  --count 1 \
  --subnet-id subnet-0123456789abcdef0
```
Start one small instance from a saved image on AWS, in a chosen zone's network.

![A machine image holding Ubuntu, Nginx and the app feeds a row of identical cloud instances. When traffic is quiet, two instances run. When it is busy, autoscaling starts more copies from the same image, and five run.](https://learn.benibix.com/diagrams/inf2-autoscaling.svg)

### Example: A sports site on match night

A sports news site runs 3 instances on a quiet day. On a cup final night, visits jump eightfold in ten minutes.

Autoscaling sees the CPUs pass 70% and starts copies from the site's image, up to 20. After the match, it scales back down to 3 by midnight.

**Words in this lesson:** [Cloud Instance](https://learn.benibix.com/term/infrastructure/cloud-instance), [Machine Image](https://learn.benibix.com/term/infrastructure/machine-image), [Autoscaling](https://learn.benibix.com/term/infrastructure/autoscaling)

**Question:** You fix a bug by logging into one running instance. Why does it come back?

**Answer:** New instances start from the old image, without your fix. Every new copy starts from the machine image. A fix made by hand on one instance never reaches the image, so the next copy has the bug again.

---

Source: https://learn.benibix.com/learn/infrastructure-virtualization/cloud-instances-and-images
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
