Overview and What You Will Learn
In this lab, you will create VMs with two different Managed Disk types, compare their performance characteristics directly, and understand exactly which workload each disk type is actually built for - so the choice is based on real requirements rather than defaulting to whatever the Portal suggests first.
Why This Matters in Production
A team at a trading platform like Zerodha runs their production database on a Standard HDD because it was the cheapest option shown during setup, and every query during peak trading hours becomes noticeably slower than expected. The database itself was never the problem - the underlying disk simply could not deliver the IOPS a transaction-heavy workload actually needs.
Core Principles
Azure offers four Managed Disk types, and the right choice depends on the workload's actual performance requirements, not a general sense of "production needs the best option."
+------------------------------------------+| Standard HDD || Lowest cost, lowest performance || Best for: backup, infrequently accessed data|+------------------------------------------+| Standard SSD || Moderate cost, moderate performance || Best for: web servers, light applications |+------------------------------------------+| Premium SSD || Higher cost, high consistent performance || Best for: production databases, I/O-heavy || workloads needing predictable latency |+------------------------------------------+| Ultra Disk || Highest cost, configurable extreme perf || Best for: SAP HANA, top-tier databases, || workloads needing independently tunable IOPS|+------------------------------------------+Every VM has an OS Disk (created automatically, holding the operating system) and can optionally have one or more Data Disks attached separately - keeping application data on its own Data Disk, rather than the OS Disk, makes resizing and replacing the VM itself far cleaner later.
Detailed Step-by-Step Practical Lab
- Create a Resource Group:
az group create --name rg-disks-lab-mumbai --location centralindia- Create a VM using a Standard SSD OS disk - a reasonable default for a general-purpose workload:
az vm create \ --resource-group rg-disks-lab-mumbai \ --name vm-standard-lab \ --image Ubuntu2204 \ --size Standard_B2s \ --storage-sku Standard_LRS \ --admin-username azureadmin \ --generate-ssh-keys- Attach a separate Premium SSD Data Disk to the same VM, simulating a scenario where application data needs stronger performance than the OS disk itself:
az disk create \ --resource-group rg-disks-lab-mumbai \ --name disk-app-data-premium \ --size-gb 128 \ --sku Premium_LRS az vm disk attach \ --resource-group rg-disks-lab-mumbai \ --vm-name vm-standard-lab \ --name disk-app-data-premium- SSH into the VM and confirm the new disk is visible at the OS level:
lsblk## Expected: a new disk device appears, separate from the OS disk- Format and mount the new Premium SSD disk as a dedicated location for application data:
sudo mkfs.ext4 /dev/sdcsudo mkdir -p /datasudo mount /dev/sdc /data- Check the disk's configured performance tier and compare it against the Standard SSD OS disk:
az disk show \ --resource-group rg-disks-lab-mumbai \ --name disk-app-data-premium \ --query "sku.name" --output tsv az disk show \ --resource-group rg-disks-lab-mumbai \ --name disk-app-data-premium \ --query "diskIOPSReadWrite" --output tsvNote
diskIOPSReadWriteshows the guaranteed performance ceiling for this specific disk - Premium SSD guarantees meaningfully higher and more consistent values than Standard SSD at the same size, which is exactly the trade-off being paid for.
- Clean up:
az group delete --name rg-disks-lab-mumbai --yes --no-waitProduction Best Practices & Common Pitfalls
Common MistakeChoosing Standard HDD or Standard SSD for a production database purely to minimize cost, without checking whether the workload's actual IOPS and latency requirements can be met by that disk tier. A database can look correctly configured in every other way and still perform poorly simply because the underlying disk cannot keep up.
TipKeep application data on a separate Data Disk from the OS Disk. This makes it possible to resize, snapshot, or even swap out the underlying VM entirely later, without the data's lifecycle being tied to the OS disk's lifecycle.
- Ultra Disk is the exception, not the default "best" choice. Its configurable, independently tunable IOPS and throughput are genuinely valuable for workloads like SAP HANA or the most demanding databases, but its cost and complexity are unnecessary for a typical web application.
- Disk performance is also affected by VM size, not just disk SKU. Some VM sizes cap the total achievable IOPS across all attached disks - pairing a Premium SSD with an undersized VM can still leave performance on the table.
Quick Reference & Troubleshooting Commands
| Command | Description |
|---|---|
az disk create |
Create a new Managed Disk |
az vm disk attach |
Attach an existing disk to a VM |
az disk show --query diskIOPSReadWrite |
Check a disk's guaranteed IOPS |
lsblk |
List block devices visible inside the VM's OS |