Increase Disk Space of your Azure Virtual Machine

Managing virtual machines in Microsoft Azure comes with a lot of flexibility, but there are situations where you may run out of disk space, either on the OS disk or on attached data disks. Fortunately, Azure allows you to resize your disks with minimal downtime. In this guide, we’ll go step by step, covering how to extend both OS disks and data disks for a Windows Server VM in Azure.

Why Extend a Disk in Azure?

Over time, the applications and data stored on your virtual machine may grow, resulting in insufficient disk space. Running out of space on your OS disk can affect Windows updates, system performance, and application functionality. Similarly, data disks that store databases, logs, or other files may also need expansion.

Extending disks in Azure is a common practice to:

  • Prevent service disruptions caused by full disks
  • Increase VM capacity without creating new virtual machines
  • Optimize storage costs by only paying for the extra space you need

Understanding Azure Disks

Before resizing, it’s important to know the types of disks in Azure:

  1. OS Disk:
    • Contains the operating system.
    • Typically a managed disk.
    • Cannot be reduced in size but can be increased.
  2. Data Disk:
    • Used to store application data, logs, or backups.
    • Can be attached or detached from the VM.
    • Also a managed disk.

Azure supports different disk types: Standard HDD, Standard SSD, and Premium SSD. The resizing process is the same regardless of disk type.

1. Standard HDD

Description:

  • Rotational hard disk drives (traditional spinning disks).
  • Lowest cost per GB in Azure.
  • Moderate latency (typically 5–10 ms).
  • Limited IOPS (input/output operations per second).

Use Cases:

  • Development and testing environments where performance is not critical.
  • Backup or archival storage that doesn’t require frequent access.
  • Low-traffic file servers or logs storage.

2. Standard SSD

Description:

  • Solid State Drives with no moving parts.
  • More reliable and faster than HDD.
  • Moderate cost, better performance than HDD.
  • Latency: ~2–5 ms.

Use Cases:

  • Web servers and small databases with moderate IOPS requirements.
  • Dev/test VMs that need faster boot times and application response.
  • General-purpose workloads where cost matters but performance is needed.

3. Premium SSD

Description:

  • High-performance SSD backed by Azure’s high-speed storage infrastructure.
  • Low latency (~1 ms).
  • High IOPS and throughput.
  • More expensive than Standard SSD and HDD.

Use Cases:

  • Mission-critical applications like SQL Server, Oracle DB, SAP.
  • High-performance production workloads requiring consistent I/O.
  • Large transactional databases, analytics workloads, or virtual desktops.

Step 1: Extend the Disk in Azure

Using the Azure Portal

  1. Log in to the Azure portal
  2. Navigate to Virtual Machines and select the VM you want to modify.
  3. In the left-hand menu, click Disks.
  4. Select the disk you want to expand (OS or data disk).
  5. Click Size + performance.
  6. Adjust the disk size by entering a new value in gigabytes (GB).
  7. Click Resize to apply changes.

Note: Azure allows you to increase disk size but not decrease it. Ensure the new size fits your performance and storage requirements.

Step 2: Extend the Partition in Windows Server

After updating the disk size in Azure, the next step is to extend the partition in Windows Server so that the OS or data disk can actually use the newly allocated space.

Using Disk Management GUI

  1. Connect to your VM using Remote Desktop Protocol (RDP).
  2. Open Disk Management:
    • Press Win + X and select Disk Management.
  3. Find the disk you just resized. You will see unallocated space at the end of the disk.
  4. Right-click on the existing partition you want to extend (OS or data) and select Extend Volume.
  5. Follow the wizard to add the unallocated space to the partition.

Once the process completes, the partition will have the new, larger size.

Step 3: Verify Disk Expansion

After resizing the disk and extending the partition, it’s important to verify that the VM recognizes the new size:

  • Open File Explorer or This PC to check the drive size.
  • Use Disk Management to ensure the partition reflects the expanded size.

Best Practices

  1. Backup Before Resizing:
    Always take a snapshot of the VM or the disk before resizing. This ensures you can recover if anything goes wrong.
  2. Downtime Considerations:
    Resizing OS disks does not usually require stopping the VM, but restarting can ensure the changes are recognized properly.
  3. Plan Disk Sizes:
    Avoid frequent resizing by estimating future growth and allocating enough space initially.
  4. Use Managed Disks:
    Managed disks simplify resizing and provide better reliability compared to unmanaged disks.
  5. Monitor Disk Usage:
    Regularly check disk utilization using Azure Monitor or Windows Performance Monitor to avoid running out of space unexpectedly.

Conclusion

Resizing OS and data disks in Azure is a straightforward process when done in two steps:

  1. Extend the partition in Windows Server (Disk Management or PowerShell)

Following these steps ensures minimal downtime, no data loss, and a smooth expansion of your virtual machine’s storage capacity. Whether you are a system administrator managing multiple VMs or a developer optimizing a single instance, knowing how to properly extend disks in Azure is essential for maintaining reliable and scalable infrastructure.

By implementing proper backup, monitoring, and planning strategies, you can handle disk expansion efficiently and avoid storage-related disruptions in your Azure environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

Index