In module 1 we drew the map: IaaS sits at the bottom of the stack, the provider manages everything up to virtualization and the customer takes care of everything above it. Now we go down to that first level to get to know it properly. Infrastructure as a Service is the model closest to "owning your own servers", but with cloud rules: resources are requested through an API, paid for by time used, and can be created, expanded, and destroyed in minutes. That combination of almost total control and flexibility is its great appeal and, at the same time, the source of its worst mistakes: many companies move their on-premises habits to IaaS and end up paying for machines left running needlessly, or with a single VM that fails exactly like the server in the cabinet. In this lesson you will learn what you rent in IaaS and how, what its key characteristics are, what the life cycle of a virtual machine looks like and what impact each state has on the bill, what role images and quotas play, and why Hortalia's ERP is a natural candidate for this model.

  1. What IaaS is: definition and the resources you rent

NIST, in the same SP 800-145 document we used in Basic Concepts of Cloud Computing, defines IaaS as follows (in its original wording):

The capability provided to the consumer is to provision processing, storage, networks, and other fundamental computing resources where the consumer is able to deploy and run arbitrary software, which can include operating systems and applications. The consumer does not manage or control the underlying cloud infrastructure but has control over operating systems, storage, and deployed applications; and possibly limited control of select networking components (e.g., host firewalls).

Three expressions deserve attention:

  • "Fundamental resources": what you rent are basic pieces, not finished solutions. A virtual server, a disk, a network.
  • "Arbitrary software": you can install whatever you like, including an old operating system or a vendor's program that only works in one specific configuration. That freedom does not exist in PaaS or SaaS.
  • "Limited control of networking": you configure your virtual networks and rules, but not the provider's physical switches.

1.1 The building blocks you rent

Block What it is How it is metered for billing (typical) Examples
Compute Virtual machines with a number of vCPUs and an amount of memory Time powered on (per second, minute, or hour) according to size Azure Virtual Machines, Amazon EC2, Compute Engine
Block storage Virtual disks attached to a VM GB provisioned per month, sometimes performance (IOPS) Azure Managed Disks, Amazon EBS, Persistent Disk
File and object storage Shared folders and "buckets" of files reachable over the network or an API GB stored, operations, transfer Azure Files and Blob, Amazon EFS and S3, Filestore and Cloud Storage
Networking Virtual networks, public IPs, load balancers, VPN Resource hours and GB transferred (especially outbound) Azure VNet, Amazon VPC, Google VPC
Supporting services Images, snapshots, basic monitoring GB stored, metrics Snapshots, image galleries

Each of these blocks is covered in detail in IaaS Components: Compute, Storage, and Networking. What matters here is the overall idea: a "machine in the cloud" is not a single product, but the combination of several resources that are billed separately. When Laura creates a VM, she is really creating a VM, a system disk, a network interface and, perhaps, a public IP. Deleting the VM does not always delete the rest.

1.2 What IaaS is not

  • It is not a rented physical server. Except in specific offerings (bare metal or dedicated hosts), you share hardware with other customers through the hypervisor, as we saw in Virtualization and Data Centers.
  • It is not hosting by another name. If there is no API self-service, pay-per-use, and elasticity, it is not IaaS however loudly the advert says "cloud".
  • It is not "someone administers my server". The provider maintains the hardware and the hypervisor; the operating system and everything above it are still yours.

  1. How IaaS is consumed: console, CLI, and API

Every IaaS resource can be created in three ways, which underneath are the same one: a call to the provider's API (we saw this with the control plane in 01-02).

Route What it is Advantages Drawbacks When to use it
Web console Graphical portal (Azure Portal, AWS Management Console, Google Cloud Console) Intuitive, you discover options Slow for repeated tasks; hard to document and reproduce Learning, exploring, one-off checks
CLI Command-line tool (az, aws, gcloud) Fast, can be saved in scripts You have to learn the syntax Operational tasks, small scripts
API / SDK / IaC Direct HTTPS calls, libraries (Python, .NET...) or Infrastructure as Code tools Reproducible, versionable, automatable Steeper learning curve Environments that are repeated or must be audited

