View instance flexibility


This document describes how to view the instance flexibility configuration in amanaged instance group (MIG) and the machine types used by each VM in the group.

After you add or make changes to instance flexibility in a MIG, you can do thefollowing:

Before you begin

View the instance flexibility configuration

Console

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

    Go to Instance groups

  2. In theName column, click the name of the MIG of which you want toview the instance flexibility configuration.

    The overview page of the MIG opens.

  3. Click theDetails tab.

    In theInstance flexibility section, theInstance selectionstable shows the instance selection name, rank, and the machine types ina selection. If the MIG doesn't have instance flexibility configured, theInstance flexibility section is not shown.

gcloud

To view the instance flexibility configuration, use theinstance-groups managed describe command.Include the--format flag to filter theinstanceFlexibilityPolicy.instanceSelections properties.

  gcloud compute instance-groups managed describeINSTANCE_GROUP_NAME \      --regionREGION \      --format="json(instanceFlexibilityPolicy.instanceSelections)"

The following is a sample output:

{  "instanceFlexibilityPolicy": {    "instanceSelections": {      "instance-selection-1": {        "machineTypes": [          "n1-standard-16",          "n2-standard-16",          "e2-standard-16"        ],        "rank": 1      }    }  }}

If a MIG doesn't have instance flexibility configured, the output returnsnull.

Replace the following:

  • INSTANCE_GROUP_NAME: the name of the MIG of whichyou want to view the instance flexibility configuration.
  • REGION: the region where the MIG is located.

REST

To view the instance flexibility configuration, use theregionInstanceGroupManagers.get method.Include thefields parameter in the request URL to filter theinstanceFlexibilityPolicy.instanceSelections properties.

  GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceGroupManagers/INSTANCE_GROUP_NAME?fields=instanceFlexibilityPolicy.instanceSelections

The following is a sample output:

{  "instanceFlexibilityPolicy": {    "instanceSelections": {      "instance-selection-1": {        "machineTypes": [          "n1-standard-16",          "n2-standard-16",          "e2-standard-16"        ],        "rank": 1      }    }  }}

If a MIG doesn't have instance flexibility configured, the output returnsnull.

Replace the following:

  • PROJECT_ID: yourproject ID.
  • REGION: the region where the MIG is located.
  • INSTANCE_GROUP_NAME: the name of the MIG of whichyou want to view the instance flexibility configuration.

View the machine types used by each VM

Console

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

    Go to Instance groups

  2. In theName column, click the name of the MIG in which you want viewthe machine types used by each VM.

    TheOverview page of the MIG opens, which lists all VMs in the group,their machine types, and other details.

gcloud

To view the machine types used by each VM in a MIG, list the VMs using theinstance-groups managed list-instances command and include the--format flag to filter thepropertiesFromFlexibilityPolicy.machineType field. You can also filterother fields as needed.

  gcloud compute instance-groups managed list-instancesINSTANCE_GROUP_NAME \      --regionREGION \      --format='(name,instanceStatus,currentAction,propertiesFromFlexibilityPolicy.machineType,lastAttempt.errors.errors)'

The following is a sample output:

NAME: example-mig-0md2STATUS: RUNNINGACTION: NONEMACHINE_TYPE: n1-standard-16LAST_ERROR:NAME: example-mig-vbggSTATUS: RUNNINGACTION: NONEMACHINE_TYPE: n1-standard-16LAST_ERROR:

Replace the following:

  • REGION: the region where the MIG is located.
  • INSTANCE_GROUP_NAME: the name of the MIG of whichyou want to view the instance flexibility configuration.

REST

To view the machine types used by each VM in a MIG, list the VMs using thelistManagedInstances methodand check thepropertiesFromFlexibilityPolicy.machineType field in theresponse.

  POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceGroupManagers/INSTANCE_GROUP_NAME/listManagedInstances

The following is a sample output; look for thepropertiesFromFlexibilityPolicy field in which themachineType field ofa VM is set.

{  "managedInstances": [    {      "instance": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-b/instances/example-mig-0md2",      "instanceStatus": "RUNNING",      "id": "2656095434923471959",      "version": {        "instanceTemplate": "https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-instance-template"      },      "targetStatus": "RUNNING",      "name": "example-mig-0md2",      "propertiesFromFlexibilityPolicy": {        "machineType": "n1-standard-16"      }    },    {      "instance": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-b/instances/example-mig-vbgg",      "instanceStatus": "RUNNING",      "currentAction": "NONE",      "id": "9171259522409694366",      "version": {        "instanceTemplate": "https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-instance-template"      },      "targetStatus": "RUNNING",      "name": "example-mig-vbgg",      "propertiesFromFlexibilityPolicy": {        "machineType": "n1-standard-16"      }    }  ]}

Replace the following:

  • PROJECT_ID: yourproject ID.
  • REGION: the region where the MIG is located.
  • INSTANCE_GROUP_NAME: the name of the MIG of whichyou want to view the instance flexibility configuration.

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-07-09 UTC.