ATTACHING A DATA DISK TO AN ALREADY EXISTING WIN 11 PRO VIRTUAL MACHINE IN AZURE
Tags: azure, vm, cloud, win11
Published: 2024-04-15 15:24:00

In today’s post we will be learning to how to attach a data disk to our Win 11 Pro Virtual machine. We will be working with an already created Win 11 Pro VM, if you do not know how to go about it, just click on the link below to create one and come back and follow this blog.

{% embed https://dev.to/himora22/a-simple-guide-to-creating-a-win-11-pro-virtual-machine-on-microsoft-azure-2110 %}

What are Disks in Azure?

Before attaching a data disk, let's have a brief discussion about disks in Azure.

Disks in Azure are referred to as** Azure Disk Storage**, that provide block-level storage volumes that are managed by Azure and used with its Virtual machines. They are virtualized versions of physical disks you would have in your on-premises servers.


Azure has several types of disks with different performance requirement and prices points.

•	**Ultra Disks:** Designed for IO-intensive workloads, offering high throughput and IOPS with the ability to dynamically change performance parameters without restarting Virtual Machines.

•	**Premium SSDs:** Suitable for production and performance-sensitive workloads that require consistent low latency and high IOPS.

•	**Standard SSDs:** Ideal for web servers, lightly used enterprise applications, and development/test environments.

•	**Standard HDDs:** Best for backup, non-critical, and infrequent access scenarios due to their lower cost and performance compared to SSDs.


Apart from the different types of disks, Azure disks have different roles. They are three in number, and they are as follows:

1.	**OS Disk:** the Operating System disk, this is the Virtual Hard drive that you boot or run your virtual machine from. It holds the operating system and its system files; it is usually labelled as the C: drive by default. The OS disk has a maximum capacity of 4 TB.

2.	**Data Disks:** These are Virtual Hard drives you can attach to a Virtual machine to store application data or other data you need to keep. You can attach several data disks to a Virtual machine depending on the size of the Virtual machine. They have a maximum capacity of 32 TB per disk.

3.	**Temporary Disk:** This disk provides temporary storage for applications and processes and is intended to store data such as swap files, application cache, system cache, etc. The data on this disk can be lost during a maintenance event or when you redeploy a Virtual machine. It is usually labelled as the D: drive by default.


You can get more information on these from links below.
{% embed https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview %}

{% embed https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types  %}

https://azure.microsoft.com/en-us/products/storage/disks/ 

Now that we understand Azure disks let's begin attaching a data disk to the already created Win 11 Pro Virtual Machine.

**Step 1:** Login to your Azure portal, Search for Virtual Machine in the search bar and Click on Virtual Machines.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bkuexwkxa95uxnrhaoq0.png)

**Step 2:** Click on your already created Win11 Pro Virtual machine.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ou8rqedb5lo9wtw5e6b.png)

**Step 3:** Select and click on **Disks**, under settings towards the left end of your screen.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pn1km4bzl99friirxdk6.png)

**Step 4:** Once in the disk menu, look for and select **Create and attach new disk**.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dlvrbng4nicl7w0bty4j.png)

a.	**Disk name:** Give the disk a name.

b.	**Storage type:** Select from the options in the dropdown menu.

c.	**Size (GiB):** Type the disk size you want. 

d.	Click **Apply** at the bottom left of the portal when done.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcbolblm6hkonrnhokcs.png)


Wait for a few minutes for your **Data disk** to be created. Once this done go to the next step

**Step 5:** Go to **Overview** page and **Connect** to your Windows Virtual Machine


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av5pl7pcewragdpzofjc.png)

**Step 6:** Once your Windows 11 Virtual Machine is up and running, 

a.	Go to your file explorer. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/810z3q8pwbqqd4yry2c4.png)


b.	Go to **This PC**, you will notice your just created Data disk is not listed amongst the hard drives. You will have to initialize the disk before it is useable.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1533hvqv534fhrl3k1du.png)


**Step 7:** Initializing the Data disk.

a.	Right click the Windows button 

b.	Select **Disk Management** from the list that pops up.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avmd9tou34nbzx8b8xa9.png)

c.	**Disk Management** opens with a prompt **‘You must initialize a disk before Logical Disk Manager can access it’** click **‘OK’**.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fu4mlfmmb96idxphc1l.png)

d.	Scroll down at the bottom half of the **Disk Management** windows till you get to **Disk 2**.

e.	Right click on **Disk 2** where it shows **Unallocated** and select **New Simple Volume**.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0kbq0qa7o7s6k3et2id.png)

f.	A **Welcome to the New Simple Volume Wizard** comes up. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/edl0b0xid2li1bail8ll.png)


g.	For this exercise keep clicking **Next** till you finally get to **Finish**. Now the disk is initialized and is now visible on **This PC** in file explorer.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1t5ggjp0efh5my3n94h7.png)

If all these steps were followed correctly you have successfully Create, Attached and Initialized a Data disk in your Win 11 Pro virtual machine. Congratulations and well-done.