Manage VM sizes and disks

Automate deployment of resources using ARM templates or Bicep

📘Microsoft Certified: Azure Administrator Associate (AZ-104)


Managing Virtual Machine (VM) sizes and disks is a key skill for an Azure Administrator. In this part of the exam, you must understand how VM sizes work, how to resize VMs, disk types, disk performance, and how to manage and optimize Azure disks.

This section ensures you can select the right VM size for performance, scale your VM when workload changes, and configure storage that meets requirements for capacity, speed, backup, and security.


1. Understanding VM Sizes in Azure

Azure VMs come in predefined sizes, and each size determines:

  • Number of vCPUs
  • Amount of RAM
  • Storage throughput limits
  • Network performance
  • Supported features (e.g., premium SSD support, GPU support)

Different business applications require different VM capabilities, so choosing the right VM size is important.


1.1 VM Size Categories

Azure groups VM sizes into families, each designed for a specific workload.

A. General Purpose

  • Balanced CPU, RAM, and storage.
  • Best for:
    • Web servers
    • Small databases
    • Application servers

Examples: B-series, Dsv5, Dv5


B. Compute Optimized

  • High CPU-to-memory ratio.
  • Best for:
    • Batch processing
    • Medium traffic web servers
    • Development and testing

Example: Fsv2-series


C. Memory Optimized

  • More RAM per CPU.
  • Best for:
    • Large databases
    • In-memory caching
    • Big data applications

Example: Esv5-series


D. Storage Optimized

  • High disk throughput and IOPS.
  • Best for:
    • Big data analytics
    • SQL/NoSQL databases
    • Log processing

Example: Lsv3-series


E. GPU VMs

  • Designed for graphics-heavy or AI workloads.
  • Best for:
    • Machine learning
    • 3D rendering
    • Video processing

Example: NC, ND, NV


F. High Performance Computing (HPC)

  • Very fast CPU performance, low latency.
  • Used for:
    • Scientific simulations
    • Engineering workloads

Example: H-series


1.2 How to Check Available VM Sizes

You can check which VM sizes are available in a region or on a specific host:

Azure Portal

  • Go to VM → Size
  • The portal displays only available options in your region.

Azure CLI

az vm list-sizes --location eastus

Important Exam Tip

Some VM sizes support only Premium SSDs, Ephemeral OS disks, Accelerated Networking, or Generation 2 VMs.


1.3 Resizing a VM

A VM can be resized if:

  • The new size is available in that region
  • The current hardware cluster supports the new size

Resizing may require a reboot

  • Same hardware cluster → no downtime
  • New cluster required → VM must stop and deallocate

Steps to Resize (Portal)

  1. Go to VM → Size
  2. Select a new size
  3. Click Resize

Azure CLI

az vm resize \
  --resource-group MyRG \
  --name MyVM \
  --size Standard_D4s_v5

Exam Tip

  • If resizing fails, you must stop (deallocate) the VM first.
  • Deallocation releases the host, allowing Azure to move the VM to another cluster with your desired size.

2. Understanding Azure VM Disks

Azure VMs use different types of managed disks to store OS, data, and temporary files.


2.1 Types of Disks

A. OS Disk

  • Contains the operating system (Windows or Linux)
  • Supports encryption, snapshots, backups
  • Typically 64 GB – 127 GB, but can be larger

B. Data Disks

  • Additional disks for storing applications, databases, logs, etc.
  • Can attach multiple data disks depending on the VM size

C. Temporary Disk

  • Local disk on the host machine
  • Used for pagefile, swap, and temporary data
  • Data is lost if the VM moves to a new host
  • Not backed up

3. Azure Managed Disk Types

Azure offers several disk types optimized for capacity, performance, and cost.

Understanding these is crucial for the exam.


3.1 Standard HDD

  • Lowest cost
  • Lowest performance
  • Suitable for:
    • Light workloads
    • Test environments

