How to update a generalized disk in Azure VM

devidinesh7890@gmail.com 0 Reputation points
2023-07-04T07:47:07.93+00:00

I am facing an issue where I am unable to upgrade the disk size of my generalized VM through the Azure portal. The portal does not show me the update option under the disk section. I have tried using az-cli, but I am encountering permission issues and conflicts where the user does not have the required rights to resize the disk. Can someone provide guidance on how to resize a generalized disk in Azure VM using az-cli?

Additional Information:

  • Azure VM is being used.
  • The issue is related to disk resizing.
  • The desired outcome is to resize the disk on a generalized VM.
  • Permission and conflict errors are being encountered when using az-cli.
  • Operating system is Ubuntu or application versions were mentioned in the input.
  • No documentation or steps taken to resolve the issue were mentioned in the input.
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,968 questions
Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
357 questions
Azure Disk Encryption
Azure Disk Encryption
An Azure service for virtual machines (VMs) that helps address organizational security and compliance requirements by encrypting the VM boot and data disks with keys and policies that are controlled in Azure Key Vault.
174 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
641 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
406 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 24,911 Reputation points
    2023-07-04T17:30:28.75+00:00

    Hello @devidinesh7890@gmail.com

    You can use the Azure CLI to resize the disk on a generalized VM. First, you need to deallocate the VM with the command

    az vm deallocate --resource-group <resource-group-name> --name <vm-name>.

    Then, you can update the disk size with the command

    az disk update --resource-group <resource-group-name> --name <disk-name> --size-gb <new-size>.

    After that, you can start the VM with the command az vm start --resource-group <resource-group-name> --name <vm-name>.

    After that, you can start the VM with the command az vm start --resource-group <resource-group-name> --name <vm-name>.

    Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/resize-vm?tabs=cli

    https://askubuntu.com/questions/1253516/properly-resize-an-azure-vm-disk

    https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=ubuntu

    If you are using Ubuntu, you can expand the root partition of the OS disk and filesystems automatically by cloud-init.

    To resize an Azure VM disk, you need to have the "Contributor" or "Virtual Machine Contributor" role assigned to your account. If you don't have these roles, you won't be able to resize the disk. Specifically, you need to have the "Microsoft.Compute/disks/write" permission on the disk resource. If you are encountering permission issues, you may need to check your role assignments and ensure that you have the necessary permissions.<sup>

    If this does answer your question, please accept it as the answer as a token of appreciation.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.