VM snapshots and images
What it is
- A snapshot is a read-only, full point-in-time copy of a managed disk, regionally stored, used for backup, or to build new disks.
- An image (shared image / managed image) is a generalized OS + apps blueprint you deploy many VMs from, backed by the Azure Compute Gallery for versioning and regional replication.
Why it exists
You need to recover a broken VM, or stamp out many identical VMs without reconfiguring each. Snapshots give cheap rollback; images give repeatable, versioned, regionally-replicated provisioning.
Key ideas
- Snapshot → new disk → attach to a VM; or snapshot both OS+data disk to reconstruct a VM. Snapshots of a running VM can be inconsistent unless the app is quieted.
- Generalization: Windows
sysprep, Linuxwaagent -deprovision— removes machine-specific data so the image can be deployed to many VMs as if new. - Managed image vs Compute Gallery: shared images in the Azure Compute Gallery support versioning (
publisher:offer:sku:version) and replication to multiple regions → the modern path. - Images + scale sets / Bicep → consistent fleet provisioning.
How it fits (diagram)
Exam notes
- Snapshot = disk-level backup; does not generalize — do not boot the same SID/hostname on many snapshots.
- To create a reusable fleet image: generalize first (sysprep/waagent), then capture image. Deploying the same image (not generalized) to many VMs causes identity conflicts.
- Azure Compute Gallery (formerly Shared Image Gallery) = versioned + globally replicated images, integrated with scale sets for patching.
- AZ-104: understand when to snapshot vs image vs Back up VM (Azure Backup) for disaster recovery.
Related
Path MOC · managed-disks · azure-vm · virtual-machine-scale-set
📘 Source: Microsoft Learn — Vm Snapshot