3.2 Standard SSD

  • Better performance than HDD
  • Cost-effective
  • Ideal for:
    • Web servers
    • Low-traffic applications

3.3 Premium SSD

  • High performance, low latency
  • Required for many production workloads
  • Good for:
    • SQL database
    • High IOPS applications
    • Enterprise workloads

Premium SSD v2 (Latest generation)

  • Even higher throughput and IOPS
  • Configurable performance levels

3.4 Ultra Disk

  • Highest performance disk type
  • Extremely high IOPS and throughput
  • Best for:
    • High-performance databases
    • Massive data writes
    • Transaction-heavy workloads

4. Disk Performance Concepts

Disk performance is measured by:

IOPS (Input/Output Operations Per Second)

  • Number of read/write operations per second

Throughput

  • Amount of data transferred per second (MB/s)

Latency

  • Time taken to complete a storage request

Azure limits disk performance based on:

  • Disk type
  • Disk size
  • VM size (VM also has IOPS caps)

5. Attaching and Detaching Data Disks

Attach a disk in the Portal

  1. Go to VM → Disks
  2. Click Add data disk
  3. Choose Create new or Attach existing
  4. Save

CLI

az vm disk attach \
  --vm-name MyVM \
  --resource-group MyRG \
  --name MyDataDisk

Detach a disk

  • Must unmount in OS first (Linux/Windows)
  • Then remove via portal or CLI

6. Disk Encryption in VM Management

Azure supports:

Azure Disk Encryption (ADE) (OS-level)

  • Uses BitLocker (Windows) or DM-Crypt (Linux)

Server-Side Encryption (SSE)

  • Default
  • Encrypts disk automatically

Customer-Managed Keys (CMK) support

  • Encrypt disks with your own keys from Azure Key Vault

7. Resizing (“Upscaling”) Disks

Disks can be increased in size but cannot be reduced.

To resize:

  1. Stop VM (sometimes required)
  2. Go to Managed Disk → Size + performance
  3. Select new size

Use Case in IT

  • A database grows and requires additional storage space
  • Log files exceed capacity on a data disk

8. Disk Snapshots and Backups

Snapshots

  • Point-in-time copy of a disk
  • Useful before upgrading applications or performing changes

Azure Backup

  • Full VM backup
  • Recommended for production workloads

9. Ephemeral OS Disks

An Ephemeral OS disk is stored locally on the VM host instead of Azure Storage.

Features

  • Very fast
  • Best for stateless workloads
  • Data lost if VM moves hosts
  • Not supported for all sizes

Exam Tip: Use ephemeral OS disks only when the application can tolerate OS rebuilds.


10. Common IT Use Cases (Safe for Exam)

  • Scaling VM size when a line-of-business application requires more CPU or RAM
  • Using premium SSD for a production database server to ensure fast response times
  • Using Standard SSD for a development VM because it needs better performance than HDD but at low cost
  • Using temporary disk for OS paging to improve performance
  • Creating snapshots before applying major software updates to avoid downtime if something breaks

11. Key AZ-104 Exam Tips

  • Understand each disk type and its purpose
  • Know how to resize VMs and what causes downtime
  • Temporary disk is not persistent
  • Ultra Disk requires explicit enabling and only certain VM sizes support it
  • Disk resizing can only go up, never down
  • VM performance depends on both disk type and VM size IOPS limit
  • Premium SSDs require Premium Storage-supported VM sizes

Final Summary

To manage VM sizes and disks effectively in Azure:

  • Select the correct VM size for your workload
  • Understand the limits and capabilities of each size family
  • Attach, detach, resize, and encrypt disks properly
  • Know the characteristics and performance levels of HDD, SSD, Premium SSD, and Ultra disks
  • Use snapshots and backups for disk protection
  • Avoid storing important data on temporary disks

These skills are essential for real IT operations and are heavily tested on the AZ-104 exam.

Leave a Reply

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

Buy Me a Coffee