DEV Community

Cover image for How to add a data disk to a Virtual Machine.
Blessing Azeta
Blessing Azeta

Posted on

1 1 1 1 1

How to add a data disk to a Virtual Machine.

Hello everyone, this is a step-by-step process on how to add a data disk to a Virtual machine.

What is a data disk?

In Azure, a data disk is a managed disk that is used to store application data, databases, or any other files separate from the OS disk. It acts like an extra hard drive attached to the VM.

Now let's delve right into it.

  • In the Search resources, services and docs field, type virtual machines.
    Vmachines

  • Click the Create button to start the virtual machine creation process
    createvirtual

  • From the options choose Create a virtual machine hosted by Azure.
    Azurevm

  • Enter Project details, this would be our subscription, resource group, Virtual Machine Name and Region.
    projectdetails

  • Select your preferred Image; this is the operating system you would like to use.
    OS.

  • Set up the administrator account for Log in once the virtual machine has been deployed.
    admin

  • Select Inbound Port Rule as RDP if you are creating a Windows VM
    portrule

  • Check the licensing.
    license

  • Leave OS disk settings as default
    OSdisk

  • Click on the Monitoring tab, and click on disable under boot diagnostics.
    monitoring

  • Click on the Tags tab, and assign name/value pairs to categorize resources. (Optional depending on use-case.)
    namevaluepairs

  • Click on Create, After Validation has passed.
    validation

  • Deployment in Progress
    Deployment

  • Click on Go to Resource, once deployment is complete.
    Gotoresource

  • Click on PublicIPAddress to extend idle time
    Publicip

  • Extend till the end 30 minutes
    idletime

Adding the DataDisk to the Virtual Machine

  • Click on Settings on the Virtual Machine interface
  • Click on Disk; The OS disk has been automatically created by the cloud provider.
  • Click on + create and attach a new disk under the data disks section.
    data disk

  • Input the details requested; the data disk name, the storage type and size

  • Click Apply
    datadisk
    creating
    created

Connect to the Virtual Machine to access and use the disk.

Once the data disk is attached, you will need to initialize and format it within the VM's operating system.

  • Go to the Virtual Machine Overview page.
  • Click on Connect
    connect

  • Click on Select on the Native RDP box
    select

  • Click on Download RDP file once configured.
    download

  • Click on the downloaded RDP file once completed.
    downloadrdp

  • Click on Connect in the pop up message
    connect

  • Input your previously saved admin password
    password

  • Follow the instructions to Log in and set up your virtual machine
    Log in
    setup

  • On the search bar, type disk management

  • Click on create and format hard disk partitions.
    diskmanagement
    diskmanagement

  • Click Ok to initialize the disk

  • The disk is still unallocated; meaning not ready for use.
    unallocated

Format the data disk for it to be ready for use.

  • Right click on the disk, a provision has been made to make the formatting easier. It is called New Simple Volume
    newsimplevolume

  • Click on Next, Leave everything as Default
    next
    next

  • You can Rename the data disk under the volume label.
    Datadisk

  • Click on Next to perform the format operation.
    format

  • Click on Finish
    finish

Now the Data disk is Healthy and Ready for use.
healthydisk

The Data Disk is now listed amongst the available storage.
datadisk

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay