How To Deploy A Virtual Machine, Add A Data Disk And Initialized It For Use.

How To Deploy A Virtual Machine, Add A Data Disk And Initialized It For Use.

In this tutorial, we will learn how to deploy a windows virtual machine (VM). Furthermore, we will also add a data disk to the virtual machine, remotely access the windows virtual machine and initialize our data disk for use.

Before we proceed, it is important that we note the following:

  1. Azure VMs can be created with various configurations and sizes to meet different workload requirements. Each VM has an operating system disk, which contains the OS, and can also have additional data disks for storing application data.

  2. There is a difference between an (operating system) OS disk and a data disk. Azure Learn Documentation Explains that every virtual machine has one attached OS disk. This disk has a pre-installed operating system, which was selected when the VM was created.

    While a data disk is a managed disk that's attached to a virtual machine to store application data or other data that you need to keep. Data disks are registered as SCSI drives and are labeled with a letter that you choose. The size of the virtual machine determines how many data disks you can attach to it and the type of storage that you can use to host the disks.

    Generally, you should use the data disk to store your applications and data, instead of storing them on OS disks. Using data disks to store applications and data offers the following benefits over using OS disks:

    • Improved backup and disaster recovery

    • More flexibility and scalability

    • Performance isolation

    • Easier maintenance

    • Improved security and access control

Let’s Get Started........

First step is to create our windows 10 virtual machine

Please follow the steps below to create your windows 10 virtual machine

SIGN IN TO AZURE PORTAL

As a prerequisite, if you don't have an Azure subscription, click here to create your azure Free Account before we get started. Now that you have created your Azure subscription, go to the Azure Portal and sign in with your Azure account credentials to get started.

CREATE YOUR VIRTUAL MACHINE

a. In the left-hand menu, click on “Virtual machines”

b. Click on the "Create" button below the Virtual Machines page.

c. Select "Azure virtual machine".

d. You will be directed to the "Basics" page.

CONFIGURE BASIC SETTINGS

  1. Project Details

    a. Subscription: Select your Azure subscription.

    An Azure subscription is a way to manage the products and services you acquire from Microsoft Azure. It serves several purposes, including being a legal agreement associated with an Azure offer, a payment agreement where you provide billing information, a boundary of scale for resource limits, and an administrative boundary for managing security and policies. Each subscription can contain a set of Azure resources that will be invoiced together. You can create multiple subscriptions for better management and billing purposes.

    b. Resource Group: Choose an existing resource group or create a new one.

    An Azure resource group is a logical container that holds related resources for an Azure solution. It allows you to manage multiple resources as a single entity, coordinating their deployment, updates, and deletions based on their lifecycle. Resources within a resource group can include virtual machines, storage accounts, and networking devices. Each resource must belong to one resource group, but resources can be moved between groups if needed. The best practice is to group resources that share the same lifecycle together.

  2. Instance Details

    a. Virtual Machine Name: Enter a name for your VM (e.g., ProjecteVm).

    b. Region: Select the region where you want to deploy the VM (e.g., Africa - South Africa North).

    c. Availability Options: Choose an availability option (e.g. Physically separate your resources within an Azure region).

    d. Zone Option: Choose self-selected zone. This allows you to self-select the number of zones you would like to deploy your VM.

    e. Availability Zone: Choose zone 1. Selecting multiple zones (1&2 or 1,2&3) will create one VM per zone.

    f. Security Type: Select your security type from the drop-down

    g. Image: Choose the operating system for your VM (e.g.g Windows 10 Pro, version 22H2 - x64 Gen2(free services eligible).

    h. Choose VM Size: Click on "See all sizes” or the “dropdown” to choose a VM size based on your requirements (e.g. Standard_B1s - 1 vcpu, 1 GiB memory ($9.93/month) (free services eligible).

  1. Administrator Account and Inbound port rules

    a. Give your account a username and password. Also, confirm the password to ensure it aligns by repeating same password.

    b. On the inbound port rules section, select "Allow selected ports" and then select HTTP and RDP (3389). This port will give you remote access to your physical work desktop computers.

    c. On the Licensing, click on it to confirm you have an eligible Windows 10/11 license.

    d. Click on "Next: Disks>" to direct you to the Disk page

    CONFIGURE DISKS SETTINGS

    1. OS Disk

      a. On the Disk page, click on the OS disk size dropdown and select Image default (127 GiB) or any disk size of your choice

      b. Also click on the OS disk type dropdown and select Premium SSD or any disk type of your choice as shown below. Leave the other columns as default.

      c. Don’t add a data disk for this exercise. For this exercise, we are creating a VM with an OS Disks only.

      b) Click on "Next: Networking>" to direct you to the Network page.

CONFIGURE NETWORK SETTINGS

  1. Network Interface

a. On the Network page, Click on “Create New” on the Public IP column and select “OK” and leave the other columns as default.

b. Click on "Review + Create" to direct you to the review summary page.

c. After a successful validation “Validation Passed”, review the summary of your virtual machine configuration and click on “Create” button to begin the deployment process.

d. Once the deployment is complete, click on "Go to resource".

CONNECT TO YOUR WINDOWS VIRTUAL MACHINE

Create a remote desktop connection to the virtual machine. These directions tell you how to connect to your Windows 10 operating system.

a) On the overview page of your virtual machine click "Connect".

b) Connect with RDP, leave the default settings and click the download RDP file to your file.

c. Open the downloaded RDP file and click "connect".

d. Input your username and password and click “OK”.

e. Click yes to the prompt.

Welcome!! You are now connected to your Windows 10 Pro.

ADD A DATA DISK TO YOUR VIRTUAL MACHINE AND INITIALIZE IT FOR USE

a. Now that you've created your virtual machine click on it.

b. On the left side-bar click on "Disks".

c. Once you click on it, scroll down and click on create and attach a new disk.

f. Give your new disk a name (e.g. ProjecteDisk ) and leave the other information as default.

g. Click on “Apply” as shown below.

h. You can now see that the operating system (OS) disk and data disk are two different disks as shown below.

i. Connect to your virtual machine and download the RDP file once you've downloaded follow the prompt, input your username and password.

Now that you have been able to gain remote access to your windows Desktop, right click on the Windows icon and click on Disk Management.

Right click on the disk 3 below. Note: your disk name might be different

From the drop down click on "new simple volume".

To continue click next on the new simple volume wizard.

Click "Next" on the specify volume size.

Also click "Next" on the Assign Drive Letter or Path.

Also click "Next" on the Format Partition.

Now you can close the wizard by clicking "finish"

In the new volume highlighted Red, you can see that your new volume has been initialized.
On the new data disk highlighted Green, notice it has been allocated.

Now go to your File Explorer to confirm if the data Disk has been assigned to your Virtual Machine.

As shown below, your new data disk has been allocated to your Virtual Machine, and it is available and ready for use.