DEV Community

Cover image for Step-by-Step Guide to Creating a VM Data Disk, Initializing It, and Making It Usable in Microsoft Azure
Kosisochukwu Ugochukwu
Kosisochukwu Ugochukwu

Posted on

Step-by-Step Guide to Creating a VM Data Disk, Initializing It, and Making It Usable in Microsoft Azure

Introduction

Microsoft Azure enables users to increase the storage capacity of virtual machines (VMs) by attaching data disks. This guide shows the process for creating a data disk, attaching it to a virtual machine, initializing the disk, and preparing it for use.

Step 1: Create and Attach a Data Disk to a VM

  • Sign in to the Azure Portal: Navigate to Azure Portal and log in.

Azure Portal

  • Search and Select the Virtual Machine

Virtual Machine

  • In the left-hand menu, click on "Virtual Machines" and select the VM where you want to add a data disk.

select the VM

  • Add or create a new resource group

resource group

  • Choose a virtual machine name, region and availiability zone

region

  • Choose the image (OS) and size of the virtual machine

image

  • Leave everything as default and scroll down to administrator account: create a username and password

 administrator account

Inbound port roles

  • Public inbound ports: click on Allow selected ports
  • Select inbound ports: select HTTP (80)

Inbound port roles

  • Check on licensing, then click on Next : Disks >

licensing

  • On the disks section leave as default and go to the monitoring to disable the boot diagnostic.

boot diagnostic

  • Go to Tag ** give it a **name and value

value

  • Go to Review + create, click on create

create

  • Deployment in progress

Deployment in progress

Step 2: Create data disk

  • Click on the virtual machine created to go to its overview page

virtual machine

  • On the overview go to settings
  • Click settings, then select disks
  • On Data disks page, click on + create and attach new disk

attach new disk

  • On the LUN: That is to assign a new identifier to the newly created disk.
  • choose disk name, storage type, and size, then click on apply

Choose number

  • Data Disks Created

Data Disk

Step 3: Initialize and Format the Data Disk

  • Connect to virtual machine
  • Click on connect virtual machine

connect

  • Click on select and wait for the validation till it is configured

validation

  • Click on download RDP file

download RDP file

  • Connect to the VM: Use Remote Desktop (RDP) to connect to your Windows VM.

Use Remote Desktop

  • On the virtual machine search bar, search Disk Management Click on create and format hard disk partitions

Open Disk Management

create and format hard disk partitions

  • Click on OK to initialize the new disk

Click on

  • Scroll down to new disk create (disk 2). (notice that the disk is showing unallocated)

disk create

  • Right-click on the unallocated space of the new disk. Select New Simple Volume. new disk create

Follow the wizard to assign a drive letter and format the disk

  • On the welcome to the new simple volume wizard: Click Next

welcome to the new simple volume wizard

  • On the specify volume size use the default and click on next (ie:if you do not wish to modify the volume of the disk)

specify volume size

  • On the assign drive path click on next

assign drive path

  • On the format partition give it a name on the volume label and click on next

format partition

  • Now Click on Finish to complete the process

Finish to complete

  • Notice that the disk new disk is now showing Healthy and no longer unallocated.

Notice that the disk new disk

Conclusion

The following steps will help you to effectively add a data disk to your Azure VM, initialize it, and make it usable. This guarantees extra storage capacity for data and apps on your virtual machine, hence improving Azure scalability and performance.

Top comments (0)