Creating And Restoring Snapshots In Compute Engine

Introduction

Google Compute Engine is an Infrastructure as a Service component of Google Cloud Platform that allows users to launch and manage virtual machine instances. Though each instance is maintained on its persistent disk, Google provides the snapshot option, which can preserve the instance’s current state for future use.

Snapshots retain the exact state of the virtual machine disk at a specific moment and are used to retrieve, transfer, and make data accessible to other resources in your project.  Similar to backups, snapshots store the current state of the disk swiftly, securely, and across several places to ensure the integrity of your data.

By periodically creating snapshots, you can:

  • Restore the copy from mishaps, unintentional deletions, or data corruption and 
  • Streamline backup management of huge volumes and conserve storage space
  • Store copies on-site to ensure a speedy recovery.
  • Schedule the creation of snapshots
  • Reduce the cost of maintenance.

Required Permission

To create a snapshot, you need to have the following permission: compute.snapshots.create

Creating a Snapshot

gcp, google cloud, cloud vms, gce, compute engine snapshot, gcp compute engine snapshot, compute engine disk, disk snapshot gcp, compute engine instances

To create a snapshot in compute engine, follow the given steps:

  1. In the Google Cloud Platform Console, navigate to the Snapshots panel on the left.
  2. Click the Create Snapshot option.
  3. Then, enter the snapshot name and a description(optional).
  4. Next, specify either the default storage destination.
  5. Finally, press the Create button to commence the process.

After completion, you will be redirected to the snapshot list page on which the newly created snapshot will be accessible.

Restoring from a snapshot

Similar to creating, snapshot restoration is also simple to execute. Firstly, to restore a snapshot and attach the new disk to an existing instance, you will need to have the following permissions:

  • compute.disks.create to create a new disk
  • compute.instances.attachDisk on the VM instance
  • compute.disks.use on the disk to attach

Then, follow the following steps:

gcp, google cloud, cloud vms, gce, compute engine snapshot, gcp compute engine snapshot, compute engine disk, disk snapshot gcp, compute engine instances

  1. Go to the Disks section and select the ‘Create Disk’ button to create a new disk.
  2. Then, enter the disk name and type.
  3. Next, choose the region (you can select any area and zone, regardless of the storage location of the source snapshot).
  4. Then select Snapshot under Source type.
  5. Select the name of the snapshot to restore.
  6. Mention the size of the new disk (the number must be equal to or more than the size of the source disk used to create the snapshot).
  7. Finally, click the Create button to commence the process.

Following the restoring process, you can attach the new disk to an existing instance. Here are the steps to follow: 

gcp, google cloud, cloud vms, gce, compute engine snapshot, gcp compute engine snapshot, compute engine disk, disk snapshot gcp, compute engine instances

  1. Navigate to the VM instances page.
  2. Select the instance to which you wish to restore your disk.
  3. Click Edit at the top of the instance information page.
  4. Under Additional disks, click Attach existing disk.
  5. Choose the new disk’s name made from your snapshot.
  6. Click Done to attach the disk.
  7. Click Save to save your changes to the instance.

Delete a snapshot

On the snapshots section, select the snapshots you wish to remove and click the Delete button at the top of the screen to delete them.

gcp, google cloud, cloud vms, gce, compute engine snapshot, gcp compute engine snapshot, compute engine disk, disk snapshot gcp, compute engine instances

When you delete a snapshot, it is labelled as deleted. However, a snapshot is eliminated if no other snapshots rely on it for data; otherwise, the data in the deleted snapshot is transferred to the next one in line, thus enlarging it.

Conclusion

In conclusion, persistent disk snapshots in Google Cloud Platform (GCP) are a useful tool for backing up data, recovering from data loss or corruption, creating new persistent disks, and restoring persistent disks to a previous state. Snapshots are stored in Google Cloud Storage and are accessible from any project within the same organization.

  • Snapshots are incremental, which means that only the changes made to a persistent disk since the last snapshot are saved. GCP can automatically create snapshots of your persistent disks at regular intervals if you enable the “Snapshot schedule” feature.
  • Snapshots are charged based on the amount of data stored in them and the number of read/write operations performed on them, so you should delete snapshots that are no longer needed to cut down your GCP storage charges.

If your organization processes cloud workloads in massive volumes, then you may be at risk of continually over spending with each billing cycle. Book a demo at Economize today to take control of your cloud expenditure and efficiently optimize your cloud costs.

Discover what’s possible

Help me reduce my cloud costs

You're spending a lot on cloud — but do you know how much?
We are committed to making your cloud spend simpler and help you optimize it.

You should also check out this other helpful content.

The Marketing Automation Essentials

Learn all you need to know about marketing automation and customer journeys.

The Marketing Automation Essentials

Learn all you need to know about marketing automation and customer journeys.

Get started with Economize today

With our powerful recommendations and easy-to-use tool, it's never been easier to reduce your cloud costs.
add_action( 'wp_footer', function() { if ( ! defined( 'ELEMENTOR_VERSION' ) ) { return; } ?>