Eine MIG ist eine Sammlung von VM-Instanzen (Virtual Machine), die Sie als eine einzige Entität verwalten können. MIGs unterstützen Features wie automatische Reparatur, Autoscaling, Load-Balancing, mehrere Zonenabdeckungen und zustandsorientierte Arbeitslasten.
Jede VM in einer MIG basiert auf einer Instanzvorlage. Sie müssen eine Instanzvorlage erstellen, bevor Sie eine MIG erstellen.
Eine detaillierte Anleitung dazu finden Sie direkt in der Google Cloud Console. Klicken Sie dazu einfach auf Anleitung:
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.
Führen Sie die folgenden Schritte aus, um eine Vorlage zu erstellen, die ein Ubuntu-Betriebssystem verwendet:
Klicken Sie im Abschnitt Bootlaufwerk auf Ändern.
Wählen Sie in der Liste Betriebssystem die Option Ubuntu aus.
Klicken Sie auf Auswählen.
Die Vorlage wendet diese Einstellungen auf alle VMs an, die mit dieser Vorlage erstellt werden. Notieren Sie sich den Namen der Vorlage. Sie werden ihn im Laufe dieser Anleitung noch verwenden.
Klicken Sie auf Erstellen, um die Instanzvorlage zu erstellen.
Es kann einige Minuten dauern, bis Compute Engine die Vorlage erstellt hat. Wenn die Vorlage bereit ist, wird sie auf der Seite Instanzvorlagen aufgeführt.
Klicken Sie auf Instanzgruppe erstellen und führen Sie dann die folgenden Schritte aus:
Übernehmen Sie im Feld Name den Standardnamen oder geben Sie quickstart-instance-group-1 ein.
Wählen Sie in der Liste Instanzvorlage die zuvor erstellte Instanzvorlage aus.
Im Bereich Standort muss die Option Einzelne Zone ausgewählt sein.
Wählen Sie im Feld Region eine Region aus, in der Sie die MIG erstellen möchten.
Übernehmen Sie im Abschnitt Autoscaling die Standardeinstellungen, sofern Sie diese nicht ändern müssen.
Klicken Sie zum Erstellen der MIG auf Erstellen.
Warten Sie einige Minuten, bis Compute Engine die Gruppe und ihre VMs erstellt hat.
Wenn die Gruppe bereit ist, wird sie auf der Seite Instanzgruppen aufgeführt.
Sie haben erfolgreich eine verwaltete Instanzgruppe erstellt.
Bereinigen
Mit den folgenden Schritten vermeiden Sie, dass Ihrem Google Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:
Ressourcen löschen
Wenn Sie ein vorhandenes Google Cloud Projekt verwendet haben, löschen Sie die von Ihnen erstellten Ressourcen. So vermeiden Sie, dass Ihrem Konto Gebühren in Rechnung gestellt werden:
Erfahren Sie mehr über das Autoscaling und die Verwendung verschiedener Autoscaling-Signale, um VMs automatisch zu erstellen, wenn die Last zunimmt, und VMs zu löschen, wenn die Last abnimmt.
Richten Sie eine anwendungsbasierte Systemdiagnose für die automatische Reparatur ein, um die Verfügbarkeit Ihrer Anwendung zu verbessern.
Eine anwendungsbasierte Systemdiagnose weist die MIG an, fehlerhafte VMs automatisch neu zu erstellen, wenn Ihre Anwendung nicht wie erwartet reagiert.
Zur weiteren Verbesserung der Verfügbarkeit können Sie die VMs einer MIG auf mehrere Zonen innerhalb einer Region verteilen. Dazu erstellen Sie eine regionale MIG.
Erstellen Sie eine neue Instanzvorlage und wenden Sie sie an, um die Konfiguration der VMs in Ihrer MIG zu aktualisieren. Weitere Informationen finden Sie unter Neue Konfigurationen auf VMs in einer MIG anwenden.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (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)."]]