how increase the size of a running vm with dynamic data disk

Pankaj Kumar Parida 0 Reputation points
2024-05-17T10:32:34.3933333+00:00

how increase the size of a running vm with dynamic data disk

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
583 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Niki Melanidou 115 Reputation points
    2024-05-17T10:37:45.4333333+00:00

    To increase the size of a running virtual machine (VM) with a dynamic data disk, you typically need to follow these steps:

    Resize the Disk in the Cloud Provider's Console:

    Log in to your cloud provider's console (e.g., Azure Portal, AWS Management Console).

    Navigate to the section where you manage your virtual machines and disks.

    Find the dynamic data disk associated with your VM.

    Increase the size of the disk to your desired capacity.

    Resize the Partition in the Operating System:

    Once the disk is resized in the cloud provider's console, you need to resize the partition in the operating system.

    For Windows:

    Open Disk Management.

    Locate the disk you resized (it might appear as unallocated space).

    Right-click on the partition and select "Extend Volume."

    Follow the wizard to extend the volume to use the additional space.

    For Linux:

    Use the fdisk or parted command to modify the partition table and resize the partition.

    Then, use the resize2fs command (for ext2, ext3, or ext4 filesystems) or xfs_growfs command (for XFS filesystems) to resize the filesystem to use the additional space.

    Restart the VM (if Necessary):

    In some cases, you might need to restart the VM for the changes to take effect, especially if you're unable to resize the partition while the system is running.

    Verify the Changes:

    After resizing the disk and partition, verify that the VM recognizes the increased storage capacity and that your applications are functioning properly.

    0 comments No comments

  2. Anand Prakash Yadav 6,940 Reputation points Microsoft Vendor
    2024-05-20T11:09:26.6833333+00:00

    Hello Pankaj Kumar Parida,

    Thank you for posting your query here!

    To increase the size of Azure Virtual Machines with dynamic data disks, follow these steps:

    Azure Virtual Machines (Windows):

    Resize the Data Disk:

    • Navigate to your virtual machine in the Azure portal.
    • Go to the “Disks” section.
      • Select the data disk you want to resize.
      • Click on “Size” and choose a larger size for the disk.

    Extend the File System:

    • Connect to your VM using Remote Desktop (RDP).
    • Open Disk Management (right-click on the Start button and select “Disk Management”).
    • Locate the resized disk (likely shown as unallocated space).
    • Right-click on the volume (partition) associated with the data disk and choose “Extend Volume.”
    • Follow the wizard to extend the volume using the available unallocated space.

    Verify the Changes:

    Confirm that the data disk size has increased within the VM.

    Linux VMs:

    Resize the Data Disk:

    • Use the Azure CLI or Azure Portal to resize the data disk.
    • SSH into your VM.
    • Run lsblk to identify the data disk (e.g., /dev/sdc).
    • Use sudo parted /dev/sdc resizepart 1 100% to resize the partition.
    • Run sudo resize2fs /dev/sdc1 to extend the file system.

    Verify the Changes:

    • Confirm that the data disk size has increased within the VM.

    Do let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments