Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Compute Engine: what is the difference between disk snapshot and disk image?

I've been using both for my startup and to me, the functionality is the same. Until now, the instances I've been creating are only for computation. I'm wondering how GCE disk images and snapshots are different in terms of technology, and in which situation it is better to use one over the other.

like image 222
Emmanuel Avatar asked Dec 04 '14 09:12

Emmanuel


People also ask

What is a snapshot in GCP?

Snapshots are global resources, so you can use them to restore data to a new disk or instance within the same project. You can also share snapshots across projects.

What is snapshot in Compute Engine?

Snapshot deletionCompute Engine uses incremental snapshots so that each snapshot contains only the data that has changed since the previous snapshot. For unchanged data, snapshots reference the data in previous snapshots. Storage costs for persistent disk snapshots charge only for the total size of the snapshot.

What is disk image in cloud computing?

Disk imaging is a form of hard drive backup that places all of a hard drive's data into a compressed file. That file can be stored on other devices, in a file system, or in the cloud. Disk imaging allows individuals and businesses to recover all data that was on a computer when the image was made.

What is Google machine image?

A machine image is a Compute Engine resource that stores all the configuration, metadata, permissions, and data from multiple disks of a virtual machine (VM) instance.


2 Answers

A snapshot reflects the contents of a persistent disk in a concrete instant in time. An image is the same thing, but includes an operating system and boot loader and can be used to boot an instance.

Images and snapshots can be public or private. In the case of images, public can mean official public images provided by Google or not.

Snapshots are stored as diffs (a snapshot is stored relative to the previous one, though that is transparent to you) while images are not. They are also cheaper ($0.03 per GB/month vs $0.085 for images).

These days the two concepts are quite similar. It's now possible to start an instance using a snapshot instead of an image, which is an easy way of resizing your boot partition. Using snapshots may be simpler for most cases.

like image 62
Nacho Coloma Avatar answered Oct 01 '22 22:10

Nacho Coloma


Snapshots:

  • Good for backup and disaster recovery
  • Lower cost than images
  • Smaller size than images since it doesn't contain OS, etc.
  • Differential backups - only the data changed since the last snapshot is recreated
  • Faster to create than images
  • Snapshots are only available in the project they are created (now it is possible to share between projects)
  • Can be created for running disks even while they are attached to running instances

Images:

  • Good for reusing compute engine instance states with new instances
  • Available across different projects
  • Can't be created for running instances(unless you use --force flag)
like image 30
Caner Avatar answered Oct 01 '22 21:10

Caner