Create a MIG from an existing VM Stay organized with collections Save and categorize content based on your preferences.
This document explains how to create a regional or zonal managed instance group(MIG) from an existing virtual machine (VM) instance.
By creating a MIG, you can scale the service running on a single VM acrossmultiple VMs and manage them as a single entity. MIGs are useful to make yourworkloads highly available and scalable. For more information, see thebenefits of using a MIG.
Before you begin
- If you haven't already,create and start a VM.
Limitations
The following limitations apply when you create a MIG from an existing VM:
The MIG doesn't add the existing VM to the MIG. The VM continues to existas a standalone VM.
You can't createstateful MIGs from anexisting VM.
Create a MIG from an existing VM
You can create a MIG from an existing VM that is running, stopped, or suspended.Creating a MIG from an existing VM involves the configuration of the following:
Aninstance template, whichCompute Engine uses to define the properties of the VMs in the MIG.By default, the instance template specifies the following:
The same properties of the existing VM, except for the existing VM's IPaddresses.
An option to create acustom boot disk image from theexisting VM's boot disk. Additionally, if the existing VM uses non-bootdisks, Compute Engine does the following as applicable:
For anylocal SSD that is attachedto the existing VM, Compute Engine creates a blank local SSDdisk.
For anypersistent disk inread-write mode that is attached to the existing VM,Compute Engine creates a custom persistent disk image fromthe existing VM's persistent disk image.
For any persistent disk in read-only mode that is attached to theexisting VM, the same disk is included in the instance template.
Optionally, you can customize the disks and properties of the instancetemplate.
The MIG, which uses the instance template you configured in the previousstep. By default, the MIG is azonal MIG that specifiesthe following:
Autoscalingis disabled.
One VM in the group.
The same zone where the existing VM is located.
Optionally, you can customize the properties of the MIG.
Permissions required for this task
To perform this task, you must have the followingpermissions:
- To create an image:
compute.images.createon the project. - To create an instance template:
compute.instanceTemplates.createon the project. - To create a regional MIG:
compute.regionInstanceGroupManagers.createon the project. - To create a zonal MIG:
compute.instanceGroupManagers.createon the project.
To create a MIG from an existing VM, follow these steps:
In the Google Cloud console, go to theVM instances page.
Select the VM that you want to use to create the MIG.
ClickCreate a group based on this VM.
TheScale to instance group page opens.
In theInstance template properties section, do the following:
In theName field, use the default name or enter a name for theinstance template.
In theDisks section, do the following:
Boot disk: By default, Compute Engine generates a newcustom image of the VM boot disk. If you want to use an existingdisk instead, clickEdit boot disk. You can select a public image or an existingcustom image to attach to the VMs in the MIG.
Existing disk: Applicable only if your VM has a read-only disk.Optionally, you can do one of the following:
To customize any attachment settings of the read-only disk,clickEdit disk.
To remove the disk, clickRemove disk.
New disk: Applicable only if your VM has a read-write disk. Bydefault, Compute Engine creates a new custom disk image.Optionally, you can do one of the following:
To use an existing disk or modify the disk settings, clickEdit disk.
To remove the disk, clickRemove disk.
If the existing VM is running or suspended, and you have specified toattach new boot or non-boot disks that use the VM's disk images assources, theOn image generation section appears. Then, you mustselect one of following options:
If you want to maintain the file system's integrity while generatingan image from the VM disk, stop the VM by selectingStop the VM.You can restart the VM after the MIG is created. Until then, yourservice is interrupted.
If you do not want interruption to your service and the filesystem's integrity is not a concern, selectKeep the VM running.
To further customize the instance template used to define the propertiesof the VMs in the MIG, clickCustomize instance template and modify the fields as needed. Formore information, seeCreate instance templates.
In theInstance group properties section, do the following:
In theName field, use the default name or enter a name for the MIG.
In theLocation section, you can choose to create a regional orzonal MIG by doing one of the following:
To create a regional MIG, follow these steps:
SelectMultiple zones.
In theRegion list, select a region where to create the VMsin the MIG.
In theZones list, select the zones where to create the VMsin the MIG.
To create a zonal MIG, follow these steps:
SelectSingle zone (default).
In theRegion list, select a region where to create the VMsin the MIG. By default, the region where the original VM existsis selected.
In theZone list, select a zone where to create the VMs forthe MIG. By default, the zone where the original VM exists isselected.
To further specify the MIG settings—for example, to specify thenumber of VMs—clickConfigure instance group. For more information, see how to create aregionalorzonal MIG.
After you've finished customizing the instance template and the MIG, clickCreate group. If your VM is running and you specified to stop the VM inthe previous steps, clickStop VM and create group.
TheInstance groups page opens. Creating the instance template and theMIG might take a few minutes to complete.
What's next
Learn how toupdate VM configurations in a MIG.
Learn how toautoscale groups of VMs.
Learn more aboutdifferent configuration options available in a MIG.
Learn more aboutbuilding scalable and resilient web applications.
Learn more aboutdisaster recovery on Google Cloud.
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 2025-12-15 UTC.