Um MIG é um conjunto de instâncias de máquina virtual (VM) que podem ser gerenciadas como uma
única entidade. Os MIGs são compatíveis com recursos como recuperação automática,
escalonamento automático, balanceamento de carga, cobertura de várias zonas e cargas de trabalho com estado.
Cada VM em um MIG é baseada em um
modelo de instância. É necessário criar um
modelo de instância antes de criar um MIG.
Para seguir as instruções detalhadas desta tarefa diretamente no console do
Google Cloud , clique em Orientação:
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.
Clique em Criar grupo de instâncias,
e execute as seguintes etapas:
No campo Nome, aceite o nome padrão ou digite
quickstart-instance-group-1.
Na lista Modelo de instância,
selecione o modelo de instância que você criou anteriormente.
Na seção Local, verifique se a opção
Zona única está selecionada.
No campo Região, selecione uma região em que você quer criar o
MIG.
Na seção Escalonamento automático, aceite as
configurações padrão, a menos que você precise modificá-las.
Para criar o MIG, clique em Criar.
Aguarde alguns minutos para que o Compute Engine crie o grupo e as VMs.
Depois que o grupo estiver pronto, ele será listado na página Grupos de instâncias.
Você criou um grupo de instâncias gerenciadas.
Limpar
Para evitar cobranças na sua conta do Google Cloud pelos
recursos usados nesta página, siga estas etapas.
Excluir os recursos
Se você usou um projeto do Google Cloud que já existe, exclua os recursos que
foram criados para evitar cobranças na sua conta:
Saiba mais sobre escalonamento automático e sobre
como usar sinais de escalonamento automático diferentes para criar VMs automaticamente
quando a carga aumenta e excluir VMs quando ela diminui.
Para melhorar a disponibilidade do aplicativo, configure uma
verificação de integridade de recuperação automática baseada em aplicativo.
Uma verificação de integridade baseada em aplicativo instrui o MIG a recriar automaticamente
as VMs não íntegras se o aplicativo não responder conforme o esperado.
Para melhorar ainda mais a disponibilidade, saiba como distribuir VMs de um MIG em
várias zonas de uma região
criando um MIG regional.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-03 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) Learn 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- 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\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\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\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\nDelete 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\nDelete 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- 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)."]]