View info about MIGs and managed instances

Use the methods on this page to view information about yourmanaged instance groups (MIGs) and to view information about the virtual machine (VM) instances withineach MIG.

Note: Various policies and actions can create, delete, and modify instances thatare managed by a MIG. Those operations are returned asDONE after the grouphas scheduled actions to create, delete, or update those instances. However,this doesn't mean that the instances in the group have been created,deleted, or updated until those underlying actions are complete. You mustverify the status of the group, or alternativelyverify the status of those instances.

Before you begin

View info about MIGs

You can retrieve information about groups themselves, for example, to inspectthe policies that are attached to the group and to check if the group isstable or undergoing changes. To get info about the VM instances within a MIG,seeView info about managed instances.

List MIGs

To get a list of your managed instance groups, use theconsole, thegcloud CLI,orREST.

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups.

    If you have existing instance groups, the page lists those groups,including both managed instance groups andunmanaged instance groups.

    TheGroup type column specifies whether the group is managed,stateful, or unmanaged. The stateful group types are also managedinstance groups.

gcloud

List all managed instance groups within a project:

gcloud compute instance-groups managed list

REST

For zonal MIGs, call theinstanceGroupManagers.list methodmethod:

GET https://compute.googleapis.com/compute/v1/projects/project-id/zones/zone/instanceGroupManagers

For regional MIGs, call theregionInstanceGroupManagers.list method.

GET https://compute.googleapis.com/compute/v1/projects/project-id/regions/region/instanceGroupManagers

View a MIG's properties

