Azure Virtual Machines

Microsoft Docs

Azure Managed Disks

Azure Managed Disks are a storage solution that simplifies disk management for Azure Virtual Machines. Instead of managing storage accounts yourself, Azure manages the storage for your disks. Managed Disks provide high availability, durability, and performance for your virtual machine workloads.

This documentation provides a comprehensive guide to understanding, using, and managing Azure Managed Disks for your virtual machines.

What are Managed Disks?

Managed Disks are a wrapper around Azure Storage that abstracts away the underlying storage account details. When you create a virtual machine with Managed Disks, Azure automatically creates three types of disks for you:

  • OS Disk: The disk where the operating system is installed.
  • Data Disk(s): Additional disks for storing application data and other information.
  • Temporary Disk: A disk for temporary storage that is volatile and should not be used for persistent data.

Managed Disks are resilient and designed to provide high availability for your virtual machines. They offer a financially backed SLA of 99.9% availability.

Azure Managed Disk Types

Azure offers several types of managed disks, each with different performance characteristics and price points. Choosing the right disk type is crucial for optimizing your VM's performance and cost.

Ultra Disk

Ultra Disk is the highest-performing, most flexible disk offering for Azure Virtual Machines. It allows you to provision and adjust performance (IOPS and throughput) independently of disk size. It's ideal for workloads requiring consistent performance and low latency, such as SAP HANA, top-tier SQL databases, and other mission-critical applications.

  • Performance: Up to 128,000 IOPS and 4,000 MB/s throughput
  • Availability: 99.9% SLA
  • Use Cases: High-demand databases, I/O-intensive applications.

Premium SSD

Premium SSD managed disks offer high-performance, low-latency solid-state drive storage. They are suitable for most production workloads, including development and test environments, small to medium databases, and web servers.

  • Performance: Up to 20,000 IOPS and 1,000 MB/s throughput (varies by disk size)
  • Availability: 99.9% SLA
  • Use Cases: Production workloads, databases, enterprise applications.

Standard SSD

Standard SSD managed disks provide cost-effective, reliable SSD-based storage. They offer consistent performance, lower latency than standard HDDs, and are ideal for workloads that need to run in a production environment but don't require the low latency of premium SSDs.

  • Performance: Up to 6,000 IOPS and 900 MB/s throughput (varies by disk size)
  • Availability: 99.9% SLA
  • Use Cases: Web servers, development/test environments, lightly used applications.

Standard HDD

Standard HDD managed disks are the most cost-effective option, offering reliable rotational hard drive storage. They are suitable for workloads that are less sensitive to performance, such as backup, non-critical batch jobs, and disaster recovery scenarios.

  • Performance: Up to 2,000 IOPS and 600 MB/s throughput (varies by disk size)
  • Availability: 99.9% SLA
  • Use Cases: Archiving, backup, disaster recovery, low-throughput workloads.

Common Disk Operations

Managing your virtual machine disks involves several common operations. Here are some of the most frequently performed tasks:

Create a Managed Disk

You can create a managed disk from a snapshot, another disk, a VHD file, or an empty disk of a specified size and type.

az disk create --resource-group MyResourceGroup --name MyManagedDisk --sku Premium_LRS --size-gb 128

Attach a Disk to a VM

To add storage capacity to a running VM, you can attach an existing managed disk to it.

az vm disk attach --vm-name MyVM --resource-group MyResourceGroup --name MyManagedDisk --lun 1

Detach a Disk from a VM

You can detach a data disk from a VM, allowing you to reattach it to another VM or manage it independently.

az vm disk detach --vm-name MyVM --resource-group MyResourceGroup --name MyManagedDisk

Create a Snapshot

Snapshots are point-in-time copies of a managed disk, useful for backups and disaster recovery.

az snapshot create --resource-group MyResourceGroup --name MySnapshot --source MyManagedDisk

Copy a Disk

Managed disks can be copied to different regions or storage accounts for disaster recovery or data migration purposes.

az disk create --resource-group MyResourceGroup --name MyCopiedDisk --source MyManagedDisk --sku Premium_LRS --zone 1 --target-region eastus2

Managed Disks vs. Unmanaged Disks

In the past, Azure VMs used unmanaged disks, where you were responsible for managing the underlying storage accounts. Managed Disks simplify this by abstracting storage account management. All new VM deployments should use Managed Disks.

Feature Managed Disks Unmanaged Disks
Storage Management Azure managed Customer managed storage accounts
High Availability 99.9% SLA (single disk) Depends on storage account redundancy (LRS, ZRS, GRS)
Disk Limits No Azure storage account limits apply to individual disks Limited by storage account IOPS/throughput limits
Scalability Easier scaling, more disk types Requires managing scaling of storage accounts

Performance Considerations

Understanding the performance characteristics of different disk types is vital for application performance. Key metrics include IOPS (Input/Output Operations Per Second) and throughput (MB/s).

Note: Performance can vary based on VM size, disk size, and caching settings. Always test your specific workload performance.

Azure provides disk caching options (Read-only, Read-write) to improve read performance. For data disks, read-write caching is generally recommended for databases and applications with mixed read/write workloads.

Azure Managed Disk Pricing

Pricing for managed disks is based on the type of disk, the provisioned capacity (GB), the number of IOPS, and the throughput (MB/s). Data transfer costs also apply.

You can find detailed pricing information on the official Azure pricing page.

Tip: Consider using Standard SSDs for cost-effectiveness in non-production or less demanding production workloads.