DEV Community

Cover image for How to create a datadisk in a virtual machine and initialize the disk and make it usable
Ugonna
Ugonna

Posted on

How to create a datadisk in a virtual machine and initialize the disk and make it usable

A virtual machine (VM) is defined as a computer system emulation, where VM software replaces physical computing infrastructure/hardware with software to provide an environment for deploying applications and performing other app-related tasks. Data disks are used to store data. it can be ssd or not depending on how you set them up.
This article explains the steps in creation of a virtual machines, adding datadisk , initialize the disk and making it usuable.
The first thing to do is to create virtual machine.
login into portal.azure.com and search for virtual machine then select it.
Image description
In the virtual machine, under the +create select Azure Virtual Machine
Image description
In project details create resource group ugorg
Image description
In instance details, name virtual machine (ugovm)
Select region as west central us
Leave the rest as default and go to image then select windows server 2019 Datacenter -x64 Gen2
Image description
Leave the rest as default and go to administrator account
In administrator account, in the authentication type select password
Then create username (ugoadmin) and password
In inbound ports rules,for public inbound ports leave it as default.
Image description
In inbound ports rules, for select inbound ports select HTTP(80) and SSH (22)
Image description
On the basic tab, go to monitoring, in the Diagnostic and in Boot diagnosticsselect disable
Image description
In the basic tab, go to Tags, under name select department and value select IT
Image description
Click review and create
when validation has passed click create
Image description
Go the resource
Image description
In the resources select the idle time out to be 30 minutes and save
Image description
Go to the ugovm and click connect
Image description
In native RDP click select
Image description
In native RDP, under download and open the RDP file click Download RDP File
Image description
After downloading the RDP file click connect
Image description
Go to ugovm, in setting select disk
Image description
scrow down data disk and click +create and attach new disk
Under the data disk create data disk name to be ugodatadisk; in storage type select standard SSD; select size (GiB) to be 10 and leave the rest as it is and click apply
Image description
The disk needs to be formatted so it can be used. Go to overview page, in connection on the dropdown select connect
Image description
Go to Native RDP and click select
Image description
In Native RDP, wait for it to be configured
Image description
Below download and open RDP file select, select download RDP
Image description
Go to downloads and click on the downloaded file
Image description
In remote network connection, click connect
Image description
In ugoadmin, type in the password
In the virtual machine, type disk management and select create and format hard disk partitions
Image description
There will be a pop up in disk 2 select ok
In the next page, in disk 2 out the 10GB allocated to it its 9.98GB that reflected because the rest was used in the background
Image description
Still in the disk 2, right click and select new simple volume
Image description
Click on next
In format partition, under volume label name it data disk
Image description
Now the disk 2 shows the datadisk is healthy
Image description

Top comments (0)