Working with Custom Images on Google Compute Engine

Get Started
1 hour
  • 5 Learning Objectives

About this Hands-on Lab

In this hands-on lab, we are going to practice creating custom images from two versions of a web server (which will be provided for you), add both images to the same image family, describe the image family, deprecate an image, and create a new web server from our custom images.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create image from base-apache instance using web console.

Create custom image from base-apache instance using web console:

  • Stop the instance
  • Go to Compute Engine > Images
  • Click CREATE IMAGE
  • Name image "webserver-base"
  • Set Family to "webserver"
  • In the Source dropdown menu, select Disk
  • In the Source disk dropdown menu, select base-apache
  • Click Create
Create image from custom-webpage instance using gcloud command.

Create image from custom-webpage instance using gcloud command:

  • Stop the instance
  • Open Cloud Shell
  • Enter command to create image from the custom-webpage disk, name the image "custom-webpage", and add to the webserver image family
    • gcloud compute images create custom-webpage --source-disk=custom-webpage --source-disk-zone=us-central1-a --family=webserver
  • Verify that image is created and in the appropriate family using the web console
View images in web console and view ‘webserver’ image family information in command line.

View images in web console and view webserver image family information in command line:

  • In web console, go to Compute Engine > Images
  • To describe image family and view latest image, enter command:
    • gcloud compute images describe-from-family webserver
  • Shown image is the latest version
Deprecate base image in our ‘webserver’ image family using command line.

Deprecate base version using command line:

  • First, view process in web console:
    • Go back to Compute Image > Images
    • Place check next to webserver-base, and click DEPRECATE
    • Set State to Deprecated, and set Replacement as custom-page-1
    • Cancel out and do the same thing via command line.
  • In Cloud Shell, enter:
    • gcloud compute images deprecate webserver-base --state DEPRECATED
  • Verify in web console
Create a new web server from custom image.

Create a new web server from custom image:

  • Go to Compute Engine > VM Instances
  • Click Create Instance
  • Place it in any region and zone you want
  • Name the instance "new-web-server"
  • Under Boot disk, click Change
  • Click on Custom images from the top menu
  • Click on Show deprecated images to view all images
  • Select custom-webpage, and click Select
  • Check the box for Allow HTTP traffic under Firewall settings
  • Click Create
  • Once the instance is up, click the external IP address to verify the new web page works

Additional Resources

Be sure to launch the lab in incognito (or other private view) mode to avoid cached login issues.

You will have two custom web servers created in Compute Engine for you when you begin the lab.

What are Hands-on Labs

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.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!
Thanks for reaching out!

You’ll hear from us shortly. In the meantime, why not check out what our customers have to say about ACG?