Topic 11

Virtual Machines

Concept

The most basic thing you can rent in the cloud is a computer to run your software. In most cases, that computer is not a whole physical machine to yourself — it's a virtual machine: a slice of a larger real machine, handed to you as if it were a complete computer of its own.

Understanding what "virtual" means here unlocks a lot: it explains why cloud servers can appear and disappear in seconds, why you pay for a fraction of a machine, and why thousands of customers can share a single building full of hardware without interfering with each other.

Think of a large apartment building. One big structure is divided into separate, self-contained flats — each tenant's space is private and independent, even though they share the walls, roof, and foundations. A virtual machine works the same way: private and self-contained, built from a shared physical structure.

What Is a Server?

Before getting to "virtual," it helps to know what a server is. A server is simply a computer that runs software and waits for requests — a website, an app, a database. When you open a web page, a server somewhere receives your request and sends back the page. The word "server" just describes the role: this computer serves other computers.

In the old world, a company that needed to run software had to buy a physical server, put it in a room, plug it in, and keep it running. The cloud lets you rent that server instead, and a virtual machine is the unit of rental.

Virtual, Not Physical

A cloud provider owns enormous physical machines — computers with far more processing power and memory than any one customer needs. Special software, called a hypervisor, splits each physical machine into many isolated slices. Each slice looks and behaves like its own separate computer. That slice is a virtual machine.

You rent one of those slices. From your point of view, it's a whole computer: it has its own processing power, its own memory, its own storage, and its own connection to the network. It runs in complete isolation from the other slices on the same physical hardware. The fact that it shares a building doesn't affect you any more than your apartment neighbor's cooking affects your kitchen.

What You Control

When you rent a virtual machine, you get the keys to the whole thing — down to the operating system, the foundational software (like Windows or Linux) that every other program runs on top of. You choose the operating system, install whatever software you need, configure it, and run it how you like.

That level of control is the VM's defining feature. It means the most flexibility — and also the most responsibility. Someone has to keep the operating system updated, manage security, and handle the configuration. The provider keeps the physical hardware running; everything above the hardware is yours to manage. (This is the IaaS layer from Chapter 1, applied to compute.)

Sizing: Picking How Much Power You Rent

Not all virtual machines are the same size. Providers offer a menu of configurations — more processing power, more memory, more storage — each at a different price. A small website might run on the most modest option; a large database might need a very large one. You pick the size that fits, and pay accordingly. If your needs grow, you can switch to a bigger size; if they shrink, you can move down.

This is the cloud's pay-for-what-you-use idea applied to raw computing: you're not stuck with the size of a machine you already bought.

One physical server, split into multiple virtual machines
Physical server
one large machine owned and run by the provider; the hypervisor divides its resources
Virtual machine A
a private slice — its own OS, memory, and storage; completely isolated from the others
Virtual machine B
another private slice on the same hardware; neither tenant can see the other
Three cloudsAWS EC2 (Elastic Compute Cloud)Google Cloud Compute EngineAzure Virtual Machines
Common Confusions
  • "A cloud server is a dedicated physical machine, just for me." Almost always not true. Most cloud VMs are slices of a shared physical machine. You get full isolation and privacy — but the underlying hardware is shared. Dedicated physical machines do exist as a premium option, but they're the exception, not the default.
  • "Virtual means fake — it's weaker than a real computer." Virtual means software-defined, not fake. A virtual machine runs real software, handles real traffic, and stores real data. For almost every use, it's indistinguishable from a physical one.
  • "I need to know how to build or buy a computer." You rent a ready-configured machine. You pick a size from a menu, and a working computer appears — operating system preinstalled, ready to use. No hardware knowledge is needed.
Why It Matters
  • The virtual machine is the original cloud building block — the unit nearly everything else in the cloud either sits on or evolved from.
  • Most cloud compute is still priced, sized, and described in VM terms, so understanding VMs gives you the vocabulary for the whole compute conversation.
  • Knowing that a VM is a slice of shared hardware (not a whole dedicated machine) explains why cloud servers can appear in seconds and be deleted without waste — the underlying iron never moves.

Knowledge Check

What is a virtual machine?

  • A physical server purchased and shipped to your building by the provider
  • A slice of a real machine, isolated, that acts as its own computer
  • A browser-based simulation used to test software without real hardware
  • A network router that connects multiple servers in a data center together

When you rent a virtual machine, what do you have control over?

  • The physical server hardware, including the CPU chips and memory modules
  • Nothing — the provider manages the VM and all software running on it for you
  • The operating system and all software you install on top of it
  • Only the firewall rules; everything else is managed by the provider

How does one physical server run virtual machines for multiple customers?

  • The motherboard is physically partitioned so each customer's slice is separate hardware
  • Software called a hypervisor divides the machine's resources into isolated slices
  • The server takes turns running each customer's software in a strict rotation
  • The provider ships a separate physical machine to every customer who rents a VM

You got correct