Sub topic 8
IaaS: renting infrastructure
What IaaS gives you
Infrastructure as a Service (IaaS) is a service model where the provider rents you virtual computing resources: servers, storage, and networks. You get the building blocks and assemble them yourself. This chapter assumes you know what a server, an operating system, and an application are, and that you recognize terms such as IP address and HTTP.
The provider owns the data centers, physical hardware, and the virtualization layer that splits that hardware into virtual machines. You own everything above that: the operating system, runtime, data, and application.
The main building blocks
Most IaaS offerings share the same few resource types. The names below are from AWS, and other providers have equivalents.
| Building block | What it is | AWS example |
|---|---|---|
| Virtual machine | A server you can log in to and configure | Amazon EC2 |
| Block storage | A virtual disk attached to a machine | Amazon EBS |
| Object storage | Files stored and fetched over HTTP | Amazon S3 |
| Virtual network | Your own private IP address space, subnets, and firewall rules | Amazon VPC |
A worked example: launching a virtual machine
The AWS CLI command below asks for one small virtual machine. You choose the machine image (the template that holds the operating system) and the instance type (the amount of CPU and memory).
# IaaS: you choose the machine image and size, then manage the OS and everything above it.
# The AMI ID below is a placeholder; use an image ID that exists in your region.
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.micro \
--count 1The machine is ready in under a minute. That speed comes from the on-demand and pooled nature of the cloud, which earlier chapters covered. What you have at that point is a bare server. Nothing runs on it except the operating system from the image.
What is left for you
After launch, these tasks are yours:
- Apply operating system patches and security updates.
- Install and configure the runtime, web server, and application.
- Configure the firewall rules (security groups on AWS) so only the ports you need are open.
- Set up backups, monitoring, and logging.
- Scale out by launching more machines and putting a load balancer in front of them.
This list is the shared responsibility split for IaaS. The provider secures the cloud itself, and you secure what you run in it. A machine with an unpatched operating system or an open database port is your problem, not the provider's.
Common errors
- Assuming the provider patches your OS. Under IaaS it does not. Automate updates or rebuild machines from fresh images.
- Opening every port. Allowing all traffic from anywhere is a frequent cause of compromised servers. Open only what the application needs.
- Using the wrong region. An image ID is valid only in the region where it exists, so a copied command can fail with an "invalid AMI" error.
- Treating one machine as permanent. Virtual machines can fail. Keep data on separate storage and be able to rebuild the machine.
When IaaS fits
IaaS suits workloads that need full control: custom operating system settings, unusual software, legacy applications moved from your own servers, or specific networking. The cost of that control is operational effort. Your team does the work the next model, PaaS, hands to the platform.
Exercise
You launch an EC2 instance running a Linux image. A security flaw is announced in a library installed on that image. Who must apply the fix under IaaS, and why?
Show answer
You must. Under IaaS the provider manages only the hardware, data center, and virtualization layers. The operating system and the software installed on it belong to you, so you patch them or rebuild the machine from an updated image.