View instance flexibility
This document describes how to view the instance flexibility configuration in a
managed 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 the
following:
Before you begin
View the instance flexibility configuration
Console
In the Trusted Cloud console, go to the Instance groups page.
Go to Instance groups
In the Name column, click the name of the MIG of which you want to
view the instance flexibility configuration.
The overview page of the MIG opens.
Click the Details tab.
In the Instance flexibility section, the Instance selections
table shows the instance selection name, rank, and the machine types in
a selection. If the MIG doesn't have instance flexibility configured, the
Instance flexibility section is not shown.
gcloud
To view the instance flexibility configuration, use the
instance-groups managed describe
command.
Include the --format
flag to filter the
instanceFlexibilityPolicy.instanceSelections
properties.
gcloud compute instance-groups managed describe INSTANCE_GROUP_NAME \
--region REGION \
--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 returns
null
.
Replace the following:
INSTANCE_GROUP_NAME
: the name of the MIG of which
you want to view the instance flexibility configuration.
REGION
: the region where the MIG is located.
REST
To view the instance flexibility configuration, use the
regionInstanceGroupManagers.get
method.
Include the fields
parameter in the request URL to filter the
instanceFlexibilityPolicy.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 returns
null
.
Replace the following:
PROJECT_ID
: your
project ID.
REGION
: the region where the MIG is located.
INSTANCE_GROUP_NAME
: the name of the MIG of which
you want to view the instance flexibility configuration.
View the machine types used by each VM
Console
In the Trusted Cloud console, go to the Instance groups page.
Go to Instance groups
In the Name column, click the name of the MIG in which you want view
the machine types used by each VM.
The Overview 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 the
instance-groups managed list-instances
command and include the --format
flag to filter the
propertiesFromFlexibilityPolicy.machineType
field. You can also filter
other fields as needed.
gcloud compute instance-groups managed list-instances INSTANCE_GROUP_NAME \
--region REGION \
--format='(name,instanceStatus,currentAction,propertiesFromFlexibilityPolicy.machineType,lastAttempt.errors.errors)'
The following is a sample output:
NAME: example-mig-0md2
STATUS: RUNNING
ACTION: NONE
MACHINE_TYPE: n1-standard-16
LAST_ERROR:
NAME: example-mig-vbgg
STATUS: RUNNING
ACTION: NONE
MACHINE_TYPE: n1-standard-16
LAST_ERROR:
Replace the following:
REGION
: the region where the MIG is located.
INSTANCE_GROUP_NAME
: the name of the MIG of which
you want to view the instance flexibility configuration.
REST
To view the machine types used by each VM in a MIG, list the VMs using the
listManagedInstances
method
and check the propertiesFromFlexibilityPolicy.machineType
field in the
response.
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 the
propertiesFromFlexibilityPolicy
field in which the machineType
field of
a 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
: your project ID.
REGION
: the region where the MIG is located.
INSTANCE_GROUP_NAME
: the name of the MIG of which
you want to view the instance flexibility configuration.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThis document provides instructions on how to view the instance flexibility configuration of a managed instance group (MIG).\u003c/p\u003e\n"],["\u003cp\u003eYou can verify if instance flexibility has been applied to a MIG or if it already has it configured.\u003c/p\u003e\n"],["\u003cp\u003eThe content explains how to check the machine types used by each virtual machine (VM) within a MIG, ensuring desired machine types are not in use, or to review all the used ones.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are available for using the Google Cloud Console, gcloud command-line tool, and REST API to access this information.\u003c/p\u003e\n"]]],[],null,["# View instance flexibility\n\n*** ** * ** ***\n\nThis document describes how to view the instance flexibility configuration in a\nmanaged instance group (MIG) and the machine types used by each VM in the group.\n\nAfter you add or make changes to instance flexibility in a MIG, you can do the\nfollowing:\n\n- [View the instance flexibility configuration](#view_the_instance_flexibility_configuration)\n to verify if a configuration has been applied or to check if a MIG already has\n instance flexibility.\n\n- [View the machine types used by each VM](#view_the_machine_types_used_by_each_vm)\n to make sure that the machine type that you want to remove from an instance\n selection is not used by any VM or to check the different machine types used\n in the MIG.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nView the instance flexibility configuration\n-------------------------------------------\n\n### Console\n\n1. In the Google Cloud console, go to the **Instance groups** page.\n\n [Go to Instance groups](https://console.cloud.google.com/compute/instanceGroups)\n\n \u003cbr /\u003e\n\n2. In the **Name** column, click the name of the MIG of which you want to\n view the instance flexibility configuration.\n\n The overview page of the MIG opens.\n3. Click the **Details** tab.\n\n In the **Instance flexibility** section, the **Instance selections**\n table shows the instance selection name, rank, and the machine types in\n a selection. If the MIG doesn't have instance flexibility configured, the\n **Instance flexibility** section is not shown.\n\n### gcloud\n\nTo view the instance flexibility configuration, use the\n[`instance-groups managed describe` command](/sdk/gcloud/reference/compute/instance-groups/managed/describe).\nInclude the `--format` flag to filter the\n`instanceFlexibilityPolicy.instanceSelections` properties. \n\n```\n gcloud compute instance-groups managed describe INSTANCE_GROUP_NAME \\\n --region REGION \\\n --format=\"json(instanceFlexibilityPolicy.instanceSelections)\"\n```\n\nThe following is a sample output: \n\n```\n{\n \"instanceFlexibilityPolicy\": {\n \"instanceSelections\": {\n \"instance-selection-1\": {\n \"machineTypes\": [\n \"n1-standard-16\",\n \"n2-standard-16\",\n \"e2-standard-16\"\n ],\n \"rank\": 1\n }\n }\n }\n}\n```\n\nIf a MIG doesn't have instance flexibility configured, the output returns\n`null`.\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_GROUP_NAME\u003c/var\u003e: the name of the MIG of which you want to view the instance flexibility configuration.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the MIG is located.\n\n### REST\n\nTo view the instance flexibility configuration, use the\n[`regionInstanceGroupManagers.get` method](/compute/docs/reference/rest/v1/regionInstanceGroupManagers/get).\nInclude the `fields` parameter in the request URL to filter the\n`instanceFlexibilityPolicy.instanceSelections` properties. \n\n```\n GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceGroupManagers/INSTANCE_GROUP_NAME?fields=instanceFlexibilityPolicy.instanceSelections\n```\n\nThe following is a sample output: \n\n```\n{\n \"instanceFlexibilityPolicy\": {\n \"instanceSelections\": {\n \"instance-selection-1\": {\n \"machineTypes\": [\n \"n1-standard-16\",\n \"n2-standard-16\",\n \"e2-standard-16\"\n ],\n \"rank\": 1\n }\n }\n }\n}\n```\n\nIf a MIG doesn't have instance flexibility configured, the output returns\n`null`.\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the MIG is located.\n- \u003cvar translate=\"no\"\u003eINSTANCE_GROUP_NAME\u003c/var\u003e: the name of the MIG of which you want to view the instance flexibility configuration.\n\nView the machine types used by each VM\n--------------------------------------\n\n### Console\n\n1. In the Google Cloud console, go to the **Instance groups** page.\n\n [Go to Instance groups](https://console.cloud.google.com/compute/instanceGroups)\n\n \u003cbr /\u003e\n\n2. In the **Name** column, click the name of the MIG in which you want view\n the machine types used by each VM.\n\n The **Overview** page of the MIG opens, which lists all VMs in the group,\n their machine types, and other details.\n\n### gcloud\n\nTo view the machine types used by each VM in a MIG, list the VMs using the\n[`instance-groups managed list-instances` command](/sdk/gcloud/reference/compute/instance-groups/managed/list-instances) and include the `--format` flag to filter the\n`propertiesFromFlexibilityPolicy.machineType` field. You can also filter\nother fields as needed. \n\n```\n gcloud compute instance-groups managed list-instances INSTANCE_GROUP_NAME \\\n --region REGION \\\n --format='(name,instanceStatus,currentAction,propertiesFromFlexibilityPolicy.machineType,lastAttempt.errors.errors)'\n```\n\nThe following is a sample output: \n\n```\nNAME: example-mig-0md2\nSTATUS: RUNNING\nACTION: NONE\nMACHINE_TYPE: n1-standard-16\nLAST_ERROR:\n\nNAME: example-mig-vbgg\nSTATUS: RUNNING\nACTION: NONE\nMACHINE_TYPE: n1-standard-16\nLAST_ERROR:\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the MIG is located.\n- \u003cvar translate=\"no\"\u003eINSTANCE_GROUP_NAME\u003c/var\u003e: the name of the MIG of which you want to view the instance flexibility configuration.\n\n### REST\n\nTo view the machine types used by each VM in a MIG, list the VMs using the\n[`listManagedInstances` method](/compute/docs/reference/rest/v1/regionInstanceGroupManagers/listManagedInstances)\nand check the `propertiesFromFlexibilityPolicy.machineType` field in the\nresponse. \n\n```\n POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceGroupManagers/INSTANCE_GROUP_NAME/listManagedInstances\n```\n\nThe following is a sample output; look for the\n`propertiesFromFlexibilityPolicy` field in which the `machineType` field of\na VM is set. \n\n```\n{\n \"managedInstances\": [\n {\n \"instance\": \"https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-b/instances/example-mig-0md2\",\n \"instanceStatus\": \"RUNNING\",\n \"id\": \"2656095434923471959\",\n \"version\": {\n \"instanceTemplate\": \"https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-instance-template\"\n },\n \"targetStatus\": \"RUNNING\",\n \"name\": \"example-mig-0md2\",\n \"propertiesFromFlexibilityPolicy\": {\n \"machineType\": \"n1-standard-16\"\n }\n },\n {\n \"instance\": \"https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-b/instances/example-mig-vbgg\",\n \"instanceStatus\": \"RUNNING\",\n \"currentAction\": \"NONE\",\n \"id\": \"9171259522409694366\",\n \"version\": {\n \"instanceTemplate\": \"https://www.googleapis.com/compute/v1/projects/example-project/global/instanceTemplates/example-instance-template\"\n },\n \"targetStatus\": \"RUNNING\",\n \"name\": \"example-mig-vbgg\",\n \"propertiesFromFlexibilityPolicy\": {\n \"machineType\": \"n1-standard-16\"\n }\n }\n ]\n}\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the MIG is located.\n- \u003cvar translate=\"no\"\u003eINSTANCE_GROUP_NAME\u003c/var\u003e: the name of the MIG of which you want to view the instance flexibility configuration.\n\nWhat's next\n-----------\n\n- [Change or remove instance flexibility configuration](/compute/docs/instance-groups/change-or-remove-instance-flexibility-configuration).\n\n- If your MIG doesn't have instance flexibility, [add instance flexibility](/compute/docs/instance-groups/configure-instance-flexibility)."]]