A simple query with the Azure CLI, which Laura uses to see what machines she has in the test resource group she created in module 1:

az vm list \
    --resource-group rg-hortalia-pruebas \
    --show-details \
    --output table
  • az vm list: lists the virtual machines the user has access to.
  • --resource-group rg-hortalia-pruebas: limits the list to the given resource group. A resource group is an Azure logical container that groups a project's resources; deleting the group deletes everything inside it.
  • --show-details: adds information not shown by default, such as the power state (powerState) and the IPs.
  • --output table: formats the response as a readable table. Without this option, the CLI returns JSON, which is more useful for scripts.

Example output (fictional data):

Name           ResourceGroup        PowerState      PublicIps    PrivateIps    Location
-------------  -------------------  --------------  -----------  ------------  ------------
vm-prueba-erp  rg-hortalia-pruebas  VM deallocated  20.199.45.10  10.0.0.4      spaincentral

Note two details we will come back to in the next lesson: the VM has a public IP and a private IP in the 10.0.0.0/16 network. Laura did not decide that: those are the default values applied by az vm create when she created it quickly in module 1. They may be fine for a five-minute test; for the ERP, they are not.

The equivalents in AWS and Google Cloud would be aws ec2 describe-instances and gcloud compute instances list. The syntax changes, but the concept is identical.

  1. Key characteristics of IaaS

3.1 On-demand self-service

Nobody from the provider gets involved: Laura asks for a VM and has it within a minute or a few. This changes timelines radically. Where previously you had to request a quote, wait for the server to be delivered and rack it in the cabinet, now there is a command. The flip side is that anyone with permissions can create resources that cost money, so permissions and spending alerts are part of the design from day one.

3.2 Elasticity: vertical and horizontal scaling

In IaaS there are two ways to adjust capacity:

  • Vertical scaling (scale up / scale down): swap the VM for a bigger or smaller one (more vCPUs, more memory). It is simple and does not require changing the application, but it normally requires restarting the VM and has a ceiling: the largest size available.
  • Horizontal scaling (scale out / scale in): add or remove identical VMs behind a load balancer. It has no practical ceiling and allows you to tolerate failures, but the application must be ready to spread across several machines (no local state, shared sessions, and so on).
flowchart LR
    subgraph V["Vertical scaling"]
        direction LR
        V1["VM<br/>2 vCPU / 8 GB"] -->|"resize<br/>(restart)"| V2["VM<br/>4 vCPU / 16 GB"]
    end
    subgraph H["Horizontal scaling"]
        direction LR
        LB["Load balancer"] --> H1["VM 1"]
        LB --> H2["VM 2"]
        LB --> H3["VM 3 (added)"]
    end
Criterion Vertical Horizontal
Changes to the application None Often needed
Interruption Brief restart None if well designed
Limit Maximum VM size Practically unlimited
Fault tolerance No improvement (still one VM) Improves (several VMs)
Automation Manual or scheduled Automatic with scaling groups (VM Scale Sets, Auto Scaling groups, Managed Instance Groups)
Fits Monolithic applications, databases Stateless websites and services

At Hortalia, Marc's online store, with peaks from 300 to 6,000 visits per hour, is the textbook example of horizontal scaling (and, as we will see in module 3, it is probably better solved in PaaS). The ERP, by contrast, is a monolith with its database: it only allows vertical scaling.

3.3 Pay-per-use and fine-grained billing

IaaS resources are billed for the time they exist or are powered on. The large providers bill compute per second or per minute (depending on the provider, the operating system, and the licenses included, with minimums in some cases). Three purchasing options coexist:

Option How it works Indicative discount Risk
On demand (pay as you go) You pay for time used, with no commitment None (reference price) None; it is the most expensive per hour
Commitment (reservations, savings plans) You commit to 1 or 3 years of usage Significant (what we modelled as 30% in 01-03) You pay even if you do not use it
Spare capacity (spot) You use the provider's free capacity, which it can reclaim Very high The VM can be stopped at short notice

The details of spot VMs are covered in 02-02, and the analysis of prices and TCO in Costs and TCO. What matters now: pay-per-use only saves money if you switch off what you are not using. A VM running 24/7 at the on-demand price is the most expensive way to own a server.

