Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru

Working with Snapshots on Google Compute Engine

This hands-on lab will help to provide experience working with snapshots on Compute Engine, both in the web console and command line format, which we will interact with via Cloud Shell.


Path Info

Clock icon Beginner
Clock icon 1h 0m
Clock icon Aug 05, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create Snapshot Using Web Console

    1. Go to the top-left menu > Compute Engine > Snapshots
    2. Click Create snapshot
    3. Name snapshot "web-backup-v1"
    4. In Source Disk dropdown menu, select Website
    5. Click Create
  2. Challenge

    Make Instance Change – Update Website to VERSION 2

    1. Connect to the website instance using SSH from the Compute Engine web console

    2. Enter the following command to replace index page with 'VERSION 2' instead of 'VERSION 1':

       sudo sed -i 's/VERSION 1/VERSION 2/' /var/www/html/index.html
    3. Exit SSH session

  3. Challenge

    Create New Snapshot Using the Cloud Shell

    1. Activate the Cloud Shell by clicking its icon in the top row.

    2. If no ID is displayed in yellow in the Cloud Shell, open the Project panel by clicking the project name in the upper-left.

    3. Copy the current project ID.

    4. In the Cloud Shell, enter the following command:

      gcloud config set project <PROJECT_ID>
    5. Create a new snapshot with the following command:

       gcloud compute disks snapshot website --snapshot-names web-backup-v2 --zone us-central1-a
    6. Verify snapshots using web console and Cloud Shell. Notice the size of the second snapshot compared to first:

      	gcloud compute snapshots list
      	gcloud compute snapshots describe web-backup-v2
  4. Challenge

    Restore First Snapshot Using Web Console in New Zone

    1. Go to top left menu > Compute Engine
    3. Name instance "website-restore-1"
    4. From the Region list, choose us-east1 and from Zone, choose us-east1-a.
    5. Under Machine configuration, from the Series list, choose First Generation - N1.
    6. From the Machine type list, choose n1-standard-1.
    7. Under Boot Disk, click Change.
    8. In the Boot Disk options, click the Snapshots tab.
    9. From the Snapshot list, choose web-backup-v1 and click Select.
    10. In the Firewall section, check the Allow HTTP traffic option.
    11. Click Create
  5. Challenge

    Restore Second Snapshot Using Command Line

    1. Navigate to Cloud Shell

    2. Create disk from snapshot:

       gcloud compute disks create website-restore-2 --source-snapshot web-backup-v2 --zone us-central1-a
    3. Create new instance from disk:

       gcloud compute instances create website-restore-2 --disk name=website-restore-2,boot=yes --zone us-central1-a --tags=http-server
    4. Confirm the new instance by returning to the console VM page and clicking its External IP link.

    Congratulations, you've completed this hands-on lab!

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans