Exploring Azure Virtual Machines: Adding Data Disks and Recovering Deleted Instances
Introduction:
Azure Virtual Machines (VMs) play a pivotal role in the realm of cloud computing, offering adaptable and scalable computing resources suitable for diverse workloads. This blog aims to deepen our comprehension of Azure VMs by concentrating on two essential activities:
a: Add a Data Disk to a Virtual Machine and Initialize it for use( explain the difference between an OS Disk and a Data Disk)
b: Recover a deleted virtual machine using its OS Disk.
1 - Adding a Data Disk to a Virtual Machine:
Let's start by acknowledging the fundamental distinction between an OS Disk and a Data Disk. The OS Disk is where the operating system and system files are stored, while the Data Disk is used for additional storage, applications, or user data.
Step 1: Navigate to the Azure Portal
Log in to the Azure Portal (https://portal.azure.com/).
Step 2: Locate and Select the Virtual Machine
Can you create a Virtual Machine? If "NO" , kindly see my blog on How to create a Windows Virtual Machine. Let's proceed.
Find and select the Virtual Machine to which you want to add a Data Disk.
Step 3: Navigate to Settings
Navigate to the "Settings" tab and select "Disks."
Step 4: Add a Data Disk
On the "Disks" page, Click on "+ create and attach a new disk", configure the disk settings and click on the "Apply" button. For this blog, I used the below settings.
Step 5: Saved Changes
The Disk was successfully created and the changes made to the VM configuration.
Step 5: Connect to the VM
Connect to the VM using Remote Desktop Protocol (RDP) or Secure Shell (SSH) based on the operating system. The scope of this blog is Windows Virtual Machine. The below pictures explains the process;
The next step is click to download the RDP file.
From the downloaded RDP file, open the file and connect to the virtual machine.
Finally we have successfully connected to the Windows Virtual Machine.
Step 5: Initialize the Data Disk
Open Disk Management by right-clicking on the Disk Management menu.
Scroll down and located the "unallocated" tag on the disk, right-click and click on "New Simple Volume".
I keep the default setting and click on "Next"
I also click on the "Next" button to proceed.
I renamed the volume label as "My Storage Disk" to uniquely identify my new disk.
Finally click on the "Finish" button
Notice that the newly created disk volume "My Storage Disk" has been added and the status has changed from "Unallocated" to "Healthy".
It has also reflected on the image below.
Congratulations! You have successfully initialized it for use.
2- Recovering a Deleted Virtual Machine using its OS Disk:
Let's intentionally delete the Virtual Machine below by clicking on it for the sake of this blog.
On the next page, click the "delete" action as highlighted below.
Uncheck the Associated resources type as shown below, check the "I have read ..." button and click on the delete button to delete only the Virtual Machine.
The Virtual Machine was successfully deleted.
Now navigate back to Home and click All resources.
On the All resources page, locate and click on the resources with "OSDISK" Name property and "Disk" Type property. Here is mine as highlighted below.
Now click on the + Create VM to create a new VM.
The next page will prompt to create a new virtual machine. Create the VM name and select Availability options.
NOTE: You can not edit the Region and Security type.
The next step is to select the size of the your virtual machine or See all sizes based on your preference.
Select any inbound port(s) based on your preference and click on "Next : Disks>" to proceed to the Disk page.
On the Disk page, scroll down to the OS disk type, this part is uneditable because it's an existing OS disk.
Now scroll down the Data disk, you can either create a new one or attach and existing one. I already create on earlier, so I will attach an existing disk for this blog content.
I selected my existing Data disk and click on "Next : Networking >" to to proceed.
Click on Next to proceed to the Management page while leaving the Networking page in it's Default state.
Also leave the Management page in it's default settings and proceed to the rest tab menus. For this Demo, I will leave them on their default settings.
Click on Review + Create button to proceed.
Click on "Create" once the passes the validation process.
Deployment is compete. The Virtual Machine is restored Successfully.
You will notice the new name for the Restored Virtual Machine when I navigate back to Home > All Resources on the image below.
Kindly subscribe to my newsletter for great content if this has helped you. Thank you.