Basic scenarios for creating managed instance groups (MIGs)

Amanaged instance group (MIG)is a group of virtual machine (VM) instances that you treat as a single entity.Each VM in a MIG is based on aninstance template.

If you only need to create multiple VMs, but don't want them grouped together ina MIG, see thebulk instance API.

To learn about other Compute Engine options, seeChoose a Compute Engine deployment strategy for your workload.

To get started with creating a MIG, read this document to find a basicconfiguration that works for you.

Basic scenarios for creating a MIG

MIGs have many configuration options. See the following guides to quickly get aMIG up and running for various scenarios:

GuideScenario
Create a MIG with VMs in a single zone (zonal MIG)Your VMs can be deployed to a single zone.
Create a MIG with VMs in multiple zones in a region (regional MIG)You want to distribute your VMs across multiple zones in a region in order to protect against zonal failure or to automatically find zones with limited resource likeSpot VMs.
Create a MIG with multiple machine types (instance flexibility)Your application is compatible with multiple machine types. You want the MIG to automatically use one of the compatible machine types based on real-time availability.
Create a MIG from an existing VMYou want to scale out a VM into a group of VMs and deploy them in a single zone or across multiple zones.
Create a MIG with autoscalingYou want your MIG to automatically create VMs in the group when demand increases and delete VMs when demand drops.
Create a MIG that uses preemptible VMsYour workload can tolerate disruptions and you want to take advantage of the cost-savings associated with preemptible VMs.
Create a MIG with GPU VMsYour workload needs a group of GPU VMs all at once—for example, you want to run batch workloads, such as training machine learning models or high performance computing workloads, on GPU VMs.
Create a MIG with stateful configurationYour workload needs stateful configuration—for example, you need disks that must retain their data whenever VMs are autohealed, updated, or recreated.
Note: By default, Compute Engine creates–and when necessaryrecreates–each VM in a MIG based on the configuration that you set in the MIG'sinstance template. The default behavior for all persistent disks in a MIG is todelete or recreate them when the corresponding VM is deleted or recreated, soyou shouldn't rely on attached disks as persistent data. To retain your data ina MIG, you can back up the data in another centralized location, such asCloud Storage, or add configuration for stateful disks.

Limitations

MIGs have different limitations depending on which features you use. Thefollowing lists show general MIG limitations as well as additional limitationsif you use regional or stateful features.

A MIG that is spread across multiple zones—aregional MIG—has the followinglimitations:

A MIG withstateful configuration—astateful MIG—has the following limitations:

  • You cannot use autoscaling if your MIG has stateful configuration.
  • If you want to use automated rolling updates, you must set thereplacement methodtoRECREATE.
  • For stateful regional MIGs, you mustdisable proactive redistribution (set the redistribution type toNONE) to prevent deletion of statefulinstances by automatic cross-zone redistribution.
  • If you use anall-instances configurationto override instance template properties, you cannot specify those propertiesin any per-instance configuration and at the same time in the group'sall-instances configuration.

If you want to configure an autoscaler for your MIG, review theautoscaler specifications, too.

IPv6 support

If you want your MIG to include VM instances that use IPv6addressing, you must use either the IPv6-only or the dual-stack settingwhen you create your instance template

Including instances with IPv6 addresses in a MIG has the following limitations:

For more information, seeCreate an instance template with IPv6 addresses.

Additional MIG tasks

After you've created a MIG, you might want to do the following:

Learn about the group and its VMs

Resize the group

Change the group's VM configuration

Add MIG features

Tutorials

Try a tutorial:

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.