Last week Microsoft announced the general availability of Managed Disk (https://azure.microsoft.com/en-us/blog/announcing-general-availability-of-managed-disks-and-larger-scale-sets/). Until now you always needed to manage you own storage for storing the VM disks. With this option you now have the option to create VM’s without caring about the underlying storage. Using managed disks is made very easy by just selecting Managed Disk while creating a new VM in the portal.
When you want to create a VM using PowerShell you just need to add configure type of storage while creating the OS Disk with this command “Set-AzureRmVMOSDisk”. See this page https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-ps-create for the full manual.
Upgrading your existing VM’s
Well this is great off course that you can create a new VM with Managed disks, but can you upgrade existing ones. Microsoft created a nice manual for upgrading your existing VM’s to use the managed disk feature, but there are a few things you need to keep in mind before doing this.
- Your VM’s must be running on V2, so no classic VM’s
- If the storage account is or has been encrypted with Azure Storage Service Encryption, you need to copy these disks to a new storage account before converting them
- You need at least AzureRM.Compute version 2.6.0
- After the conversion do not remove the .status file from your current storage account
- The VM must be stopped before the migration, so the services on the machine will be unavailable for the duration of the convertion
- Because the VM will be deallocated, the IP address can be different when the VM is booted again.
Microsoft created a good manual on how to do this: https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-convert-unmanaged-to-managed-disks
A very nice feature with the managed disk is that you can now create snapshots of your VM, see this manual for using that: https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-snapshot-copy-managed-disk