Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Dokument wird beschrieben, wie Sie eine regionale oder zonal verwaltete Instanzgruppe (Managed Instance Group, MIG) aus einer vorhandenen VM-Instanz erstellen.
Durch Erstellen einer MIG können Sie den auf einer einzelnen VM ausgeführten Dienst für mehrere VMs skalieren und sie als eine Entität verwalten. MIGs sind nützlich, um Ihre Arbeitslasten hochverfügbar und skalierbar zu machen. Weitere Informationen finden Sie unter Vorteile einer MIG.
Sie können eine MIG aus einer vorhandenen VM erstellen, die ausgeführt, angehalten oder beendet wird.
Wenn Sie eine MIG aus einer vorhandenen VM erstellen, müssen Sie Folgendes konfigurieren:
Eine Instanzvorlage, mit der in der Compute Engine die Eigenschaften der VMs in der verwalteten Instanzgruppe definiert werden.
Standardmäßig werden in der Instanzvorlage Folgendes angegeben:
Dieselben Attribute der vorhandenen VM, mit Ausnahme der IP-Adressen der vorhandenen VM
Option zum Erstellen eines benutzerdefinierten Bootlaufwerk-Images vom Bootlaufwerk der vorhandenen VM Wenn die vorhandene VM außerdem nicht bootfähige Laufwerke verwendet, führt die Compute Engine gegebenenfalls die folgenden Schritte aus:
Für jedes lokale SSD, das an die vorhandene VM angehängt ist, erstellt die Compute Engine ein leeres lokales SSD-Laufwerk.
Für jeden nichtflüchtigen Speicher im Lese-/Schreibmodus, der an die vorhandene VM angehängt ist, erstellt Compute Engine ein benutzerdefiniertes nichtflüchtiger Speicher-Image von dem nichtflüchtigen Speicher-Image der vorhandenen VM.
Alle nichtflüchtigen Laufwerke im Lesemodus, die an die vorhandene VM angehängt sind, sind in der Instanzvorlage enthalten.
Optional können Sie die Laufwerke und Eigenschaften der Instanzvorlage anpassen.
Die MIG, die die im vorherigen Schritt konfigurierte Instanzvorlage verwendet. Standardmäßig ist die MIG eine zonale MIG, für die Folgendes angegeben wird:
Wählen Sie die VM aus, mit der Sie die MIG erstellen möchten.
Klicken Sie auf Gruppe auf Basis dieser VM erstellen
Die Seite Auf Instanzgruppe skalieren wird geöffnet.
Führen Sie im Abschnitt Attribute der Instanzvorlage folgende Schritte aus:
Verwenden Sie im Feld Name den Standardnamen oder geben Sie einen Namen für die Instanzvorlage ein.
Führen Sie im Abschnitt Laufwerke die folgenden Schritte aus:
Bootlaufwerk: Standardmäßig generiert die Compute Engine ein neues benutzerdefiniertes Image des Bootlaufwerks der VM. Wenn Sie stattdessen ein vorhandenes Laufwerk verwenden möchten, klicken Sie auf editBootlaufwerk bearbeiten. Sie können ein öffentliches Image oder ein vorhandenes benutzerdefiniertes Image auswählen, das den VMs in der verwalteten Instanzgruppe bereitgestellt werden soll.
Vorhandenes Laufwerk: Nur anwendbar, wenn Ihre VM ein schreibgeschütztes Laufwerk hat.
Sie haben optional folgende Möglichkeiten:
Wenn Sie die Einstellungen für das bereitgestellte Laufwerk anpassen möchten, klicken Sie auf editLaufwerk bearbeiten.
Klicken Sie zum Entfernen des Laufwerks auf closeLaufwerk entfernen.
Neues Laufwerk: Nur zulässig, wenn Ihre VM ein Laufwerk im Lese-/Schreibmodus hat. Standardmäßig erstellt die Compute Engine ein neues benutzerdefiniertes Laufwerk-Image.
Sie haben optional folgende Möglichkeiten:
Wenn Sie ein vorhandenes Laufwerk verwenden oder die Laufwerkseinstellungen ändern möchten, klicken Sie auf editLaufwerk bearbeiten.
Klicken Sie zum Entfernen des Laufwerks auf closeLaufwerk entfernen.
Wenn die vorhandene VM ausgeführt wird oder angehalten ist und Sie angegeben haben, dass neue Boot- oder Nicht-Bootlaufwerke angehängt werden sollen, die die Laufwerk-Images der VM als Quellen verwenden, wird der Abschnitt Bei Image-Generierung angezeigt. Dann wählen Sie unbedingt eine der folgenden Optionen aus:
Wenn Sie die Integrität des Dateisystems aufrechterhalten möchten, während Sie ein Image vom VM-Laufwerk generieren, beenden Sie die VM, indem Sie VM beenden auswählen.
Sie können die VM nach dem Erstellen der MIG neu starten. Bis dahin ist Ihr Dienst unterbrochen.
Wenn Sie keine Unterbrechung des Dienstes wünschen und die Integrität des Dateisystems kein Sorgenfaktor ist, wählen Sie VM weiter ausführen aus.
Wenn Sie die Instanzvorlage, mit der die Eigenschaften der VMs in der verwalteten Instanzgruppe definiert werden, weiter anpassen möchten, klicken Sie auf settingsInstanzvorlage anpassen und ändern Sie die Felder nach Bedarf. Weitere Informationen finden Sie unter Instanzvorlagen erstellen.
Führen Sie im Abschnitt Attribute der Instanzgruppe folgende Schritte aus:
Verwenden Sie im Feld Name den Standardnamen oder geben Sie einen Namen für die MIG ein.
Im Abschnitt Standort können Sie eine regionale oder zonale MIG erstellen, indem Sie eines der folgenden Dinge tun:
So erstellen Sie eine regionale MIG:
Wählen Sie Mehrere Zonen aus.
Wählen Sie in der Liste Region eine Region aus, in der die VMs in der MIG erstellt werden sollen.
Wählen Sie in der Liste Zonen die Zonen aus, in denen die VMs in der MIG erstellt werden sollen.
So erstellen Sie eine zonale MIG:
Wählen Sie Einzelne Zone (Standardeinstellung) aus.
Wählen Sie in der Liste Region eine Region aus, in der die VMs in der MIG erstellt werden sollen. Standardmäßig ist die Region ausgewählt, in der sich die ursprüngliche VM befindet.
Wählen Sie in der Liste Zone eine Zone aus, in der die VMs für die MIG erstellt werden sollen. Standardmäßig ist die Zone ausgewählt, in der sich die ursprüngliche VM befindet.
Wenn Sie die MIG-Einstellungen weiter spezifizieren möchten, um beispielsweise die Anzahl der VMs anzugeben, klicken Sie auf settingsInstanzgruppe konfigurieren. Weitere Informationen finden Sie unter Regionale oder zonale MIGs erstellen.
Wenn Sie die Instanzvorlage und die verwaltete Instanzgruppe angepasst haben, klicken Sie auf Gruppe erstellen. Wenn Ihre VM ausgeführt wird und Sie in den vorherigen Schritten angegeben haben, dass sie beendet werden soll, klicken Sie auf VM beenden und Gruppe erstellen.
Die Seite Instanzgruppen wird geöffnet. Das Erstellen der Instanzvorlage und der MIG kann einige Minuten dauern.
[[["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\u003eThis guide outlines the process of creating a managed instance group (MIG) from an existing virtual machine (VM), enabling scaling and management of multiple VMs as a single entity.\u003c/p\u003e\n"],["\u003cp\u003eCreating a MIG involves configuring an instance template, which defines the properties of the VMs in the MIG, and optionally creating custom boot disk images from the VM.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting MIG can be either zonal (default) or regional, with options to customize properties such as autoscaling and the number of VMs in the group.\u003c/p\u003e\n"],["\u003cp\u003eThe existing VM used to create the MIG will not be added into the MIG, and stateful MIGs cannot be created using this method.\u003c/p\u003e\n"],["\u003cp\u003eDepending on whether the VM is running or suspended during MIG creation, and whether the user chooses to create disk images from the VMs disks, the user will need to ensure the file system's integrity is intact, potentially stopping the VM temporarily.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis document explains how to create a regional or zonal managed instance group\n(MIG) from an existing virtual machine (VM) instance.\n\nBy creating a MIG, you can scale the service running on a single VM across\nmultiple VMs and manage them as a single entity. MIGs are useful to make your\nworkloads highly available and scalable. For more information, see the\n[benefits of using a MIG](/compute/docs/instance-groups#benefits).\n\nBefore you begin\n\n- If you haven't already, [create and start a VM](/compute/docs/instances/create-start-instance).\n\nLimitations\n\nThe following limitations apply when you create a MIG from an existing VM:\n\n- The MIG doesn't add the existing VM to the MIG. The VM continues to exist\n as a standalone VM.\n\n- You can't create\n [stateful MIGs](/compute/docs/instance-groups/stateful-migs) from an\n existing VM.\n\nCreate a MIG from an existing VM\n\nYou can create a MIG from an existing VM that is running, stopped, or suspended.\nCreating a MIG from an existing VM involves the configuration of the following:\n\n1. An [instance template](/compute/docs/instance-templates), which\n Compute Engine uses to define the properties of the VMs in the MIG.\n By default, the instance template specifies the following:\n\n - The same properties of the existing VM, except for the existing VM's IP\n addresses.\n\n - An option to create a\n [custom boot disk image](/compute/docs/images#custom_images) from the\n existing VM's boot disk. Additionally, if the existing VM uses non-boot\n disks, Compute Engine does the following as applicable:\n\n - For any [local SSD](/compute/docs/disks/local-ssd) that is attached\n to the existing VM, Compute Engine creates a blank local SSD\n disk.\n\n - For any [persistent disk](/compute/docs/disks/persistent-disks) in\n read-write mode that is attached to the existing VM,\n Compute Engine creates a custom persistent disk image from\n the existing VM's persistent disk image.\n\n - For any persistent disk in read-only mode that is attached to the\n existing VM, the same disk is included in the instance template.\n\n Optionally, you can customize the disks and properties of the instance\n template.\n2. The MIG, which uses the instance template you configured in the previous\n step. By default, the MIG is a\n [zonal MIG](/compute/docs/instance-groups/create-zonal-mig) that specifies\n the following:\n\n - [Autoscaling](/compute/docs/instance-groups/create-mig-with-basic-autoscaling)\n is disabled.\n\n - One VM in the group.\n\n - The same zone where the existing VM is located.\n\n Optionally, you can customize the properties of the MIG.\n\n| **Caution:** If you create a MIG from a running or suspended VM and you choose to create disk images using that VM's disks, then you must [prepare the VM](/compute/docs/images/create-custom#minimize_writing_data_to_the_persistent_disk). Otherwise, Compute Engine might create corrupted disk images.\n\nPermissions required for this task\n\nTo perform this task, you must have the following\n[permissions](/iam/docs/overview#permissions):\n\n\n- To create an image: `compute.images.create` on the project.\n- To create an instance template: `compute.instanceTemplates.create` on the project.\n- To create a regional MIG: `compute.regionInstanceGroupManagers.create` on the project.\n- To create a zonal MIG: `compute.instanceGroupManagers.create` on the project.\n\nTo create a MIG from an existing VM, follow these steps:\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Select the VM that you want to use to create the MIG.\n\n3. Click **Create a group based on this VM**.\n\n The **Scale to instance group** page opens.\n4. In the **Instance template properties** section, do the following:\n\n 1. In the **Name** field, use the default name or enter a name for the\n instance template.\n\n 2. In the **Disks** section, do the following:\n\n - **Boot disk** : By default, Compute Engine generates a new\n custom image of the VM boot disk. If you want to use an existing\n disk instead, click edit\n **Edit boot disk**. You can select a public image or an existing\n custom image to attach to the VMs in the MIG.\n\n - **Existing disk**: Applicable only if your VM has a read-only disk.\n Optionally, you can do one of the following:\n\n - To customize any attachment settings of the read-only disk,\n click edit **Edit disk**.\n\n - To remove the disk, click\n close **Remove disk**.\n\n - **New disk**: Applicable only if your VM has a read-write disk. By\n default, Compute Engine creates a new custom disk image.\n Optionally, you can do one of the following:\n\n - To use an existing disk or modify the disk settings, click\n edit **Edit disk**.\n\n - To remove the disk, click\n close **Remove disk**.\n\n 3. If the existing VM is running or suspended, and you have specified to\n attach new boot or non-boot disks that use the VM's disk images as\n sources, the **On image generation** section appears. Then, you must\n select one of following options:\n\n - If you want to maintain the file system's integrity while generating\n an image from the VM disk, stop the VM by selecting **Stop the VM**.\n You can restart the VM after the MIG is created. Until then, your\n service is interrupted.\n\n - If you do not want interruption to your service and the file\n system's integrity is not a concern, select **Keep the VM running**.\n\n 4. To further customize the instance template used to define the properties\n of the VMs in the MIG, click\n settings\n **Customize instance template** and modify the fields as needed. For\n more information, see\n [Create instance templates](/compute/docs/instance-templates/create-instance-templates).\n\n5. In the **Instance group properties** section, do the following:\n\n 1. In the **Name** field, use the default name or enter a name for the MIG.\n\n 2. In the **Location** section, you can choose to create a regional or\n zonal MIG by doing one of the following:\n\n - To create a regional MIG, follow these steps:\n\n 1. Select **Multiple zones**.\n\n 2. In the **Region** list, select a region where to create the VMs\n in the MIG.\n\n 3. In the **Zones** list, select the zones where to create the VMs\n in the MIG.\n\n - To create a zonal MIG, follow these steps:\n\n 1. Select **Single zone** (default).\n\n 2. In the **Region** list, select a region where to create the VMs\n in the MIG. By default, the region where the original VM exists\n is selected.\n\n 3. In the **Zone** list, select a zone where to create the VMs for\n the MIG. By default, the zone where the original VM exists is\n selected.\n\n 3. To further specify the MIG settings---for example, to specify the\n number of VMs---click settings\n **Configure instance group** . For more information, see how to create a\n [regional](/compute/docs/instance-groups/distributing-instances-with-regional-instance-groups)\n or [zonal MIG](/compute/docs/instance-groups/create-zonal-mig).\n\n6. After you've finished customizing the instance template and the MIG, click\n **Create group** . If your VM is running and you specified to stop the VM in\n the previous steps, click **Stop VM and create group**.\n\n The **Instance groups** page opens. Creating the instance template and the\n MIG might take a few minutes to complete.\n\nWhat's next\n\n- Learn how to\n [update VM configurations in a MIG](/compute/docs/instance-groups/updating-migs).\n\n- Learn how to [autoscale groups of VMs](/compute/docs/autoscaler).\n\n- Learn more about\n [different configuration options available in a MIG](/compute/docs/instance-groups/creating-groups-of-managed-instances).\n\n- Learn more about\n [building scalable and resilient web applications](/solutions/scalable-and-resilient-apps).\n\n- Learn more about\n [disaster recovery on Google Cloud](/solutions/disaster-recovery-cookbook)."]]