Site icon Digital Thought Disruption

Convert Azure VMs from Unmanaged to Managed Disks: A Production-Ready Runbook

TL;DR

Architecture Diagram

Table of Contents

Scenario

You’ve identified one or more production VMs still using unmanaged disks. You need a runbook you can hand to an operations team that:

Core Concepts

Prerequisites

Operational prerequisites:

Technical prerequisites:

Version Compatibility Matrix

ComponentWhat you needHow you verify
Azure CLIAzure CLI with az vm convert availableaz version and az vm convert --help
Azure PowerShellAz.Compute with ConvertTo-AzVMManagedDiskGet-Command ConvertTo-AzVMManagedDisk
PermissionsAt least Contributor on VM RGAttempt a no-op read and confirm rights before change window

Step-by-step

Step-by-step using Azure Portal

Use this when the count is low and you need a UI-backed change record.

Step-by-step using Azure CLI

Use this for repeatability and batch execution.

For a single VM:

# Deallocate
az vm deallocate --resource-group <rg> --name <vm>

# Convert unmanaged -> managed
az vm convert --resource-group <rg> --name <vm>

# Start
az vm start --resource-group <rg> --name <vm>

For availability set VMs, plan to convert the availability set and migrate all VMs in the set in the same window:

# Convert availability set
az vm availability-set convert --resource-group <rg> --name <availabilitySetName

Step-by-step using Azure PowerShell

Use this for Windows-heavy ops teams and richer scripting.

Single VM conversion:

$rgName = "<rg>"
$vmName = "<vm>"

# Deallocate
Stop-AzVM -ResourceGroupName $rgName -Name $vmName -Force

# Convert (converts OS + data disks)
ConvertTo-AzVMManagedDisk -ResourceGroupName $rgName -VMName $vmName

Availability set conversion reminder:

$rgName = "<rg>"
$avSetName = "<availabilitySet>"

$avSet = Get-AzAvailabilitySet -ResourceGroupName $rgName -Name $avSetName
Update-AzAvailabilitySet -AvailabilitySet $avSet -Sku Aligned

Validation

You want validation that proves:

Resource Graph validation query

Resources
| where type =~ 'microsoft.compute/virtualmachines'
| extend osDisk = properties.storageProfile.osDisk
| extend usesManagedOsDisk = isnotnull(osDisk.managedDisk)
| project subscriptionId, resourceGroup, name, location, usesManagedOsDisk

PowerShell validation

$vm = Get-AzVM -ResourceGroupName "<rg>" -Name "<vm>"
$vm.StorageProfile.OsDisk.ManagedDisk -ne $null

Validation checklist:

Troubleshooting Workflow

Common failure modes you should expect:

Operator workflow:

Rollback Considerations

This migration is best treated as non-reversible in place.

Practical rollback patterns:

Rollback decision gates:

Cost Model Snapshot

Hidden costs people forget:

FinOps checklist:

Best Practices

Conclusion

The conversion commands are easy. The success criteria are not. If you treat this like a production change with pre-flight, validation, and cleanup, you can migrate quickly without last-minute firefighting.

Sources

Migrate your Azure unmanaged disks by March 31, 2026: https://learn.microsoft.com/en-us/azure/virtual-machines/unmanaged-disks-deprecation
Convert a Windows VM from unmanaged disks to managed disks: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks
Convert a Linux VM from unmanaged disks to managed disks: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks
Frequently asked questions about disks: https://learn.microsoft.com/en-us/azure/virtual-machines/faq-for-disks
Migrate Azure VMs to Managed Disks in Azure: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/migrate-to-managed-disks

Exit mobile version