DEV Community

Cover image for How To Add A Data Disk To A Virtual Machine In Azure.
Maxwell Wokocha C.
Maxwell Wokocha C.

Posted on

How To Add A Data Disk To A Virtual Machine In Azure.

Typically when a virtual machine is created, it has no data disk for storage. As a Cloud engineer you are mandated to create a data disk for data storage for a virtual machine. Herewith are the step by step guide on how you can achieve that.

Skills:

. Access Your Virtual Machine in Azure.
. Attach a New Data Disk.
. Configure the Data Disk in the OS.

Access Your Virtual Machine in Azure.

. Log in to the Azure Portal "portal.azure.com"

. Navigate to Virtual Machines and select the VM where you want to add the disk.

. +Create Virtual machine.

. On the Basics tab, create new resource group for the virtual machine.

. Create a Name for the virtual machine.

. Select a Region for the virtual machine.

. Select Availability zone for the virtual machine.

. Select Security type for the virtual machine.

. Select Image for the virtual machine.

. Go to the Administrator Account and create a username and password for the virtual machine.

. Go to Inbound Port Rule, select RDP and http (80).

. Check and confirm the Licensing box.

. Go to the Monitoring tab and disable boot diagnostics.

. Review and create.

. Then create.

Attach a New Data Disk.

. In the Virtual Machine settings, click on "Disks".

. Click "Add Data Disk", then select "Create and Attach a New Disk".

. Choose a Disk Name, Storage Type, and Size (GB).

. Set the Disk Performance Tier (if applicable).

. Click "Apply" to attach the disk to your Virtual Machine.

Configure the Data Disk in the OS.

After attaching the disk, you need to initialize and format it within the Virtual Machine’s operating system.

. Connect to the VM using Remote Desktop (RDP).

. Open Disk Management.

. The new disk appears as Unallocated.

. Right-click and select "Initialize Disk".

. Right-click the unallocated space and select "New Simple Volume".

. Assign a drive letter, select NTFS as the file system, and format the disk.

. Click "Finish" and confirm the disk is now ready for use.

Top comments (0)