Create a managed instance group (MIG)

Learn how to create amanaged 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 asingle entity. MIGs support features such as autohealing, autoscaling, loadbalancing, multiple zone coverage, and stateful workloads.

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


To follow step-by-step guidance for this task directly in the Google Cloud console, clickGuide 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.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

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

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  6. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Compute Engine API.

    Enable the API

Required roles

To get the permissions that you need to create an instance template and a MIG, ask your administrator to grant you theCompute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on your project. For more information about granting roles, seeManage access to projects, folders, and organizations.

This predefined role contains the permissions required to create an instance template and a MIG. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

The following permissions are required to create an instance template and a MIG:

  • Create an instance template: compute.instanceTemplates.create
  • Create a MIG: compute.instanceGroupManagers.create
  • Delete a MIG: compute.instanceGroupManagers.delete

You might also be able to get these permissions withcustom roles or otherpredefined roles.

Create an instance template

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

    Go to Instance templates

  2. ClickCreate instance template.

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

    1. In theBoot disk section, clickChange.

    2. In theOperating system list, selectUbuntu.

    3. ClickSelect.

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

  4. To create the instance template, clickCreate.

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

Create a MIG by using the instance template

  1. Go to theInstance groups page.

    Go to Instance groups

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

    1. In theName field, accept the default name or enterquickstart-instance-group-1.

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

    3. In theLocation section, ensure thatSingle zone is selected.

    4. In theRegion field, select a region where you want to create theMIG.

    5. In theAutoscaling section, accept thedefault settings unless you need to modify them.

  3. To create the MIG, clickCreate.

Allow a few minutes for Compute Engine to create the group and its VMs.After the group is ready, it's listed on theInstance 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 thatyou created to avoid incurring charges to your account:

  1. Go to theInstance groups page.

    Go to Instance groups

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

  3. ClickDelete.

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

Delete the project

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

To delete the project:

    Caution: Deleting a project has the following effects:
    • Everything in the project is deleted. If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
    • Custom project IDs are lost. When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as anappspot.com URL, delete selected resources inside the project instead of deleting the whole project.

    If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects can help you avoid exceeding project quota limits.

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

    Go to Manage resources

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

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.