이 페이지에서는 머신 유형 추천의 구성을 보고 수정하는 방법을 설명합니다. 권장되는 머신 유형을 수정하여 생성된 권장사항에 선호하는 머신 계열만 포함할 수 있습니다.
메모리 권장사항을 생성하는 데 사용되는 측정항목을 변경하여 권장사항의 정확성을 개선할 수도 있습니다. 구성 변경사항은 프로젝트 수준에서 적용됩니다.
머신 유형 추천을 수정하는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 Compute 추천 관리자(roles/recommender.computeAdmin) IAM 역할을 부여해 달라고 요청합니다.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
이 사전 정의된 역할에는 머신 유형 추천을 수정하는 데 필요한 권한이 포함되어 있습니다. 필요한 정확한 권한을 보려면 필수 권한 섹션을 펼치세요.
필수 권한
머신 유형 추천을 수정하려면 다음 권한이 필요합니다.
프로젝트에서 머신 유형 권장사항 구성 보기:
프로젝트에 대한 recommender.computeInstanceMachineTypeRecommenderConfig.get
머신 유형 권장사항 구성 수정:
프로젝트에 대한 recommender.computeInstanceMachineTypeRecommenderConfig.update
[[["이해하기 쉬움","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-30(UTC)"],[[["\u003cp\u003eThis page guides users on how to customize machine type recommendations at the project level, allowing them to control which machine series are suggested and how memory metrics are used in generating these recommendations.\u003c/p\u003e\n"],["\u003cp\u003eTo modify machine type recommendations, users need the "Compute Recommender Admin" IAM role, which grants the necessary permissions to view and update the recommendation configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe configuration of machine type recommendations involves three main steps: retrieving the current configuration in JSON format, editing this configuration to specify preferred machine types and memory metrics, and uploading the updated file.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify their preferences for machine type recommendations, choosing between standard and custom types, or standard types only, and can also define how memory metrics are utilized, even opting to rely solely on the Cloud Monitoring Ops Agent or disabling memory recommendations.\u003c/p\u003e\n"],["\u003cp\u003eAfter uploading a new configuration, it takes approximately 48 hours for the changes to take effect, and during this time, the system will continue to use the previous settings for generating any recommendations.\u003c/p\u003e\n"]]],[],null,["# Configure machine type recommendations\n\n*** ** * ** ***\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to view and modify the configuration of your machine\ntype recommendations. You can modify which machine types are recommended,\nso the generated recommendations only include your preferred machine series.\nYou can also change the metrics used to generate memory recommendations to\nimprove the accuracy of the recommendations. The changes to the configuration\nare applied at the project level.\n\nFor more information about machine type recommendations, see\n[Apply machine type recommendations for VMs](/compute/docs/instances/apply-machine-type-recommendations-for-instances).\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 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### Required roles\n\n\nTo get the permissions that\nyou need to modify machine type recommendations,\n\nask your administrator to grant you the\n\n\n[Compute Recommender Admin](/iam/docs/roles-permissions/recommender#recommender.computeAdmin) (`roles/recommender.computeAdmin`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains\n\nthe permissions required to modify machine type recommendations. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to modify machine type recommendations:\n\n- View the machine type recommendation configuration: `recommender.computeInstanceMachineTypeRecommenderConfig.get` on the project\n- Modify the machine type recommendation configuration: `recommender.computeInstanceMachineTypeRecommenderConfig.update` on the project\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nConfigure your recommendations\n------------------------------\n\nTo configure your machine type recommendations, perform the following steps:\n\n1. [Get the current configuration](#get_current_configuration) to obtain the JSON file of the configuration.\n2. Edit the configuration file in JSON format.\n3. [Upload the new configuration file](#update_configuration) to apply the changes.\n\n### Get the current configuration\n\nYou can obtain the current configuration for machine type recommendations for\nyour project by using the Google Cloud CLI. \n\n### gcloud\n\nTo get the current configuration parameters, use the\n[`gcloud beta recommender recommender-config describe` command](/sdk/gcloud/reference/beta/recommender/recommender-config/describe)\nand use `google.compute.instance.MachineTypeRecommender` as the\nRecommender ID: \n\n```\ngcloud beta recommender recommender-config describe google.compute.instance.MachineTypeRecommender \\\n --project=PROJECT_ID \\\n --location=ZONE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone for which you want to obtain the current configuration.\n\nThe command returns the recommender configuration, including the modifiable\nsubfields `preferred_machine_types` and `memory_metrics`. \n\n```\n{\n \"name\": \"projects/PROJECT_ID/locations/ZONE/recommenders/google.compute.instance.MachineTypeRecommender/config\",\n \"recommenderGenerationConfig\": {\n \"params\": {\n \"preferred_machine_types\": \"STANDARD_AND_CUSTOM\",\n \"memory_metrics\": \"MONITORING_AGENT_ONLY\"\n }\n },\n \"etag\": \"\\\"2f3c9b65cda6a4ba\\\"\",\n \"updateTime\": \"2024-08-20T04:41:15.330351Z\"\n}\n```\n\nIf you want to save the configuration to a local file, so you can edit it\nand upload it later, run the following command: \n\n```\ngcloud beta recommender recommender-config describe \\\n google.compute.instance.MachineTypeRecommender \\\n --project=PROJECT_ID \\\n --location=ZONE \u003e LOCAL_FILE_PATH_AND_NAME\n```\n\n### Edit the recommendation configuration\n\nThe configuration lets you customize the following parameters:\n\n- `preferred_machine_types`: The machine types recommendations that you receive.\n- `memory_metrics`: How memory metrics are used to generate recommendations.\n\n#### Options for machine types recommendations\n\nYou can specify which machine types recommendations you get by changing\nthe `preferred_machine_types` setting to one of the following values:\n\n- `DEFAULT`: The default value is `STANDARD_AND_CUSTOM`.\n- `STANDARD_AND_CUSTOM`: Recommends the best match from standard and custom machine types.\n- `STANDARD_ONLY`: Recommends the best match from standard machine types only.\n\n#### Options for memory recommendations\n\nFor the memory metrics used to generate the recommendations, you can set\nthe following values:\n\n- `MEMORY_METRICS_DEFAULT`: Use the default metrics to generate recommendations.\n- `MEMORY_METRICS_ALL`: Use all the available metrics to generate recommendations.\n- `MONITORING_AGENT_ONLY`: Use only metrics collected by the Cloud Monitoring Ops Agent.\n- If you don't use the Ops Agent, and prefer not to receive memory recommendations, use the `MEMORY_AGENT_ONLY` value to disable the recommendations.\n\nTo get more accurate recommendations about memory usage, use the\n[Ops Agent](/monitoring/agent/ops-agent).\n\n### Update the configuration for a project\n\nTo update the configuration of your machine type recommendations, modify the\nconfiguration values and upload the new configuration for your project.\nYou can change the preferred machine types, the memory metrics used for\nrecommendations, or both values in the same request.\n\nAfter you upload the new configuration, it takes approximately 48 hours for it\nto take effect. Until that time, any generated recommendations use the previous\nconfiguration. \n\n### gcloud\n\nTo update the configuration parameters, use the\n[`gcloud beta recommender recommender-config update` command](/sdk/gcloud/reference/beta/recommender/recommender-config/update)\nand use `google.compute.instance.MachineTypeRecommender` as the\nRecommender ID: \n\n```\ngcloud beta recommender recommender-config update google.compute.instance.MachineTypeRecommender\\\n --project=PROJECT_ID \\\n --location=ZONE \\\n --config-file=LOCAL_FILE_PATH_AND_NAME \\\n --etag=ETAG\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone for which you want to obtain the current configuration.\n- \u003cvar translate=\"no\"\u003eLOCAL_FILE_PATH_AND_NAME\u003c/var\u003e: the path to the JSON file with the current configuration.\n- \u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e: the etag value of the current configuration. You can find this value in the output of the [previous command](#get_current_configuration).\n\nIn your configuration file, specify only the `recommenderGenerationConfig`\nobject with the updated configuration parameters. If you saved the\nconfiguration to a local file, make sure you copy the `etag` value, then\nremove all the fields except the `recommenderGenerationConfig` value.\n\nFor example, to get recommendations with standard machine types only,\nuse the following configuration file: \n\n```\n{\n \"params\": {\n \"preferred_machine_types\": \"STANDARD_ONLY\"\n }\n}\n```\n\nIf the command is successful, it returns a response body similar to the\nfollowing, showing the new configuration with the parameters you just\nmodified. \n\n```\n{\n \"name\": \"projects/PROJECT_ID/locations/ZONE/recommenders/google.compute.instance.MachineTypeRecommender/config\",\n \"recommenderGenerationConfig\": {\n \"params\": {\n \"preferred_machine_types\": \"STANDARD_ONLY\"\n }\n },\n \"etag\": \"\\\"1245f9435cd01ea8\\\"\",\n \"updateTime\": \"2024-08-20T05:00:05Z\"\n}\n```\n| **Note:** the `etag` value changes from the previous configuration. You must use the new value if you update the configuration again.\n\nWhat's next\n-----------\n\n- Learn how to [Apply machine type recommendations to instances](/compute/docs/instances/apply-machine-type-recommendations-for-instances).\n- Learn how to [Apply machine type recommendations to managed instance groups](/compute/docs/instance-groups/apply-machine-type-recommendations-managed-instance-groups)."]]