Snapshots are a powerful way to protect and restore data in Google Cloud Compute Engine. A snapshot is essentially a backup of a persistent disk that you can later use to:
- Recover data if the disk is corrupted
- Create new disks or VM instances quickly
- Set up backup schedules for compliance and availability
In this tutorial, weโll go step by step to:
- Create a snapshot from an existing VM disk
- Review snapshot properties
- Create a new VM or disk from a snapshot
- Set up snapshot schedules
๐น Step 1: Start the VM
For this demo, weโll use an existing VM (demo8-vm1).
๐ Console:
Go to Compute Engine โ VM Instances โ demo8-vm1 โ Actions โ Start
๐น Step 2: Create a Snapshot
You can create a snapshot directly from a VMโs disk.
Option 1 (from Disk):
๐ Compute Engine โ Storage โ Disks โ demo8-vm1 โ Actions โ Create Snapshot
Option 2 (from Snapshots page):
๐ Compute Engine โ Storage โ Snapshots โ Create Snapshot
Fill details:
- Name: demo8-vm1-snapshot-1
- Description: demo8-vm1-snapshot-1
- Source disk: demo8-vm1
- Location: Multi-regional โ us
- Encryption: Use same encryption as disk
- Application consistency: unchecked
- Click Create โ
CLI Equivalent:
# Create Snapshot
gcloud compute snapshots create demo8-vm1-snapshot \
--project=gcpdemos \
--description=demo8-vm1-snapshot \
--source-disk=demo8-vm1 \
--source-disk-zone=us-central1-a \
--storage-location=us
๐น Step 3: Review Snapshot Properties
๐ Go to Compute Engine โ Storage โ Snapshots โ demo8-vm1-snapshot
Here you can review:
- Size
- Storage location
- Source disk
- Creation timestamp
Snapshots are incremental in GCP โ only changes since the last snapshot are stored, saving cost and time.
๐น Step 4: Create VM or Disk using Snapshot
Snapshots arenโt just backupsโyou can also use them to spin up new resources.
๐ From Snapshots โ demo8-vm1-snapshot โ Actions:
- Create Instance โ Launch a new VM from snapshot
- Create Disk โ Provision a new persistent disk from snapshot
This makes snapshots super useful for cloning environments (like dev/test copies of production).
VM instance is created from the snapshot
If you access the server through browser
๐น Step 5: Snapshot Schedules
Manually creating snapshots is fine, but production systems need automated protection.
Snapshot schedules let you define policies like:
Frequency: Hourly, Daily, Weekly
Auto-deletion: e.g., keep snapshots only for 14 days
Deletion Rule:
- Keep snapshots indefinitely
- Delete older snapshots automatically
๐ Example:
- Take a daily snapshot
- Retain only last 14 days
- Auto-delete older ones
This ensures you always have recent backups without excessive cost.
โ Final Thoughts
- Snapshots in GCP are lightweight, incremental, and multi-regional, making them ideal for backups.
- You can restore, clone, or create new VMs/disks from them.
- Schedules help automate backups and manage retention.
๐ก Pro Tip: Always store snapshots in multi-regional locations for disaster recovery.
๐ Thatโs it! You now know how to create, manage, and use snapshots in Google Cloud Compute Engine ๐
Top comments (0)