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.
- Search and Select the Virtual Machine
- In the left-hand menu, click on "Virtual Machines" and select the VM where you want to add a data disk.
- Add or create a new resource group
- Choose a virtual machine name, region and availiability zone
- Choose the image (OS) and size of the virtual machine
- Leave everything as default and scroll down to administrator account: create a username and password
Inbound port roles
- Public inbound ports: click on Allow selected ports
- Select inbound ports: select HTTP (80)
- Check on licensing, then click on Next : Disks >
- On the disks section leave as default and go to the monitoring to disable the boot diagnostic.
- Go to Tag ** give it a **name and value
- Go to Review + create, click on create
- Deployment in progress
Step 2: Create data disk
- Click on the virtual machine created to go to its overview page
- On the overview go to settings
- Click settings, then select disks
- On Data disks page, click on + create and 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
- Data Disks Created
Step 3: Initialize and Format the Data Disk
- Connect to virtual machine
- Click on connect virtual machine
- Click on select and wait for the validation till it is configured
- Click on download RDP file
- Connect to the VM: Use Remote Desktop (RDP) to connect to your Windows VM.
- On the virtual machine search bar, search Disk Management Click on create and format hard disk partitions
- Click on OK to initialize the new disk
- Scroll down to new disk create (disk 2). (notice that the disk is showing unallocated)
- Right-click on the unallocated space of the new disk. Select New Simple Volume.
Follow the wizard to assign a drive letter and format the disk
- On the welcome to the new simple volume wizard: Click Next
- 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)
- On the assign drive path click on next
- On the format partition give it a name on the volume label and click on next
- Now Click on Finish to complete the process
- Notice that the disk new disk is now showing Healthy and no longer unallocated.
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)