DEV Community

Cover image for How To Add a Data Disk To A Virtual Machine In Azure: A Guide.
John Essien
John Essien

Posted on

How To Add a Data Disk To A Virtual Machine In Azure: A Guide.

Hi there! Want to know how to add a data disk to a VM? This article shows how to attach a data disk to a Windows virtual machine (VM) by using the Azure portal. However, lets refresh our minds on what a vm is.

What is a virtual machine?
A virtual machine (VM) is a software-based representation of a physical computer. It can run programs and operating systems, store data, connect to networks, and perform other computing tasks.

Don't know how to create a VM? Do not worry, there is an extensive article on that. Kindly click on How To Create A Virtual Machine and practice.

Without further ado!!! lets head to the clouds to attach a disk!!


  • Create a VM

Create a VM

  • On the Virtual machine pane, in the settings section, select Disks.

Settings section

  • On the Disks pane, select Create and attach a new disk.
    • Choose number of disk
    • Choose type of disk
    • Choose size of disk
    • Choose disk name

Disk pane

Initialize a new data disk

The new disk has been created. Hold on!!! We still can't use it yet. To be able to use it, we need to:

  • Connect to the VM by logging in to the VM
    Connect to the VM

  • Select the Windows Start menu inside the running VM and enter diskmgmt.msc in the search box. The Disk Management console opens.
    Disk Management

  • Disk Management recognizes that you have a new, uninitialized disk and the Initialize Disk window appears. Verify the new disk is selected and then select OK to initialize it.

Disk Selection

  • The new disk appears as unallocated.

New Disk Unallocated

  • Right-click anywhere on the disk and select New simple volume.

New Simple volume

  • The New Simple Volume Wizard window opens. Proceed through the wizard, keeping all of the defaults, and when you're done select Finish.

Simple Volume Wizard

  • When the formatting is complete, select OK. Notice now, how the disk changes from allocated to healthy after formatting.

Healthy

Drive E


And that my friends is how you add a data disk to a vm! I'm sure your cloud muscles are all stretched! lets relax...And I will see you in the next article.

Don't forget to like, comment, ask question(s) and share.

Top comments (0)