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)