Compute Fundamentals

Cloud Platform Fundamentals

Chapter 3 · Compute Fundamentals

Chapter 1 named IaaS as the layer this course spends the most hands-on time on — this chapter is why: virtual machines are the most common thing a support engineer actually gets tickets about, and the concepts here (sizing, lifecycle states, pricing model, auto-scaling) recur constantly in real troubleshooting work.

What a Virtual Machine Actually Is

A virtual machine is a software-emulated computer running on top of a hypervisor — a layer that lets one physical server safely host many isolated VMs at once, each unaware of the others. Cloud providers use bare-metal (type 1) hypervisors running directly on the physical hardware, rather than on top of a host operating system.

Worth distinguishing early: VMs virtualize the hardware — each one runs its own full operating system. Containers (this site's own docker1/docker2 courses) virtualize the operating system instead — much lighter weight, but a genuinely separate topic this course doesn't go deep on.

Launching a VM — What You Actually Choose

Spinning up a VM on any of the three providers involves the same core decisions, just under different menu names:

  1. Machine image — a preconfigured OS-plus-software snapshot (an AMI on AWS, a VM image on Azure, an image on GCP).
  2. Instance type/size — the CPU/RAM/network combination (Chapter 3's own next section).
  3. Region and zone — where physically the VM runs.
  4. Attached storage — covered fully in Chapter 4.
  5. Networking and security group assignment — covered fully in Chapter 5.
  6. Access credentials — an SSH key pair (Linux) or equivalent login credential, set at launch time.

Instance Families & Sizing

Every provider groups instance types into similar families, just with different names:

FamilyAWS exampleAzure exampleGCP example
General purposet3.mediumStandard_B2se2-medium
Compute-optimizedc6i.largeFsv2-seriesc2-standard-4
Memory-optimizedr6i.largeEsv5-seriesm1-megamem
GPUp4dNC-seriesa2-highgpu

Sizing is fundamentally a vCPU + RAM + network throughput trade-off. Undersizing causes real performance problems and timeouts under load; oversizing simply wastes money — Chapter 9 covers cost management as its own topic, but the sizing decision made here is where that cost is actually determined.

Instance Lifecycle & States

Every provider's VMs move through the same core states: running, stopped, and terminated (or deleted). The distinction between stopped and terminated is genuinely important, not just semantic:

  • Stopped — the VM isn't running, and you stop paying for compute — but its attached storage still exists and is still billed.
  • Terminated/deleted — the instance and (usually) its storage are gone permanently, unless a snapshot was taken beforehand.
One of the most common billing-support tickets in practice
"My VM is stopped but I'm still being billed" is a genuinely frequent support scenario, and the answer is almost always this exact distinction: stopping a VM halts compute charges, but the attached storage volume keeps existing — and keeps costing money — until it's explicitly deleted. This single fact resolves a large share of "why am I still being charged" tickets.

Pricing Models

  • On-demand / pay-as-you-go — full flexibility, no commitment, the highest per-hour cost.
  • Reserved / committed use — a meaningful discount in exchange for a 1-3 year usage commitment, appropriate for predictable, always-on workloads.
  • Spot / preemptible instances — a deep discount, but the provider can reclaim the instance with very little notice.
Spot instances are not a free discount
Spot (AWS)/preemptible (GCP) instances can be reclaimed with as little as a couple of minutes' notice, sometimes less. They're an excellent fit for fault-tolerant, interruptible workloads — batch processing, rendering, CI jobs — and a genuinely bad fit for stateful, always-on production services with no fallback plan. Choosing spot pricing for the wrong workload trades a cost saving for a real, recurring availability risk.

Auto-Scaling — Elasticity in Action

This is Chapter 1's "elasticity" made concrete. Auto-scaling groups (AWS Auto Scaling Groups, Azure VM Scale Sets, GCP Managed Instance Groups) automatically add or remove VM instances based on defined metrics — CPU utilization, request count, or similar. The core mechanism is the same everywhere: a minimum, maximum, and desired instance count, a scaling policy defining what triggers a change, and automatic health checks that replace unhealthy instances without manual intervention. Auto-scaling groups typically sit behind a load balancer (Chapter 5) that distributes incoming traffic across whatever the current instance count happens to be.

A Support-Relevant Gotcha — Auto-Scaling Masking Real Problems

Auto-scaling is genuinely useful, but it has a real operational trap: it can quietly compensate for an underlying problem — a memory leak, inefficient code, an unoptimized query — by simply adding more instances, rather than the problem ever actually getting fixed. Cost climbs steadily in the background while the root cause goes unaddressed, until the auto-scaling group eventually hits its configured maximum instance count — at which point the original symptom reappears, now at a larger and more urgent scale than if it had been investigated in the first place.

Hands-On Exercises

Exercise 1

Explain the difference between a "stopped" and a "terminated" VM, and explain specifically why a customer might see continued charges on their bill despite insisting their VM has been "stopped, not running" for weeks.

📄 View solution
Exercise 2

Recommend on-demand, reserved, or spot pricing for each: (a) a batch video-transcoding job that checkpoints its progress and can safely restart if interrupted, (b) a database server that needs to run continuously for the next two years, (c) an unpredictable dev/test environment used only sporadically.

📄 View solution
Exercise 3

In your own words, explain how auto-scaling can mask a real underlying problem rather than fix it, and describe what a support engineer should investigate before simply accepting "the auto-scaler handled it" as a resolution.

📄 View solution

Chapter 3 Quick Reference

  • VMs virtualize hardware (full OS each); containers virtualize the OS (see docker1/docker2) — a separate topic
  • Launching a VM = image + instance size + region/zone + storage (Ch.4) + networking (Ch.5) + access credentials
  • Instance families (general/compute/memory/GPU-optimized) exist under different names across all three providers
  • Stopped ≠ terminated — stopped still bills for attached storage; this explains a huge share of real billing tickets
  • On-demand (flexible, priciest) vs. reserved (discounted, committed) vs. spot/preemptible (cheapest, reclaimable — wrong fit for stateful production)
  • Auto-scaling (ASG/Scale Sets/Managed Instance Groups) — min/max/desired count, triggers, health checks; can mask a root cause instead of fixing it
  • Next chapter: Storage Fundamentals — object vs. block storage, and storage tiers/lifecycle policies