Sub topic 3
How the cloud works underneath: virtualization and pooling
This chapter assumes you know what a server, an operating system, and an application are. It also assumes you are comfortable with basic networking terms such as IP address and HTTP. The previous chapters defined the cloud by its essential characteristics: on-demand, elastic, and measured. Here you will see the mechanism that makes those characteristics possible.
Why the cloud needs a mechanism
A provider cannot buy a new physical server every time a customer clicks "launch." Delivering a machine in seconds, then taking it away minutes later, requires a layer of software between the hardware and the customer. That layer is virtualization.
Virtualization
Virtualization is a technique that lets one physical computer act as many separate virtual computers. Each virtual computer is called a virtual machine (VM). A VM has its own virtual CPU, memory, disk, and network card, and it runs its own operating system.
The software that creates and runs VMs is a hypervisor. It sits on the physical server, called the host, and divides the host's CPU, memory, storage, and network among the VMs, called guests. The hypervisor enforces isolation, so one guest cannot read another guest's memory or take over the host.
Resource pooling
A provider runs thousands of hosts in its data centers. It treats their combined CPU, memory, and storage as one shared pool. This is resource pooling, and it is multi-tenancy in practice: many customers, called tenants, share the same physical machines while staying isolated from each other.
When you request a VM, a scheduler picks a host with free capacity and the hypervisor carves out your slice. You do not choose the physical machine and usually cannot tell which one you got. When you release the VM, the slice returns to the pool for someone else.
How this delivers the essential characteristics
| Characteristic | What virtualization and pooling provide |
|---|---|
| On-demand | Software creates a VM in seconds, with no hardware purchase or delivery. |
| Elastic | Capacity returns to the pool when you release it, and more is drawn when you need it. |
| Measured | The hypervisor knows how much CPU, memory, and storage each VM uses, so usage can be billed. |
A closer look at the AWS example
The run-instances command from the IaaS example asks AWS to create a VM from an image.
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.micro \
--count 1The --instance-type value names a size, meaning how much virtual CPU and memory the guest receives. The image ID is a placeholder, so substitute an image that exists in your region. AWS finds a host with room, and its hypervisor starts your guest. You never see the host.
Common errors and misconceptions
- Thinking a VM is a physical server. A VM is a slice of one. Its performance can differ from a dedicated machine, especially when neighbors on the same host compete for shared resources. This is the "noisy neighbor" problem.
- Assuming unlimited capacity. The pool is large but finite. Providers enforce quotas, and a region can run short of a specific instance type.
- Confusing isolation with absence of sharing. Tenants share hardware. Isolation comes from the hypervisor and the provider's controls, not from separate machines.
Exercise
A customer launches a VM, uses it for two hours, and terminates it. Which two properties of virtualization and pooling let the provider reuse that capacity and bill only for those two hours?
Show answer
Pooling returns the freed CPU and memory to the shared pool so another tenant can use it, and the hypervisor's per-VM view of resource use lets the provider measure and bill the two hours used.