3.4 Full control of the operating system

In IaaS you are the administrator of the machine: you choose the image, install software, change the Windows registry, configure services, define local users. That is what makes it possible to move applications to the cloud that demand one specific configuration and would not work on a PaaS platform. It also means that patching, hardening, and monitoring that system is your job.

3.5 High availability is the customer's responsibility

This is the point that most surprises anyone coming from an on-premises data center: a VM in the cloud is not "high availability" in itself. The provider protects its hardware and, if a physical server fails, restarts your VM on another one (which translates into minutes of outage). If you need the service to keep running when a server or a data center fails, you have to design that yourself with the tools on offer:

Tool What it protects against Example in Azure AWS / Google equivalent
A single VM with premium SSD disks Hardware failure (with automatic restart) VM with Premium SSD EC2 instance / Compute Engine VM
Several VMs in different racks of the same data center Failure of a rack or maintenance Availability Set (fault and update domains) Placement groups (spread) / placement policies
Several VMs in different availability zones Outage of a whole data center VMs deployed in zones 1, 2, and 3 Instances across several AZs / zones
Copy or replica in another region Regional disaster Azure Site Recovery, replicated backups AWS Elastic Disaster Recovery / cross-region copies

As a guide, Azure publishes different availability commitments (SLAs) depending on the design: of the order of 99.9% for a single VM with premium disks, 99.95% with an Availability Set, and 99.99% for VMs across two or more zones (always check the current SLA). Translated: 99.9% allows around 8.8 hours of outage per year; 99.99%, less than one hour. But beware: having two VMs in two zones only helps if the application knows how to run with two VMs. Recovering the service in another region belongs to disaster recovery, which we will see as a use case in IaaS Use Cases.

  1. The life cycle of a virtual machine and its impact on the bill

A VM goes through several states. Understanding them is essential to avoid overpaying, because "powered off" does not always mean "free".

stateDiagram-v2
    [*] --> Creating: az vm create
    Creating --> Running: provisioned
    Running --> Stopped: shut down from the OS or az vm stop
    Stopped --> Running: az vm start
    Running --> Deallocated: az vm deallocate
    Stopped --> Deallocated: az vm deallocate
    Deallocated --> Running: az vm start
    Running --> Running: az vm resize (restart)
    Deallocated --> Deallocated: az vm resize
    Running --> Deleted: az vm delete
    Deallocated --> Deleted: az vm delete
    Deleted --> [*]
State (Azure) What it means Is compute billed? Are disks billed? Notes
Running (Running) The VM is powered on in a physical host Yes Yes Normal working state
Stopped (Stopped) The OS is shut down, but the host still reserves CPU and memory for it Yes Yes Classic trap: shutting Windows down from inside leaves the VM in this state
Deallocated (Stopped (deallocated)) The host's CPU and memory are released No Yes You lose the temporary disk and, if they are dynamic, the public and private IPs
Deleted The VM ceases to exist No It depends: the system disk and the data disks can be left "orphaned" if they are not deleted Check that no disks, IPs, or NICs are left behind

The other providers have equivalent states: in AWS, stop releases compute and you keep paying for the EBS volumes; in Google Cloud, stop leaves the VM in TERMINATED state (with no compute cost) and there is also suspend, which saves the memory.

4.1 The life-cycle operations with the CLI

# Start the ERP test VM
az vm start --resource-group rg-hortalia-pruebas --name vm-prueba-erp

# Stop WITHOUT releasing resources (compute is still billed)
az vm stop --resource-group rg-hortalia-pruebas --name vm-prueba-erp

# Stop and deallocate (compute stops being billed)
az vm deallocate --resource-group rg-hortalia-pruebas --name vm-prueba-erp

# See which sizes this VM can be changed to
az vm list-vm-resize-options --resource-group rg-hortalia-pruebas \
    --name vm-prueba-erp --output table

# Resize (vertical scaling): the VM restarts
az vm resize --resource-group rg-hortalia-pruebas --name vm-prueba-erp \
    --size Standard_D8s_v5

# Delete the VM (asks for confirmation; --yes skips it)
az vm delete --resource-group rg-hortalia-pruebas --name vm-prueba-erp

