Understanding Virtual Machines
A Virtual Machine Is a Computer Made of Software 🖥️
A virtual machine (VM) is a software-defined computer that lets you rent compute capacity without owning the physical server beneath it.
In this lesson, you will learn to:
- Explain how virtualization shares physical hardware while keeping VMs isolated.
- Identify how vCPUs, memory, disk, machine images, and regions affect VM sizing.
- Compare scaling up and scaling out in terms of performance, resilience, and cost.
Picture a large physical server sitting in a provider's data center. It has real processors, real memory, and real disks. Now imagine software that slices that one physical server into several separate computers, each with its own operating system, its own files, and its own login. Each of those slices is a virtual machine. It behaves exactly like a computer you could put on a desk, except it exists as software running on hardware you never see or touch.

The word "virtual" is doing important work here. Your virtual machine is not pretending to be a computer; it genuinely runs programs, stores files, and can be restarted. What makes it virtual is that the hardware underneath is shared. Several virtual machines, often belonging to completely different customers, sit on the same physical server, kept separate by the provider's virtualization software. This is the resource pooling idea in practice, and it is why you can rent a small computer for a few cents an hour instead of buying a whole machine.
Two consequences follow from that sharing, and both matter in real conversations. First, you are billed for the time your virtual machine exists and runs, not for the hardware it sits on. Turn it off, and the compute charges for those hours usually stop — though the disk attached to the machine typically keeps billing whether the machine is running or not. Second, a virtual machine is disposable in a way a physical server is not. Creating one takes minutes, deleting one takes seconds, and neither involves anybody driving to a building.
Milo, a developer at Northwind Outdoors, asks Natalie, a cloud advisor, why a VM can safely share a physical server with other customers.
- Milo: So when I click "create instance," what actually appears?
- Natalie: A computer made of software. It has its own operating system and disk, but the physical hardware underneath is shared with other machines, possibly from other companies.
- Milo: That sounds less safe than owning the box.
- Natalie: The separation is enforced by the provider, and it's the reason you can rent four processor cores for the afternoon instead of buying a server. If we owned the box, we'd be paying for it at 3 a.m. on a Sunday too.
Notice that Natalie answers the safety question without dismissing it, then immediately ties the shared hardware back to why it exists: cost.
The Five Choices You Make When Sizing One ⚙️
When you create a virtual machine, the provider asks you a handful of questions. Understanding them is most of what "sizing" means.
The first is how many vCPUs, or virtual processor cores, the machine gets. A vCPU is a slice of the physical processor assigned to your machine, and more of them means more work can happen at the same time. The second is memory, often called RAM: short-term working space for programs that are currently running. Memory is where a report loads a large spreadsheet while it calculates. Run out of it, and the machine slows dramatically or the program crashes.
The third choice is disk: persistent space that holds files and the operating system itself, and that survives a restart. Where memory is a desk you clear each evening, disk is the filing cabinet. The fourth is the operating system and machine image. The image is a prepackaged template containing an operating system, such as Windows or a version of Linux, sometimes with software already installed, so you are not building from nothing.
Finally, there is the region, meaning the geographic area whose data centers your machine runs in. That choice affects how quickly nearby users reach the machine and can affect latency, data-residency requirements, availability options, and the compliance obligations that apply to the workload.
None of these is a technical detail you can safely leave to someone else. Each one shows up later as either a performance complaint or a line on an invoice.
Scaling Up Versus Scaling Out 📈
Eventually a machine will not be enough, and there are exactly two directions to go. Scaling up, sometimes called vertical scaling, means replacing your machine with a bigger one: more processor cores, more memory, same single machine. It is simple, it usually requires no change to the application, and it typically involves a restart — which means a window of downtime while the machine comes back up. Its limits are real, though. There is a largest available size, and one machine remains a single point of failure.
Scaling out, or horizontal scaling, means running several copies of the machine and spreading work across them. This handles far more traffic and survives the loss of any one machine, but it demands something of the application: each copy must be interchangeable. If a machine remembers who is logged in by storing that information locally, a user bounced to a second machine appears logged out. That state has to move somewhere shared before scaling out can work.
For a growing web application, scaling out is usually the right long-term direction, because web traffic is spiky and many small machines can be added and removed as demand moves. Scaling up remains the sensible answer for workloads that genuinely cannot be split, such as a single database that must hold one consistent copy of the data.
The takeaway to carry forward is that a virtual machine is a rented, software-defined computer sharing real hardware, and every sizing and scaling decision you make about it is simultaneously a performance decision and a cost decision. Next you'll do a quick self-check on how a virtual machine is best described, which is worth taking seriously, because it is the definition you'll end up repeating to non-technical colleagues more often than any other in this course.