To view information about a specific MIG, including its policies (forexample, the group's autohealing and update policies), use theconsole, thegcloud CLI,orREST.

To view the group'sid value, you must use the gcloud CLI or theCompute Engine API.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.get on the instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups.

    If you have existing instance groups, the page lists those groups. Thepage also listsunmanaged instance groups.

  2. Under theName column of the list, click the name of the instancegroup that you want to examine. A page opens with the instance groupproperties and a list of instances that are included in the group.

  3. ClickDetails to see the group's configuration.

gcloud

To get information about a specific group:

gcloud compute instance-groups managed describeinstance-group \    [--zonezone | --regionregion]

The command returns details about the group, including attached policies.

Use the--format flag to limit the output. For example, the followingcommand only returns the group's autoscaler configuration if it exists.

gcloud compute instance-groups managed describeinstance-group --format="(autoscaler)"

REST

For zonal MIG, call theinstanceGroupManagers.get method.For regional MIGs, call theregionInstanceGroupManagers.get method.

GET https://compute.googleapis.com/compute/v1/projects/project-id/regions/region/instanceGroupManagers/instance-group

The response includes details about the group, including attached policiesexcept for the group's autoscaling policy. Although autoscaling is afeature of MIGs, it is a separate REST resource.

Autoscaling policy

If an autoscaler is attached to the group, the autoscaler resource is listedin the group'sstatus.autoscaler field.

To get information about that autoscaler, call theautoscalers.get methodfor a zonal MIG or theregionAutoscalers.get methodfor a regional MIG. The URL of the autoscaler resource includes its name,which, by default, is the name of the group that the autoscaler is attachedto. For example, you might make the following request for a regional MIG'sautoscaler:

GET https://compute.googleapis.com/compute/v1/projects/project-id/regions/region/regionAutoscalers/mig_name

Check whether a MIG is stable

Several commands and requests create, delete, and modify instances in a managedinstance group. Those operations are returned asDONE after the group hasscheduled actions to create, delete, or update those instances. However, thisdoesn't mean that instances in the group have been created, deleted, orupdated until those underlying actions are complete. You mustverify the status of the group, or alternativelyverify the status of those instances.

A managed instance group is stable when all instances in the managed instancegroup are not undergoing any change, no future changes are scheduled for theinstances, and the group itself is not being modified.

You might need to know whether the group is stable when you have dependenciesthat rely on all instances in the group being healthy and serving. For example,you might want to start scheduling jobs, sending traffic, or assigning keyranges after you have confirmation that all the VMs are running and healthy.

Verify that all instances in a managed instance group are running and healthy bychecking the value of the group'sstatus.isStable field.

gcloud

Use thedescribe command:

gcloud compute instance-groups managed describeinstance-group-name \    [--zonezone | --regionregion]

The gcloud CLI returns detailed information about the MIGincluding itsstatus.isStable field.

To pause a script until the MIG is stable, use thewait-untilcommand with the--stable flag. For example:

gcloud compute instance-groups managed wait-untilinstance-group-name \    --stable \    [--zonezone | --regionregion]Waiting for group to become stable, current operations: deleting: 4Waiting for group to become stable, current operations: deleting: 4...Group is stable

The command returns afterstatus.isStable is set totrue for the MIG.

REST

For a zonal MIG, make aGET request to theinstanceGroupManagers.getmethod:

GET https://compute.googleapis.com/compute/v1/projects/project-id/zones/zone/instanceGroupManagers/instance-group-name/get

For a regional managed instance group, replacezones/zone withregions/region:

GET https://compute.googleapis.com/compute/v1/projects/project-id/regions/region/instanceGroupManagers/instance-group-name/get

These requests returns detailed information about the MIG including itsstatus.isStable field.

status.isStable set tofalse indicates that changes are active, pending, orthat the MIG itself is being modified.

status.isStable set totrue indicates the following:

  • None of the instances in the MIG are undergoing any type of change and thecurrentAction for all instances isNONE.
  • No changes are pending for instances in the MIG.
  • The MIG itself is not being modified.

Remember that the stability of a MIG depends on numerous factors because a MIGcan be modified in numerous ways. For example:

  • You make a request to roll out a new instance template.
  • You make a request to create, delete, resize or update instances in the MIG.
  • Anautoscaler requests to resize theMIG.
  • Anautohealerresource is replacing one or more unhealthy instances in the MIG.
  • In a regional MIG, some of the instances are beingredistributed.

As soon as all actions are finished,status.isStable is set totrue againfor that MIG.

For individual VM instances, seeChecking the status of managed instances.

Check the repair configuration in a MIG

To check the repair configuration in a MIG, select one of the following options:

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.get on the instance group
  • compute.instanceGroupManagers.list on the instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Click the name of the instance group that you want to view. A page openswith the instance group properties and a list of VM instances that arein the group.
  3. Click theDetails tab.
  4. In theVM instance lifecycle section, check the values of thefollowing fields:

    • Default action on failure: If the value isNo action, thenautomatic repairs of failed VMs are off.

    • On failed health check:

      • If the value isNo action, then autohealing is off.
      • If the value isDefault action and the value ofDefault action on failure field isNo action, then alsoautohealing is off.
    • Change zone during VM instance repair: If this option is selectedand when the MIG can't repair a VM in the original zone, then the MIGrepairs that VM in one of the other MIG's selected zones.

gcloud

Use thebetadescribe methodas follows:

gcloud beta compute instance-groups managed describeinstance-group \    --format="(instanceLifecyclePolicy)" \    --zone=zone

Replace the following:

  • instance-group: The name of the MIG.
  • zone: For a zonal MIG, specify the zone. For aregional MIG, use the--region=region flag.

In the output, check the following values:

  • defaultActionOnFailure: If the value isDO_NOTHING, then automaticrepairs of failed VMs are off.
  • onFailedHealthCheck: If the value is any of the following, thenautohealing is off.
    • DEFAULT_ACTION, provided the value ofdefaultActionOnFailure fieldisDO_NOTHING
    • DO_NOTHING
  • allowChangingZone: If the value isYES and when the MIG can't repair aVM in the original zone, then the MIG repairs that VM in one of theother MIG's selected zones.

The following is a sample output when repairs of failed and unhealthy VMsare turned off in a MIG:

  instanceLifecyclePolicy:    defaultActionOnFailure: DO_NOTHING    forceUpdateOnRepair: NO    onFailedHealthCheck: DEFAULT_ACTION    onRepair:      allowChangingZone: YES

REST

For a zonal MIG, use thebetainstanceGroupManagers.get method,or, for a regional MIG, use thebetaregionInstanceGroupManagers.get method.

To view the MIG action on VM failures in a zonal MIG, make the following call:

GET https://compute.googleapis.com/compute/beta/projects/project_ID/zones/zone/instanceGroupManagers/instance_group

In the response body, check the values of the following fields:

  • defaultActionOnFailure: If the value isDO_NOTHING, then automaticrepairs of failed VMs are off.
  • onFailedHealthCheck: If the value is any of the following, thenautohealing is off.
    • DEFAULT_ACTION, provided the value ofdefaultActionOnFailure fieldisDO_NOTHING
    • DO_NOTHING
  • allowChangingZone: If the value isYES and when the MIG can't repair aVM in the original zone, then the MIG repairs that VM in one of theother MIG's selected zones.

The following is a sample output when repairs of failed and unhealthy VMsare turned off in a MIG:

..."instanceLifecyclePolicy": {  "forceUpdateOnRepair": "NO",  "defaultActionOnFailure": "DO_NOTHING",  "onFailedHealthCheck": "DEFAULT_ACTION",  "onRepair": {    "allowChangingZone": "YES"  }}...

If the repairs are turned off and you want to turn them back on again, seeTurn on repairs or autohealing.

View historical autohealing operations

If you configured autohealing, then you canview past autohealing events.

Monitor rolling updates

If you initiated a rolling update, and want to know when the update is complete,then seeMonitoring updates.

View stateful configuration

If you configured astateful MIGand want to review your configuration, then seeViewing stateful configuration.

View details about the managed VM instances within a MIG

This section explains how to view various details about managed instances in aMIG.

List a MIG's managed instances

To view a list of the managed instances in a group, including their states andtemplates, use theconsole, thegcloud CLI,orREST.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.get on the instance group
  • compute.instanceGroupManagers.list on the instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups.

    If you have existing instance groups, the page lists those groups. Thepage also listsunmanaged instance groups.

  2. Under theName column of the list, click the name of the instancegroup that you want to examine. A page opens with the instance groupproperties and a list of instances that are included in the group.

gcloud

Use the gcloud CLIlist-instances sub-command.

gcloud compute instance-groups managed list-instancesinstance-group \    [--zonezone | --regionregion]

The command returns a list of instances and their details, including theircurrentstatus, instance template, and last error.

REST

For a zonal MIG, construct aGET request to theinstanceGroupManagers.listManagedInstances method and include the name of a specificmanaged instance group:

GET https://compute.googleapis.com/compute/v1/projects/project-id/zones/zone/instanceGroupManagers/instance-group

For regional (multiple-zone) managed instance groups, use theregionInstanceGroupManagers resource instead:regionInstanceGroupManagers.list.

GET https://compute.googleapis.com/compute/v1/projects/project-id/regions/region/instanceGroupManagers/instance-group

The response includes a list of instances and their details, including theircurrent status and instance template.

Check the status of managed instances

Several commands and requests create, delete, and modify instances in a managedinstance group. Those operations are returned asDONE after the group hasscheduled actions to create, delete, or update those instances. However, thisdoesn't mean that instances in the group have been created, deleted, orupdated until those underlying actions are complete. You must verify the statusof those instances, or alternatively verify thestatus of the group itself.

Use the Google Cloud CLI or REST to see details about the instancesin a managed instance group. Details include instance status and current actionsthat the group is performing on its instances.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.get on the group
  • compute.instanceGroupManagers.list on the group

gcloud

All managed instances

To check the status and current actions on all instances in the group, usethelist-instances command.

gcloud compute instance-groups managed list-instancesINSTANCE_GROUP_NAME \    [--zone=ZONE | --region=REGION]

The command returns a list of instances in the group, including theirstatus, current actions, and other details:

NAME: vm-instances-9pk4ZONE: us-central1-fSTATUS:HEALTH_STATE:ACTION: CREATINGINSTANCE_TEMPLATE: my-new-templateVERSION_NAME:LAST_ERROR:NAME: vm-instances-h2r1ZONE: us-central1-fSTATUS: STOPPINGHEALTH_STATE:ACTION: DELETINGINSTANCE_TEMPLATE: my-old-templateVERSION_NAME:LAST_ERROR:

TheHEALTH_STATE column appears empty unless you haveset up health checking.

A specific managed instance

To check the status and current action for a specific instance in the group,use thedescribe-instance command.

gcloud compute instance-groups managed describe-instanceINSTANCE_GROUP_NAME \    --instanceINSTANCE_NAME \    [--zone=ZONE | --region=REGION]

The command returns details about the instance, including instance status,current action, and, for stateful MIGs, preserved state:

currentAction: NONEid: '6789072894767812345'instance: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/instances/example-mig-hz41instanceStatus: RUNNINGname: example-mig-hz41preservedStateFromConfig:  metadata:    example-key: example-valuepreservedStateFromPolicy:  disks:    persistent-disk-0:      autoDelete: NEVER      mode: READ_WRITE      source: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/disks/example-mig-hz41version:  instanceTemplate: https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-template

REST

Call thelistManagedInstances method on aregionalorzonalMIG resource. For example, to see details about the instances in a zonal MIGresource, you can make the following request:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/INSTANCE_GROUP_NAME/listManagedInstances

The call returns a list of instances for the MIG including each instance'sinstanceStatus andcurrentAction.

{  "managedInstances": [    {      "instance": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-f/instances/vm-instances-prvp",      "instanceStatus": "RUNNING",      "currentAction": "REFRESHING",      "id": "5317605642920955957",      "version": {        instanceTemplate": "https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-template"      },      "name": "vm-instances-prvp"    },    {      "instance": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-f/instances/vm-instances-w2t5",      "instanceStatus": "RUNNING",      "currentAction": "REFRESHING",      "id": "2800161036826218547",      "version": {        "instanceTemplate": "https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-template"      },      "name": "vm-instances-w2t5"    }  ]}

If youset up health checking,then the response also includes theinstanceHealth field.

To see a list of validinstanceStatus field values, seeVM instance lifecycle.

If an instance is undergoing some type of change, the managed instance groupsets the instance'scurrentAction field to one of the following actions tohelp you track the progress of the change. Otherwise, thecurrentAction fieldis set toNONE.

PossiblecurrentAction values are:

  • ABANDONING. The instance is being removed from the MIG.
  • CREATING. The instance is in the process of being created.
  • CREATING_WITHOUT_RETRIES. The instance is being created without retries; ifthe instance isn't created on the first try, the MIG doesn't try to replacethe instance again.
  • DELETING. The instance is in the process of being deleted.
  • RECREATING. The instance is being replaced.
  • REFRESHING. The instance is being removed from its current target pools andbeing readded to the list of current target pools (this list might be thesame or different from existing target pools).
  • RESTARTING. The instance is in the process of being restarted using thestop andstart methods.
  • RESUMING. The instance is in the process of being resumed after beingsuspended.
  • STARTING. The instance is in the process of being started after beingstopped.
  • STOPPING. The instance is being stopped.
  • SUSPENDING. The instance is being suspended.
  • VERIFYING. The instance has been created and is in the process of beingverified.
  • NONE. No actions are being performed on the instance.

To check if the group as a whole is stable or is undergoing changes, seeChecking the status of the group.

Check health states

If you have configured autohealing for your managed instance group, you canreview the health state of each VM. SeeChecking health status.

List instance errors

If your managed instances encountered errors, you can view those errorsto diagnose and mitigate the cause.

Use the Google Cloud console, the gcloud CLI, or REST tolist errors.

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Under theName column of the list, click the name of the instancegroup that you want to examine. A page opens with the instance groupproperties and a list of instances that are included in the group.

  3. ClickErrors.

gcloud

Use theinstance-groups managed list-errors commandto list the most recent errors in the group

gcloud compute instance-groups managed list-errorsinstance-group-name \    [--zonezone | --regionregion]

For example:

gcloud compute instance-groups managed list-errors example-group \    --region us-west1
INSTANCE_URL                                                                                        ACTION    ERROR_CODE      ERROR_MESSAGE                                                                                     TIMESTAMP                      INSTANCE_TEMPLATE                                                                                                            VERSION_NAMEhttps://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/igm-1-v0hl  CREATING  QUOTA_EXCEEDED  Instance 'igm-1-v0hl' creation failed: Quota 'CPUS' exceeded.  Limit: 1.0 in zone us-central1-a.  2019-07-11T07:44:40.156-07:00  https://www.googleapis.com/compute/v1/projects/my-project/global/instanceTemplates/instance-template-1https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/igm-1-qp3d  CREATING  QUOTA_EXCEEDED  Instance 'igm-1-qp3d' creation failed: Quota 'CPUS' exceeded.  Limit: 1.0 in zone us-central1-a.  2019-07-11T07:44:40.081-07:00  https://www.googleapis.com/compute/v1/projects/my-project/global/instanceTemplates/instance-template-1...

REST

Construct aGET request to thelistErrors method for azonalorregional managed instance group.

For example:

GET https://compute.googleapis.com/compute/v1/projects/project-id/zones/zone/instanceGroupManagers/instance-group-name/listErrors&maxResults=100

The request gets a response similar to:

{ "items": [  {   "error": {    "code": "QUOTA_EXCEEDED",    "message": "Instance 'example-mig-m1sz' creation failed: Quota 'CPUS' exceeded.  Limit: 50.0 in zone us-central1-c."   },   "timestamp": "2019-01-03T18:47:28.457-08:00",   "instanceDetails" : {    "instance": "zones/us-central1-c/instances/example-mig-m1sz",    "action": "CREATING",    "version": {     "name": "example-version-name",     "instanceTemplate": "global/instanceTemplates/example-template",    }   }  } ], ... "nextPageToken": "Ch0yMDE5LTA3LTI5VDExOjA4OjA2LjYxMi0wNzowMBJ5aHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vY29tcHV0ZS9zdGFnaW5nX2FscGhhL3Byb2plY3RzL215cnpha2VyZXltcy1zdGFnaW5nL3pvbmVzL3VzLWNlbnRyYWwxLWlyMS9pbnN0YW5jZXMvaWdtLTEtcXAzZA=="}

ThelistErrors API supportslist pagination.To get the next page of results, use thenextPageToken field from oneresponse in a subsequent request. For example:GET https://compute.googleapis.com/compute/v1/projects/project-id/zones/zone/instanceGroupManagers/instance-group-name/listErrors&maxResults=100&nextPageToken=next-page-token,replacingnext-page-token with the token that wasobtained from the previous response.

The list of possible errors includes, but is not limited to, the followingexamples:

  • A new instance cannot be created due to:
    • Unavailability of preemptible capacity.
    • Lack of quota, for example, for CPUs in a given region.
    • The limit on the number of VM instances was reached for the networkassociated with the group.
    • The disk image specified in the instance template'sproperties.disks[].initializeParams.sourceImage field was deleted, or itspermissions have changed.
    • The credit card on the billing account associated with the project refused apayment.
  • An existing instance cannot be deleted because:
    • The service account that group uses doesn't havecompute.instances.deletepermission.
    • Too many concurrent deletions were requested, exceeding rate limits.
  • An instance cannot be added to a target pool because the target pool wasdeleted.

After inspecting such errors, you can mitigate them. For example:

  • Move your workload to a different zone that has preemptible capacity.
  • Request a quota increase in a given region.
  • Add thecompute.instances.delete permission to the service account used bythe group.

If an action that is triggered by a managed instance group fails (for example,if an autoscaler encounters an error when attempting to increase the group'ssize), the group might immediately retry that action. If the last immediateretry attempt fails, the MIG records the error, and you can view the errorbylisting instance errors. After some backoff time,the group again retries the failed action. If the error persists, it might berecorded multiple times.

Compute Engine retains the most recent 500 errors for the last 8 days evenif the underlying instances no longer exist or couldn't be created.

Check if a VM instance is part of a MIG

To check if a specific VM is a member of a group, you can usethe console or REST.

Console

  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. Click an instance to access itsVM instance details.
  3. If the VM instance is a member of a managed instance group, the name ofthat managed instance group appears under the headingIn use by.If the VM instance is not a member of a group, the headingIn use bydoesn't appear on the instance details page.

REST

SeeViewing referrers to VM instances.

Alternatively, to identify whether a VM is or was a member of a managedinstance group, look for these two metadata keys in the instance's metadata:

  • instance-template indicates the template the VM was createdfrom.
  • created-by indicates the managed instance group that created the VM.

Even if youabandonthe instance, the VM will still have these metadataentries, unless you manually remove them.

For example, if there was an VM namedrandom-instance-biy and you wantedto know whether the VM was created by a managed instance group, you candescribe the instance and look for the metadata keys. For example:

gcloud compute instances describe random-instance-biy \    --zone us-central1-f

gcloud CLI returns a response similar to:

canIpForward: falsecpuPlatform: Intel Ivy BridgecreationTimestamp: '2016-08-24T14:11:38.012-07:00'...metadata:  items:  - key: instance-template    value: projects/123456789012/global/instanceTemplates/example-it  - key: created-by    value: projects/123456789012/zones/us-central1-f/instanceGroupManagers/igm-metadata

View the preserved state of a managed instance

If you configured astateful MIGand want to view thepreserved stateof each managed instance, seeViewing stateful configuration and preserved state.

What's next

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.