Resize a virtual machine - Azure Virtual Machines (2024)

  • Article

Applies to: ✔️ Linux VMs ✔️ Windows VMs ✔️ Flexible scale sets

This article shows you how to change an existing virtual machine's VM size.

After you create a virtual machine (VM), you can scale the VM up or down by changing the VM size. In some cases, you must deallocate the VM first. Deallocation may be necessary if the new size isn't available on the same hardware cluster that is currently hosting the VM.

Resize a virtual machine - Azure Virtual Machines (1)

If your VM uses Premium Storage, make sure that you choose an s version of the size to get Premium Storage support. For example, choose Standard_E4s_v3 instead of Standard_E4_v3.

Change the VM size

  • Portal
  • PowerShell
  • CLI
  • Terraform
  1. Open the Azure portal.
  2. Type virtual machines in the search. Under Services, select Virtual machines.Resize a virtual machine - Azure Virtual Machines (2)
  3. In the Virtual machines page, select the virtual machine you want to resize.Resize a virtual machine - Azure Virtual Machines (3)
  4. In the left menu, select size. Pick a new compatible size from the list of available sizesResize a virtual machine - Azure Virtual Machines (4)
  5. After picking a size, select Resize.Resize a virtual machine - Azure Virtual Machines (5)

Note

If the virtual machine is currently running, changing its size will cause it to restart.

If your VM is still running and you don't see the size you want in the list, stopping the virtual machine may reveal more sizes.

Warning

Deallocating the VM also releases any dynamic IP addresses assigned to the VM. The OS and data disks are not affected.

If you are resizing a production VM, consider using Azure Capacity Reservations to reserve Compute capacity in the region.

Choose the right SKU

When resizing a VM, it's important to choose the right SKU based on the signals from the VM to determine whether you need more CPU, memory, or storage capacity:

  • If the VM is running a CPU-intensive workload, such as a database server or a web server with high traffic, you may need to choose a SKU with more CPU cores.
  • If the VM is running a memory-intensive workload, such as a machine learning model or a big data application, you may need to choose a SKU with more memory.
  • If the VM is running out of storage capacity, you may need to choose a SKU with more storage.

For more information on choosing the right SKU, you can use the following resources:

  • Sizes for VMs in Azure: This article lists all the VM sizes available in Azure.
  • Azure VM Selector: This tool helps you find the right VM SKU based on your workload type, OS and software, and deployment region.

Limitations

You can't resize a VM size that has a local temp disk to a VM size with no local temp disk and vice versa.

The only combinations allowed for resizing are:

  • VM (with local temp disk) -> VM (with local temp disk); and
  • VM (with no local temp disk) -> VM (with no local temp disk).

For a work-around, see How do I migrate from a VM size with local temp disk to a VM size with no local temp disk? . The work-around can be used to resize a VM with no local temp disk to VM with a local temp disk. You create a snapshot of the VM with no local temp disk > create a disk from the snapshot > create VM from the disk with appropriate VM size that supports VMs with a local temp disk.

Next steps

Resize a virtual machine - Azure Virtual Machines (2024)
Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 5958

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.