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.
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:
- Manual Storage Management: You must create, manage, and scale the storage accounts yourself.
- Blob Storage: Disks are stored as page blobs in Azure Storage Accounts.
- Performance Considerations: Performance can be dependent on the storage account's performance tier and the proximity of blobs within the account.
- Higher Management Overhead: Requires more operational effort for tasks like provisioning, scaling, and maintenance.
When to Use Unmanaged Disks
While managed disks offer significant advantages, unmanaged disks might still be encountered or considered in specific situations:
- Legacy Applications: Applications or infrastructure that were deployed before managed disks were widely available and haven't been migrated.
- Specific Control Requirements: Scenarios where granular control over the exact location and configuration of disk blobs within a storage account is critically needed, though this is rare.
- Disaster Recovery Scenarios: Certain complex disaster recovery strategies might involve direct manipulation of storage accounts.
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:
- Provisioning Storage Accounts: Creating standard or premium storage accounts.
- Creating Containers: Setting up containers within storage accounts to hold VHD blobs (e.g., a 'vhds' container).
- Uploading/Downloading VHDs: Using tools like AzCopy or Azure Storage Explorer to manage VHD files.
- Monitoring Storage Performance: Keeping an eye on storage account metrics for performance and availability.
- Scaling Storage Accounts: Adjusting storage account settings if performance bottlenecks occur.
Migrating to Managed Disks
For most scenarios, migrating from unmanaged disks to managed disks is highly recommended. Azure provides tools to simplify this process.
- Azure Portal: A straightforward migration wizard is available in the portal.
- Azure CLI: Use commands like
az vm convert. - Azure PowerShell: Use cmdlets like
Move-AzVM -VM $vm -DestinationManagedDisk -Zone 1.
Benefits of Managed Disks:
- Simplified Management: Azure handles the storage account management.
- High Availability: Built-in redundancy and fault tolerance.
- Performance Tiers: Easily choose between Standard HDD, Standard SSD, Premium SSD, and Ultra Disk.
- Scalability: Scale disk capacity and performance independently.
- Snapshots and Backups: Integrated snapshot and backup capabilities.
Further Reading
Explore these resources for deeper insights: