Convert Availability Set from unmanaged to managed - addycluri/Azure GitHub Wiki
Relative to managed Vs unmanaged disks, VM Availabilty sets (av-set) are also classified into managed Vs unmanaged based on the type of disks attached to the VM's in those av-sets. Reference link
- Managed Availability set = All VM's in that av-set MUST have managed disks only
- unmanaged Avalability set = All VM's in that av-set MUST have unmanaged disks only (blob VHD)
The instructions in this wiki can be followed to help with the av-set conversion process using a powershell script called Convert-AVSetUnManagedToManaged
. Upon successful completion, the disks attached the VM's will be converted to managed disks aand the SKU for the av-set will be set to Aligned/Managed Please note that this process requires VM downtime so plan for it accordingly
The workflow of the script is summarized below.
- Get the Availability set object and the list of VMs present
- Stop's each managed VM in the AV set
- converts the VM disks to managed, attaches them to an av-set & turns the VM on
Follow the steps below to access Convert-AVSetUnManagedToManaged
and execute the av-set conversion process.
-
Download and import the Powershell Module locally using the instructions provided - here
-
Check the script details using
Get-Help Convert-AVSetUnManagedToManaged -Full
before proceeding. -
Open powershell and Login to your azure account using
Connect-AzureRmAccount -TenantId "GUID" -SubscriptionId "GUID"
(where the VMs with managed disks currently live) -
Before you proceed, please ensure that all application owners & stakeholders are updated since the VM in question will have doowntime till the script execution is completed
-
To start the av-set conversion, in powershell execute
Convert-AVSetUnManagedToManaged -AvailabilitySetName "MY-AVSet" -ResourceGroupName "MY--verbose