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:
Before you begin
- 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.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
- Enable the Compute Engine 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
In the Google Cloud console, go to theInstance templates page.
Click
Create instance template .To create a template that uses an Ubuntu OS, perform the following steps:
In the
Boot disk section, clickChange.In theOperating system list, selectUbuntu.
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.
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
Go to the
Instance groups page.Click
Create instance group ,and then perform the following steps:In theName field, accept the default name or enter
quickstart-instance-group-1.In theInstance template list,select the instance template that you created earlier.
In the
Location section, ensure thatSingle zone is selected.In theRegion field, select a region where you want to create theMIG.
In the
Autoscaling section, accept thedefault settings unless you need to modify them.
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:
Go to theInstance groups page.
Select the instance group that you want to delete.
ClickDelete.
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:
What's next
- Learn how towork with managed instances.
- Learn about otherbasic scenarios for creating a MIG.
- Learn more aboutautoscaling and about usingdifferent autoscaling signals to automatically create VMs when load increasesand delete VMs when load goes down.
- To improve the availability of your application, set up anapplication-based autohealing health check.An application-based health check tells the MIG to automatically recreateunhealthy VMs if your application fails to respond as expected.
- To further improve availability, learn about distributing a MIG's VMs acrossmultiple zones within a region bycreating a regional MIG.
- To update the configuration of the VMs in your MIG, create and apply a newinstance template. For more information, seeApplying new configurations to VMs in a MIG.
- If you need to support a stateful workload, learn how toadd a stateful configuration.
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.