Explanation:

  • Every command identifies the VM with --resource-group and --name.
  • az vm stop shuts down the operating system but keeps the reservation on the host. Azure even shows a warning reminding you that billing continues. It only makes sense if you need to start up again very quickly on the same host.
  • az vm deallocate is the operation that really saves money. Use it for environments that are not needed at night or at the weekend.
  • az vm list-vm-resize-options shows the sizes compatible with the hardware the VM is on. If the size you want does not appear, you may need to deallocate first so that Azure moves it to another type of host.
  • az vm resize --size Standard_D8s_v5 goes from 4 vCPUs and 16 GB (D4s_v5) to 8 vCPUs and 32 GB. It is the way to respond to a year-end close with heavy load on the ERP... and to go back to the original size afterwards.
  • az vm delete deletes the VM. In current CLI versions, the resources created alongside the VM can be configured to be deleted with it (options --os-disk-delete-option and similar when creating it); otherwise they are left orphaned and keep billing.

4.2 An example of the impact on the bill

Let us assume, with an illustrative figure, that a test VM costs €0.40 per hour of compute and its disks €20 per month:

Usage Compute hours per month Compute Disks Monthly total (illustrative)
Running 24/7 730 €292 €20 €312
"Powered off" from Windows at night (Stopped state) 730 (still billed) €292 €20 €312
Deallocated outside office hours (≈220 h) 220 €88 €20 €108
Deallocated all month 0 €0 €20 €20

The second row is the lesson: shutting down from the operating system saves nothing in Azure. Automating the schedule of a test environment is one of the quickest savings in IaaS, and we will do it for Hortalia's ERP in IaaS Use Cases.

  1. Images and templates

An image is the template from which a VM's system disk is created: it contains the operating system and, optionally, preinstalled software.

Type of image Who maintains it Example Typical use
Official image from the provider or the OS vendor The provider / vendor Windows Server 2022 Datacenter, Ubuntu 24.04 LTS The usual starting point
Marketplace image with software A software vendor Windows Server 2022 + SQL Server 2022 Standard, with the license included in the hourly price Save on installation and buy the license by usage
Custom image The customer Hortalia's "golden image": hardened Windows + agents + .NET Framework Create many identical, consistent VMs

To find the SQL Server on Windows Server images that Microsoft offers in Azure:

az vm image list \
    --publisher MicrosoftSQLServer \
    --offer sql2022-ws2022 \
    --location spaincentral \
    --all \
    --output table
  • --publisher MicrosoftSQLServer: the publisher of the image (Microsoft, for SQL Server).
  • --offer sql2022-ws2022: the offer: SQL Server 2022 on Windows Server 2022.
  • --location spaincentral: only those available in the Madrid region.
  • --all: queries the full catalogue instead of a shortened list cached in the CLI.
  • In the output you will see several SKUs of the offer, for example standard-gen2, enterprise-gen2, or sqldev-gen2 (Developer edition, free for development and testing, never for production).

Each image is identified by a URN with four parts, publisher:offer:sku:version (for example MicrosoftSQLServer:sql2022-ws2022:standard-gen2:latest), which is what you pass to az vm create --image.

