flowchart TB
VM["vm-web"] --> OS["OS disk (managed)<br/>/dev/sda, C:"]
VM --> T["Temporary disk (on the host)<br/>/mnt or D: — may be lost"]
VM --> DD["Data disk data1 (managed)<br/>LUN 0"]
OS --> ST[("Azure Storage")]
DD --> ST
| Disk | Behaviour |
|---|---|
| OS disk | Holds the operating system; a durable managed disk |
| Temporary disk | On the physical host, fast; data is lost when the VM is deallocated, resized, redeployed or the host fails — use it only for swap/cache. Some newer sizes have no temp disk |
| Data disk | Added for application data; each size limits the maximum number of disks |
Managed disk types
| Type | Used for |
|---|---|
Standard HDD (Standard_LRS) |
Backups, rarely used dev/test |
Standard SSD (StandardSSD_LRS) |
Web, dev/test needing consistency |
Premium SSD (Premium_LRS) |
Production, databases |
| Premium SSD v2 / Ultra | Very high IOPS, flexible performance tuning |
- Managed disks are the only option now; unmanaged disks (VHDs in your own storage account) were retired (09/2025).
- ZRS versions (
Premium_ZRS,StandardSSD_ZRS) survive losing a zone. - A newly attached data disk is blank: partition, format and mount it inside the OS.
az vm stop only shuts down the OS — compute is still billed; az vm deallocate releases the hardware (compute billing stops, the temp disk is wiped).
| Command | Meaning |
|---|---|
az vm disk attach -g rg-devops-lab --vm-name vm-web --name data1 --new --size-gb 32 |
Create and attach a 32 GiB data disk |
az vm deallocate -g rg-devops-lab -n vm-web |
Stop and end compute billing |
Preparing a new data disk on Linux
lsblk # find the new disk, e.g. sdc
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
sudo mkfs.xfs /dev/sdc1
sudo mkdir -p /data && sudo mount /dev/sdc1 /data
sudo blkid /dev/sdc1 # copy the UUID into /etc/fstab
Use the UUID in /etc/fstab with the nofail option, because device names like sdc can change between reboots.
Performance limits
A disk's IOPS and throughput depend on its type and size, and the VM size has its own caps. A fast disk on a small VM is limited by the VM, so check both. Premium SSD v2 and Ultra let you set IOPS and throughput separately from capacity. Smaller Premium SSDs can burst above their baseline for short periods.
Host caching stores disk reads on the host: ReadOnly suits database data disks, None suits write-heavy log disks, and ReadWrite is mainly for the OS disk.
Snapshots, images, and resizing
- A snapshot is a point-in-time copy of one disk, useful before risky changes; incremental snapshots store only changes.
- An image captures a generalised VM so you can create many identical VMs.
- A managed disk can be expanded, often without stopping the VM, but never shrunk; grow the partition and filesystem inside the OS afterwards.
- Shared disks let some disk types attach to several VMs for clustered applications.
Encryption
All managed disks are encrypted at rest with platform-managed keys. You can use customer-managed keys through a disk encryption set, and encryption at host extends encryption to temporary disks and caches. For new deployments Microsoft recommends encryption at host over the older in-guest Azure Disk Encryption.
Delete disks you no longer need: a disk left after deleting its VM keeps costing money.