Setting up a Windows Virtual Machine with a Data Disk and Initializing it.


In this guide, we'll walk through the steps to create a Windows Virtual Machine (VM) in Microsoft Azure, add a new data disk, and initialize it for use. This process will cover the VM creation and disk management, ensuring your VM is ready for data storage.
Prerequisites
Before proceeding, ensure you have the following:
a. An active Microsoft Azure Subscription: You will require an active Azure subscription. If not, you can register for a free trial.
b. Access to the Azure portal through your web browser.
Creating a Windows Virtual Machine
a. Sign in to the Microsoft Azure Portal with your credentials
b. Click on Virtual machines under Azure services and click Create OR click on Create a Resource and then click on Create option under virtual machine
c. You will then be directed to the basics page
BASICS
Project Details
In the project details category we have subscription and resource group
Subscription: Your access to Azure services. It's like your membership to use the platform. You can choose from various subscription plans, including free trials.
Resource Group: A container for organizing your Azure resources (e.g., VMs, databases). Think of it as a folder within your Azure workspace, making it easier to manage and locate your resources.
a. Select your Azure Subscription
b. Create a new Resource group for your VM
Instance Details
c. Give your virtual machine a name.
d. Select a Region: Choose the geographical location where your VM will be hosted. Regions are independent locations with their data centers.
e. Choose Availability Options: Availability Zones: If available in the selected region, choose one or more Availability Zones. Availability Zones are separate data centers within a region, providing high availability by isolating your resources from potential failures. Availability Sets: (If Availability Zones are not available) Group your VMs into Availability Sets to distribute them across different physical hardware within a data center, minimizing the impact of single hardware failures.
f. Select your security type from the drop-down
g. Select the desired Windows Server image from the dropdown / Azure Marketplace. Choose the version and edition that best suits your needs.
An image refers to a pre-configured, virtualized template used to create a new virtual machine (VM). It contains the operating system (OS), system configurations, and optional software or settings needed to deploy a VM. When creating a VM in Azure, you choose an image that serves as the base for your machine's operating system and environment.
h. Choose the size of the VM based on the resources you need (CPU, RAM, etc.). The Azure portal will suggest sizes based on your selected image.
Administrator Account
i. Give your account a username and generate a strong password for the administrator account. Ensure the passwords are a match to confirm the password
Inbound Port Rules
j. For remote desktop access, ensure you select "Allow selected ports" and choose RDP (3389).
Click on "Next: Disks>" to direct you to the Disk page
DISKS
OS Disk (Operating System Disk)
The OS disk is the disk that contains the operating system for your Azure VM. This disk is essential for booting the VM and running the operating system, just like a traditional hard drive that houses the OS on physical servers. When you create a VM in Azure, an OS disk is automatically created and attached.
Data Disk
A data disk is an additional disk attached to a VM used for storing data, files, databases, applications, or other information that isn’t part of the operating system. You can add one or more data disks to a VM, depending on your storage requirements. Data disks can be Standard HDDs, Standard SSDs, or Premium SSDs, depending on your performance needs.
a. Choose the most suitable OS disk type for your VM.
b. Click on Create and attach a new disk.
c. In the Name field, you can give the new disk a name (e.g., AKVM_Disk or use the default name if provided.
d. For the Source type, select empty to create a new, empty disk.
e. Set the Size based on how much storage you need.
f. Once you’ve configured the disk, click OK. Azure will now create and attach the data disk to your VM.
g. You can see that your data disk has been created and it is different from the OS Disk
h. Leave the networking, management, monitoring, Tag, and advanced pages as default. Skip to Review + Create.
i. Review the summary of your virtual machine configuration and after validation, click Create to begin the deployment of your Windows VM. This process will take a few minutes to complete.
j. Once the deployment is complete, click "Go to resource".
Connect to Your Windows Virtual Machine
a. Go back to the Overview page of your VM and click Connect
b. Under Connect, scroll down to Native RDP and select “Download RDP file” to get the RDP file for remote access.
c. Open the RDP file and log in using your credentials under Administrator when creating the VM.
d. Enter your designated Password
e. Click Yes to the prompt
Welcome, you are connected to your Windows Virtual Machine
Initialize the Disk in Windows Server
Once logged into the VM, follow these steps to initialize the new data disk
a. Right-click on the Start button and select Disk Management.
b. In the Initialize Disk dialog, select GPT (GUID Partition Table) if you plan to use the disk for larger than 2 TB partitions, or MBR (Master Boot Record) if not.
c. The Disk Management console will appear, showing all attached disks, including the new data disk (it should appear as Disk 1, Disk 2, etc., with the status "Not Initialized").
c. Right-click on the unallocated space and select New Simple Volume.
d. Follow the wizard to create a new volume:
Assign a drive letter (e.g., A).
Select NTFS as the file system.
Optionally, you can provide a volume label (e.g.,
DataDisk
).Complete the wizard by clicking Finish.
e. After completing the above steps, the new disk should now appear in This PC as a new drive (e.g., A:). You can now start using the disk to store files and data
By following these steps, you can successfully create a Windows Virtual Machine in Azure and initialize a new data disk for your applications and data storage needs. This provides a flexible and scalable infrastructure for your workloads in the cloud.
Subscribe to my newsletter
Read articles from Jesudetan Akinyemi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
