Launching a Managed Instance Group in Compute Engine

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this lab, you will learn how to create an instance template and customize it to your needs, create a managed instance group that uses the instance template, and learn how to stress test your instances to make sure your configuration works!

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an Instance Template
  1. In the Google Cloud console, go to the Compute Engine and then go to Instance templates

        Click Create instance template.
  2. Name your Instance Template

  3. Under Machine Type choose e2-micro

  4. Under Firewall allow HTTP and HTTPS

  5. Click Create

Create a Managed Instance Group

For Health Check:

  1. In the Google Cloud console, go to the Health Check page.
  2. Click Create Health Check.
  3. Give the health check a name, Regional Scope, TCP protocol, port 80.
  4. Click Create.

For Creating the Instance Group:

  1. In the Google Cloud console, go to the Instance groups page.
  2. Click Create instance group.
  3. Under Instance template, select the instance template you created.
  4. Under Location, choose Single Zone US-Central1 for region, and US-Central1-A for zone.
  5. For Autoscaling, choose On: add and remove instances to the group with a min of 1 and a max of 3, and CPU Untilization at 60%.
  6. For Health Check, choose the health check you’ve created.
  7. Click Create.
Test and Stress the Managed Instance Group
  1. Select the instance and choose SSH.
  2. Use command sudo apt-get install stress and then sudo stress --cpu 2 --timeout 500 to stress your instance.
  3. After eight minutes, you should see your instance scale to maximum capacity of three instances.

Additional Resources

Your team needs you to set up an environment that will help scale your instances in GCP if CPU utilization of an instance reaches a certain threshold.

Your job is to:

  • Create an instance template.
  • Create a managed instance group with a min of 1 and max of 3.
  • Stress and test the instance group to ensure that the scaling policy works .

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?