Create a managed instance group (MIG)

Learn how to create a managed instance group (MIG) in Compute Engine by using the Google Cloud console.

A MIG is a collection of virtual machine (VM) instances that you can manage as a single entity. MIGs support features such as autohealing, autoscaling, load balancing, multiple zone coverage, and stateful workloads.

Each VM in a MIG is based on an instance template. You need to create an instance template before you create a MIG.


To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:

Guide me


Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Google Cloud project.

  6. Enable the Compute Engine API.

    Enable the API

Create an instance template

  1. In the Google Cloud console, go to the Instance templates page.

    Go to Instance templates

  2. Click Create instance template.

  3. To create a template that uses an Ubuntu OS, perform the following steps:

    1. In the Boot disk section, click Change.

    2. In the Operating system list, select Ubuntu.

    3. Click Select.

    The template applies these settings to all the VMs that are created using this template. Note the name of the template, which you use later in the tutorial.

  4. To create the instance template, click Create.

Allow a few minutes for Compute Engine to create the template. When the template is ready, it's listed on the Instance templates page.

Create a MIG by using the instance template

  1. Go to the Instance groups page.

    Go to Instance groups

  2. Click Create instance group, and then perform the following steps:

    1. In the Name field, accept the default name or enter quickstart-instance-group-1.

    2. In the Instance template list, select the instance template that you created earlier.

    3. In the Location section, ensure that Single zone is selected.

    4. In the Region field, select a region where you want to create the MIG.

    5. In the Autoscaling section, accept the default settings unless you need to modify them.

  3. To create the MIG, click Create.

Allow a few minutes for Compute Engine to create the group and its VMs. After the group is ready, it's listed on the Instance groups page.

You have successfully created a managed instance group.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.

Delete the resources

If you used an existing Google Cloud project, delete the resources that you created to avoid incurring charges to your account:

  1. Go to the Instance groups page.

    Go to Instance groups

  2. Select the instance group that you want to delete.

  3. Click Delete.

  4. When you're prompted, enter the required value, and then click Delete.

Delete the project

The easiest way to eliminate billing is to delete the project that you created for the tutorial.

To delete the project:

  1. In the Google Cloud console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

What's next