INSTANCE_GROUP_NAME: 인스턴스 유연성 구성을 확인하려는 MIG의 이름입니다.
REGION: MIG가 있는 리전입니다.
REST
인스턴스 유연성 구성을 보려면 regionInstanceGroupManagers.get 메서드를 사용합니다.
요청 URL에 fields 매개변수를 포함하여 instanceFlexibilityPolicy.instanceSelections 속성을 필터링합니다.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceGroupManagers/INSTANCE_GROUP_NAME?fields=instanceFlexibilityPolicy.instanceSelections
MIG의 각 VM에서 사용하는 머신 유형을 보려면 instance-groups managed list-instances 명령어를 사용하여 VM을 나열하고 --format 플래그를 포함하여 propertiesFromFlexibilityPolicy.machineType 필드를 필터링합니다. 필요에 따라 다른 필드를 필터링할 수도 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-22(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)."]]