Custom images are stored and versioned in specific services (Azure Compute Gallery, AMI in AWS, custom images in Google Cloud). The typical process on Windows is: prepare a VM, generalise it with Sysprep (which removes the machine's own identity), capture it as an image, and publish it in the gallery. Building images automatically and repeatably is related to Infrastructure as Code.

An important nuance about images with the license included: the license is part of the hourly price. That is convenient (you only pay for what you use), but for 24/7 workloads it is worth comparing with bringing your own licenses, something that depends on each provider's terms and that we will see in Popular IaaS Providers.

  1. Quotas and limits

"Unlimited capacity" is a marketing aspiration; in practice, every subscription has quotas that the provider imposes to protect itself from abuse (and to protect you from expensive mistakes).

Type of limit Example Can it be raised?
vCPU quota per region Maximum total vCPUs in spaincentral Yes, with a request (often automatic)
vCPU quota per family Maximum vCPUs in the Dsv5 family Yes, with a request
Per-resource limits Maximum number of data disks per VM (depends on the size; a D4s_v5 allows 8) No: it is a characteristic of the size
Performance per size Maximum disk IOPS and MB/s a VM can handle No: if it is not enough, you have to change size
Regional availability A specific size (for example, the newest series or GPU ones) may not exist in a region or may be temporarily sold out Not up to you: choose another size or region

Laura checks her quota before anything else:

az vm list-usage --location spaincentral --output table \
    | grep -E "Total Regional vCPUs|DSv5"
  • az vm list-usage --location spaincentral: shows the current usage and the limit of each compute quota in the region.
  • | grep -E "...": filters the output so we keep only the total regional quota and the DSv5 family one.

Example output:

CurrentValue    Limit    LocalName
--------------  -------  ------------------------------------
4               10       Total Regional vCPUs
4               10       Standard DSv5 Family vCPUs

Interpretation: she has 4 vCPUs in use (the test VM) against a limit of 10. If she tried to resize it to a D8s_v5 (8 vCPUs) while it is running alongside another VM, she could exceed the quota and the command would fail with a QuotaExceeded type of error. New or free subscriptions usually have low quotas: ask for the increase before you need it, not on migration day.

  1. What is still yours in IaaS

In The Shared Responsibility Model we saw the full table; here we translate it into the concrete operational tasks of whoever administers IaaS:

Task Typical frequency Provider tools that help (but do not do it for you)
Patch the OS and middleware Monthly (and urgently if there are critical vulnerabilities) Azure Update Manager, AWS Systems Manager Patch Manager
Harden the OS (services, accounts, local firewall) When building the image and at reviews Security baselines, Microsoft Defender for Cloud
Define network rules and exposure At every change NSG / security groups, exposure analysis
Backups and restore tests Daily / quarterly Azure Backup, AWS Backup
Monitor performance and availability Continuous Azure Monitor, CloudWatch, Cloud Monitoring
Right-size and switch off what is not used Monthly Recommendations from Azure Advisor and equivalents
Design high availability and recovery At design time and in drills Zones, Site Recovery

The idea worth keeping is that in IaaS the provider gives you tools, not results: Azure Update Manager can install patches, but deciding when, testing them, and checking that the ERP still works is Laura's job.

  1. Hortalia: why the ERP is a good candidate for IaaS

Let us recall the ERP: software from an external vendor on .NET Framework, with SQL Server and Windows Server, on a 2017 server. Laura reviews each characteristic of IaaS against the ERP's needs:

ERP need Does IaaS cover it? Comment
The vendor certifies specific versions of Windows Server and SQL Server Yes Laura picks exactly the certified image (Windows Server 2022 + SQL Server 2022)
Installation with wizards, Windows services, and its own registry keys Yes Full control of the OS; in PaaS it would not be possible
There is no access to the source code to adapt it Yes IaaS does not require touching the application ("lift and shift")
Steady load, during office hours, with peaks at month-end closes Yes Fixed size with occasional vertical scaling
It must not be exposed to the internet Yes VM with no public IP, reachable only over VPN (we will design this in 02-02)
Backups outside the cabinet Yes Backups to object storage, in another location

And why not go straight to PaaS or SaaS? Laura notes it down for module 5: a managed SQL Server database (such as Azure SQL Managed Instance) would take SQL Server patching away, but you have to confirm that the vendor supports it; and a SaaS version of the ERP would mean changing product or licensing model, a far bigger project. To take the first step, getting the ERP out of the cabinet with minimum risk, IaaS is the natural option.

That is why Laura is going to prototype the ERP in Azure, in the spaincentral region: it fits well with Windows Server, SQL Server, and their licenses, and it lets her measure real performance and costs. It is a proof of concept; the final decision on model and provider will be taken with complete criteria in module 5. We will keep the vm-prueba-erp VM (Standard_D4s_v5, Windows Server 2022) from module 1 as our starting point.

Common Mistakes and Tips

  • "Powering off" from the operating system and believing you are not billed. In Azure, the VM ends up Stopped and compute is still billed. Deallocate with az vm deallocate or from the Stop button in the portal.
  • Deleting the VM and forgetting its disks, IPs, and interfaces. Review the resource group after deleting, or use one resource group per project so you can delete everything together.
  • Assuming a VM means high availability. A VM is a single point of failure with an automatic restart. Availability is designed with zones, availability sets, and backups.
  • Confusing vertical scaling with horizontal. Adding VMs does not speed up a monolithic ERP; only a bigger VM (or optimising the database) will.
  • Discovering quotas on migration day. Check az vm list-usage and request increases in advance.
  • Using the Developer edition of SQL Server in production. It is free only for development and testing; in production it breaches the license.
  • Tip: from the very beginning, tag every resource with at least project, environment, and owner. In IaaS you create many small resources, and without tags it is impossible to know who owns what.

Exercises

Exercise 1. Classify each action as vertical or horizontal scaling and say whether it would work for Hortalia's ERP: a) changing the ERP VM from D4s_v5 to D8s_v5 for the year-end close; b) adding two more VMs behind a load balancer for the online store at Christmas; c) adding a second VM with the ERP to "spread" the users.

Exercise 2. On a Friday at 19:00, a technician shuts down the vm-prueba-erp VM from the Windows Start menu. On Monday, Sara sees that the whole weekend has been billed. Explain what happened, what state Azure shows, and what command should have been used. Using the illustrative rate of €0.40/h, calculate how much would have been saved between Friday at 19:00 and Monday at 08:00.

Exercise 3. Laura has a regional quota of 10 vCPUs in spaincentral. She has vm-prueba-erp running (D4s_v5, 4 vCPUs) and wants to create a second D4s_v5 test VM and, on top of that, resize the first one to D8s_v5. Will she be able to? What options does she have?

Solutions

Solution 1.

  • a) Vertical. It does work for the ERP: more vCPUs and memory without touching the application, with a restart in an agreed window.
  • b) Horizontal. It works for the online store (a stateless web application), not for the ERP.
  • c) Horizontal, but it does not work for the ERP: a monolith with a single SQL Server database cannot be spread across two independent VMs; you would end up with two ERPs holding different data. It would also duplicate licenses.

