Lesson 2 of 5 Azure Virtual Machines

Choosing and Changing VM Sizes

A VM's size decides its resources and cost. This lesson explains size families and the constraints on resizing.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the VM size families and the workloads they suit.
  • Explain when a VM must be deallocated before resizing.
  • Identify other constraints on resizing, such as quotas.

Size families and names

Azure groups VM sizes into families for different workloads. The following table lists the families most likely to appear in exam scenarios.

FamilyOptimized forExample workloads
BBurstable CPU (earns credits when idle)Development, small web servers, low-traffic apps
DGeneral purpose, balanced CPU and memoryMost enterprise applications, application servers
EMemory optimized (high memory per vCPU)Relational databases, in-memory caches
FCompute optimized (high CPU per GB)Batch processing, web front ends, gaming servers
LStorage optimized with local NVMe disksBig data, NoSQL databases, data warehousing
MVery large memorySAP HANA, very large databases
NGPUAI training and inference, visualization

Size names encode their properties: in Standard_D4as_v5, D is the family, 4 the number of vCPUs, a an AMD processor, s support for premium storage, and v5 the version. Each size also sets the maximum number of data disks and NICs, uncached and cached disk IOPS and throughput, and expected network bandwidth, so a disk's performance can be capped by the VM size.

Sort into groups

Which size family?

Exam skills 3.2.4

Choose the VM size family for each workload.

Log in to try this activity Interactive activities are free with an account.

Resizing a VM

A VM is resized on its Size page, with az vm resize --size or Update-AzVM. Resizing restarts the VM. The Size page lists sizes available on the hardware cluster that currently hosts the VM; if the required size is not available there, the VM must be deallocated first so that it can start on a different cluster, after which every size in the region is available. VMs in an availability set share clusters, so changing to a size not on the cluster requires deallocating all VMs in the set.

Other constraints: the subscription needs enough vCPU quota for the target family in the region; some sizes are not offered in every region or zone; moving between sizes with and without a temporary disk, or between generations, may require recreating the VM; and a size must support the VM's features, such as premium storage, encryption at host or Trusted launch.

The following diagram shows the sequence for resizing a running VM to a size that is missing from its Size page.

Resizing to a size missing from the Size page. Standard_E8s_v5 is not available on the hardware cluster hosting the running VM, although the region offers it and quota is sufficient. Deallocating the VM releases the cluster, so the new size appears; resize, then start. The memory-optimized E-series fits a VM that runs out of memory.
The scenario is illustrative.
True or false

Resizing

Exam skills 3.2.4

Check what a resize does and what can limit it.

Log in to try this activity Interactive activities are free with an account.
Worked example

A resize that is not listed

A database VM of size Standard_D4s_v5 runs out of memory. The administrator wants Standard_E8s_v5, but it does not appear on the Size page, although the region offers it and the subscription has enough quota. What should the administrator do?

The E-series size is not available on the current hardware cluster. Deallocate the VM (Stop in the portal), then resize it to Standard_E8s_v5 and start it. Requesting more quota is unnecessary because quota is sufficient, and recreating the VM is not required. The E-series is the right family because the problem is memory.

Check yourself

What does the s mean in a size name such as Standard_D4s_v5?

Show answer

The size supports premium storage (Premium SSD disks).

Exam Tips

Remember for the exam

  • Resizing restarts the VM; deallocate first if the size is not listed.
  • Choose the family by bottleneck: memory E, compute F, storage L, GPU N, burstable B.
  • VM size limits disk IOPS, throughput and the number of data disks.
  • Check vCPU quota for the target family before resizing.