Unmanaged Disks in Azure

This documentation provides a comprehensive guide to understanding and utilizing unmanaged disks within Azure Compute services. While managed disks are the recommended approach for new deployments, understanding unmanaged disks is crucial for legacy systems and specific scenarios.

Note: Microsoft strongly recommends using Azure Managed Disks for all new deployments. Unmanaged disks require more manual management of the underlying storage accounts.

What are Unmanaged Disks?

Unmanaged disks are a legacy storage option where you are responsible for managing the storage accounts that host your virtual machine disks. Each disk (OS disk and data disks) is stored as a separate page blob within an Azure Storage Account.

Key Characteristics:

When to Use Unmanaged Disks

While managed disks offer significant advantages, unmanaged disks might still be encountered or considered in specific situations:

Creating Unmanaged Disks

Unmanaged disks are typically created by specifying a Virtual Machine's disk configuration to point to a blob URI within a storage account.

Using Azure CLI:

az vm create \
    --resource-group myResourceGroup \
    --name myVM \
    --image UbuntuLTS \
    --admin-username azureuser \
    --admin-password 'ComplexPassword!123' \
    --vhd-uri https://mystorageaccount.blob.core.windows.net/vhds/myVM.vhd

Using PowerShell:

New-AzVM -ResourceGroupName "myResourceGroup" -Name "myVM" -Location "East US" -ImageName "UbuntuLTS" -VirtualNetworkName "myVnet" -SubnetName "mySubnet" -SecurityGroupName "myNSG" -PublicIpAddressName "myPublicIp" -VhdUri "https://mystorageaccount.blob.core.windows.net/vhds/myVM.vhd"

Managing Unmanaged Disks

Management of unmanaged disks involves interacting directly with Azure Storage Accounts and their blob containers.

Common Tasks:

Warning: Failure to properly manage the underlying storage account can lead to disk corruption, data loss, or poor virtual machine performance.

Migrating to Managed Disks

For most scenarios, migrating from unmanaged disks to managed disks is highly recommended. Azure provides tools to simplify this process.

Benefits of Managed Disks:

Further Reading

Explore these resources for deeper insights: