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.
Before you begin
In the Trusted Cloud console, on the project selector page,
select or create a Trusted Cloud project.
To create a template that uses an Ubuntu OS, perform the following steps:
In the Boot disk section, click Change.
In the Operating system list, select
Ubuntu.
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.
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.
Learn more about autoscaling and about using
different autoscaling signals to automatically create VMs when load increases
and delete VMs when load goes down.
To improve the availability of your application, set up an
application-based autohealing health check.
An application-based health check tells the MIG to automatically recreate
unhealthy VMs if your application fails to respond as expected.
To further improve availability, learn about distributing a MIG's VMs across
multiple zones within a region by
creating a regional MIG.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eA Managed Instance Group (MIG) is a collection of virtual machine (VM) instances managed as a single entity, supporting features like autohealing, autoscaling, load balancing, and stateful workloads.\u003c/p\u003e\n"],["\u003cp\u003eCreating a MIG requires a pre-existing instance template, which defines the configuration of the VMs within the group, and you must enable the Compute Engine API before starting.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a MIG in the Google Cloud console by navigating to the "Instance groups" page, selecting an instance template, and specifying the desired region and autoscaling settings.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating a MIG, you can delete the resources, including the instance group itself or the entire project, to avoid incurring further charges, but be cautious as deleting the project will delete everything in it.\u003c/p\u003e\n"],["\u003cp\u003eThe provided documentation also offers guidance on working with managed instances, autoscaling, autohealing, regional MIGs, updating configurations, and adding a stateful configuration for managing your virtual machines.\u003c/p\u003e\n"]]],[],null,["# Create a managed instance group (MIG)\n=====================================\n\nLearn how to create a\n[managed instance group (MIG)](/compute/docs/instance-groups#managed_instance_groups)\nin Compute Engine by using the Google Cloud console.\n\nA MIG is a collection of virtual machine (VM) instances that you can manage as a\nsingle entity. MIGs support features such as autohealing, autoscaling, load\nbalancing, multiple zone coverage, and stateful workloads.\n\nEach VM in a MIG is based on an\n[instance template](/compute/docs/instance-templates). You need to create an\ninstance template before you create a MIG.\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/welcome?walkthrough_id=compute--instance-groups--quickstart-mig)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n1. Enable the Compute Engine API.\n [Enable the API](https://console.cloud.google.com/apis/api/compute.googleapis.com/overview)\n\nCreate an instance template\n---------------------------\n\n1. In the Google Cloud console, go to the **Instance templates** page.\n\n [Go to Instance templates](https://console.cloud.google.com/compute/instanceTemplates/list)\n2. Click **Create instance template**.\n\n3. To create a template that uses an Ubuntu OS, perform the following steps:\n\n 1. In the **Boot disk** section, click **Change**.\n\n 2. In the **Operating system** list, select\n **Ubuntu**.\n\n 3. Click **Select**.\n\n The template applies these settings to all the VMs that are created using\n this template. Note the name of the template, which you use later in the\n tutorial.\n4. To create the instance template, click **Create**.\n\nAllow a few minutes for Compute Engine to create the template. When the\ntemplate is ready, it's listed on the **Instance templates** page.\n\nCreate a MIG by using the instance template\n-------------------------------------------\n\n1. Go to the **Instance groups** page.\n\n\n [Go to Instance groups](https://console.cloud.google.com/compute/instanceGroups)\n2. Click **Create instance group**,\n and then perform the following steps:\n\n 1. In the **Name** field, accept the default name or enter\n `quickstart-instance-group-1`.\n\n 2. In the **Instance template** list,\n select the instance template that you created earlier.\n\n 3. In the **Location** section, ensure that\n **Single zone** is selected.\n\n 4. In the **Region** field, select a region where you want to create the\n MIG.\n\n 5. In the **Autoscaling** section, accept the\n default settings unless you need to modify them.\n\n3. To create the MIG, click **Create**.\n\nAllow a few minutes for Compute Engine to create the group and its VMs.\nAfter the group is ready, it's listed on the **Instance groups** page.\n\nYou have successfully created a managed instance group.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n### Delete the resources\n\nIf you used an existing Google Cloud project, delete the resources that\nyou created to avoid incurring charges to your account:\n\n1. Go to the **Instance groups** page.\n\n\n [Go to Instance groups](https://console.cloud.google.com/compute/instanceGroups)\n2. Select the instance group that you want to delete.\n\n3. Click **Delete**.\n\n4. When you're prompted, enter the required value, and then click **Delete**.\n\n### Delete the project\n\n\nThe easiest way to eliminate billing is to delete the project that you\ncreated for the tutorial.\n\nTo delete the project:\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **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.\n| - **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 an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n|\n|\n| If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects\n| can help you avoid exceeding project quota limits.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- Learn how to [work with managed instances](/compute/docs/instance-groups/working-with-managed-instances).\n- Learn about other [basic scenarios for creating a MIG](/compute/docs/instance-groups/creating-groups-of-managed-instances).\n- Learn more about [autoscaling](/compute/docs/autoscaler) and about using different autoscaling signals to automatically create VMs when load increases and delete VMs when load goes down.\n- To improve the availability of your application, set up an [application-based autohealing health check](/compute/docs/instance-groups/autohealing-instances-in-migs). An application-based health check tells the MIG to automatically recreate unhealthy VMs if your application fails to respond as expected.\n- To further improve availability, learn about distributing a MIG's VMs across multiple zones within a region by [creating a regional MIG](/compute/docs/instance-groups/regional-migs).\n- To update the configuration of the VMs in your MIG, create and apply a new instance template. For more information, see [Applying new configurations to VMs in a MIG](/compute/docs/instance-groups/updating-migs).\n- If you need to support a stateful workload, learn how to [add a stateful configuration](/compute/docs/instance-groups/configuring-stateful-migs)."]]