VM sizes, disk types, and managed disks
Azure organizes VM sizes into families based on the workload they are designed for. General Purpose VMs (B, D, Dsv series) balance CPU and memory for web servers, small databases, and development environments. Compute Optimized VMs (F series) have a high CPU-to-memory ratio for CPU-intensive workloads like batch processing. Memory Optimized VMs (E, M series) have a high memory-to-CPU ratio for large databases and in-memory analytics. Storage Optimized VMs (L series) have high local disk throughput for big data and NoSQL workloads. GPU VMs (N series) include graphics cards for machine learning training, simulation, and rendering.
Managed disks handle the storage layer for VM disks. Azure manages the storage account and redundancy behind the scenes, and you work with a disk resource directly. Standard HDD managed disks use magnetic storage for development, test, and non-critical workloads where cost matters more than latency. Standard SSD offers better consistency than HDD for lightly loaded production workloads. Premium SSD provides high IOPS and low latency for production databases and performance-sensitive applications. Ultra Disk delivers the highest IOPS and lowest latency of any disk type, configurable at the microsecond level, for workloads like SAP HANA or high-frequency trading databases.
Every VM has an OS disk for the operating system, optional data disks for application data, and a temporary disk for page files and swap space. The temporary disk is ephemeral: data on the temporary disk is lost if the VM is stopped or restarted. Never store data you want to keep on the temporary disk. Data disks persist across restarts and can be detached and reattached to other VMs.
Extensions, Hybrid Benefit, Spot VMs, and availability
VM extensions are small applications that run on Azure VMs to automate configuration and management tasks after deployment. The Custom Script Extension downloads and runs scripts on a VM, useful for configuring software after provisioning. The Azure Monitor Agent extension installs monitoring capabilities. The Desired State Configuration (DSC) extension applies and enforces a specific OS configuration. Extensions run after VM creation and integrate with Azure Resource Manager templates and Azure Policy for automated compliance.
Azure Hybrid Benefit lets you apply existing on-premises Windows Server or SQL Server licenses (with Software Assurance) to Azure VMs, reducing the cost of the Windows or SQL license component. For workloads migrating from on-premises environments with existing license agreements, Hybrid Benefit can reduce VM costs by up to 40%. Spot VMs use Azure's unused compute capacity at significant discounts (up to 90% off). The tradeoff is that Azure can evict Spot VMs with 30 seconds notice when it needs the capacity back. Spot VMs are appropriate for fault-tolerant, interruptible workloads: batch processing, rendering, machine learning training, and development environments.
Availability Sets and Availability Zones protect against different failure scenarios. An Availability Set distributes VMs across fault domains (separate physical racks with separate power and networking) and update domains (groups that Azure patches independently). With two VMs in an Availability Set, they are guaranteed to be on different fault domains: a rack failure does not take down both. Availability Zones place VMs in physically separate datacenters within a region, each with independent power, cooling, and networking. Zone failures are more severe than rack failures, so Availability Zones provide stronger protection at the cost of potential cross-zone latency.
How to choose the correct answer
VM size selection: General Purpose for balanced workloads, Compute Optimized for CPU-bound, Memory Optimized for large databases, GPU for ML/rendering.
Premium SSD: required for production database workloads with IOPS requirements. Not available on all VM sizes.
Temporary disk: ephemeral, lost on stop/deallocate. Only for swap and temp files. Never store persistent data.
Azure Hybrid Benefit: apply existing Windows or SQL Server licenses to save on Azure VM costs.
Spot VMs: discounted but evictable. For stateless, interruptible, fault-tolerant workloads.
Availability Set: fault domains protect against rack failures. Update domains protect during planned maintenance.
Availability Zones: physically separate datacenters, higher protection than Availability Sets, slight cross-zone latency.
Stop (deallocated) vs Stop (stopped): deallocated releases compute, you stop paying for the VM SKU. Stopped keeps the compute allocated.