Common mistake: thinking that "more machines" always means "more capacity". That is only true if the application is designed for it.

Solution 2. Shutting Windows down from inside leaves the VM Stopped (Stopped): the operating system is off, but Azure keeps CPU and memory reserved on the host and keeps billing compute. The command that should have been used is az vm deallocate --resource-group rg-hortalia-pruebas --name vm-prueba-erp (or the Stop button in the portal, which deallocates). From Friday at 19:00 to Monday at 08:00 there are 5 + 24 + 24 + 8 = 61 hours; at €0.40/h, €24.40 that would have been saved on compute (the disks are billed regardless). It looks small, but it is around €100 a month on weekends alone, for a single VM.

Solution 3. No. She is already using 4 vCPUs; the second VM would add 4 (8 in total) and resizing the first one to 8 vCPUs would take the total to 12, above the limit of 10. Options: request a quota increase (the sensible choice if the plan requires it); create the second VM with a smaller size, for example D2s_v5 (2 vCPUs, 10 in total); or deallocate one of the two when it is not in use, since deallocated VMs do not consume vCPU quota.

Conclusion

IaaS is the on-demand rental of the fundamental building blocks of computing (compute, storage, and networking), consumed through a console, a CLI, or an API, and over which the customer has full control of the operating system. Its key characteristics are self-service, elasticity (vertical, with a restart and a ceiling; horizontal, if the application allows it), pay-per-use with fine-grained billing, and the ability to build high availability, which does not come as standard: the customer designs it with zones and backups. You have seen the life cycle of a VM and the difference, critical for the bill, between stopped and deallocated; the role of images and quotas; and why Hortalia's ERP, third-party software tied to Windows Server and SQL Server, is a natural candidate for IaaS.

We have talked about "a VM", but Laura will actually need to choose a specific size, disks with the performance SQL Server demands, somewhere to keep the backups, and a private network connected to the warehouse over VPN. Those pieces, and the target architecture of the ERP in Azure, are the subject of the next lesson: IaaS Components: Compute, Storage, and Networking.

© Copyright 2026. All rights reserved