Every Windows virtual machine in Azure automatically has 2 drives connected. But what if you need more space? File storage in Azure can be quite daunting. Blobs, files, queues,… what do I really need? And what about managing those storage accounts with their nice, ahem…, naming convention?

Managed disks to the rescue

So, what makes a managed disk better?

First, an Azure managed disk simplifies the creation and management of disks in Azure. It automatically creates a storage account and manages the sizing.

Here is a list of some more benefits:

Benefits

  • Easier
  • No more need for creating storage accounts manually
  • 99.999% availability (that’s a lot of 9’s)
  • Automatically encrypted at rest
  • More granular access control
  • Better reliability for availability sets

Prerequisites

VM’s need to be configured to use managed disks only. No mixing and matching with unmanaged and managed disks.

New virtual machine

Just select “Yes” when given the choice to enable “Use managed disks”. This is enabled by default.

Storage - Use managed disks

Existing virtual machines

You can convert existing VM’s, which are currently using unmanaged disk. Check out this Microsoft article.

This action is quite impactful and cannot be reversed. So best to take precaution when performing this conversion.

Create and attach a new managed disk

Create a managed disk

  1. Search for “Managed disks” in the Azure Marketplace.
  2. Choose a nice name (Ooooooh… This-is-a-great-naming-convention-01-DISK).
  3. Location is next up.
  4. Select your favorite type of storage (SSD or HDD).
  5. If necessary select your source data or create an empty disk
  6. Size your disk (1GiB – 4TiB)
Create managed disk wizard

Check out that clear name.

Add an existing disk to your virtual machine

This one is easy.

  1. Select your VM.
  2. Select “Disks” under “Settings”.
  3. Push the blue button “Add data disk”.
  4. Your disk should be waiting for you.

Attach an existing data disk

You can also choose “Create disk” in this menu. This will summon the “Create disk” wizard again. Mind that you might have some more options available when using the wizard in the Marketplace.

Attach the disk to your machine

Things do not become complicated now. Nice.

The only thing to keep in mind:

It is advised to enable TRIM on HDD drives. TRIM discards unused blocks on the disk so you are only billed for storage that you are actually using.

Now, all we need to do is connect to the machine using RDP. We open our trusty disk management tool (diskmgmt.msc) using the Start menu or Run.

Disk management run box

  1. Disk Management recognizes that you have a new, un-initialized disk and theInitialize Disk” window pops up.
  2. Make sure the new disk is selected and clickOK” to initialize it.
  3. The new disk appears as unallocated. Right-click anywhere on the disk and select “New simple volume”. The “New Simple Volume” Wizard opens.
  4. Go through the wizard, keeping all of the defaults, when you are done select “Finish”.

Last thing remaining now is formatting and assigning a beautiful drive letter and label. Be creative 🙂


2 Comments

Marcin · 06/04/2018 at 16:39

It looks like it’s simpler to do this from azure-cli ???? but I’m not good in graphical interfaces ????

    yvez · 06/04/2018 at 18:17

    True. Especially the Azure CLI console is great. No need to login again ????

Leave a Reply

Your email address will not be published. Required fields are marked *