이전에는 클러스터 생성 요청을 제출할 때 VM 유형을 사용할 수 없는 경우 요청이 실패했으며 요청, 스크립트 또는 코드를 업데이트하여 '다음으로 좋은' VM 유형을 지정해야 했습니다. 이 재요청 프로세스는 사용 가능한 VM 유형을 지정할 때까지 여러 번 반복될 수 있습니다.
Dataproc 가변형 VM 기능은 순위가 지정된 VM 목록에서 보조 작업자 VM 유형을 선택한 다음 나열된 VM 유형을 사용할 수 있는 지정된 클러스터 리전 내에서 영역을 검색하여 클러스터 생성 요청이 성공하도록 도와줍니다.
용어
VM 유형: VM 인스턴스의 계열, 메모리 용량, CPU 코어 수입니다.
Dataproc에서는 사전 정의된 커스텀 VM 유형을 사용할 수 있습니다.
보조 작업자: 보조 작업자는 데이터를 저장하지 않습니다. 처리 노드 기능만 수행합니다. 따라서 보조 작업자를 사용하면 스토리지를 확장하지 않고도 컴퓨팅을 확장할 수 있습니다.
제한사항 및 고려사항
가변형 VM은 Compute Engine 기반 Dataproc 2.0.74+, 2.1.22+ 이상 Compute Engine 기반 Dataproc 이미지 버전에서 사용할 수 있습니다.
보조 작업자에만 가변형 VM을 지정할 수 있습니다.
목록에 VM 유형을 최대 10개까지 포함하여 최대 5개의 순위 지정 VM 유형 목록을 지정할 수 있습니다. 자세한 내용은 가변형 VM 요청 방법을 참조하세요.
가변형 VM이 있는 클러스터를 만들려면 Dataproc 자동 영역 배치를 사용해야 하므로 Dataproc은 VM 유형 요청을 처리할 용량이 있는 영역을 선택할 수 있습니다.
클러스터 생성 요청에 자동 확장 정책이 포함된 경우 가변형 VM이 다른 VM 제품군에 속할 수 있지만 메모리 및 코어 수가 동일해야 합니다.
가변형 VM을 프로비저닝할 때 Dataproc은 사용 가능한 예약 중 '일치하는' 예약은 사용하지만 '특정' 예약은 사용하지 않습니다(예약 인스턴스 사용 참조).
예약과 일치하는 머신 유형이 먼저 순위에서 선택되고 CPU 수가 가장 많은 VM 유형이 선택됩니다.
클러스터의 기본 및 보조 작업자 V 유형에 서로 다른 CPU 대 메모리 비율을 지정할 수 있지만, 가장 작은 CPU 대 메모리 비율이 가장 작은 컨테이너 단위로 사용되기 때문에 성능이 저하될 수 있습니다.
가변형 VM을 사용하여 생성된 클러스터를 업데이트할 경우, Dataproc은 클러스터를 만들 때 제공된 가변형 VM 목록에서 작업자를 선택하고 추가합니다.
가변형 VM 요청
Google Cloud 콘솔, Google Cloud CLI 또는 Dataproc API를 사용하여 Dataproc 클러스터를 만들 때 가변형 VM을 지정할 수 있습니다.
목록에 VM 유형을 최대 10개까지 포함하여 최대 5개의 순위 지정 VM 유형 목록을 지정할 수 있습니다. 순위가 가장 낮은 목록은 우선순위가 가장 높습니다. 기본적으로 가변형 VM 목록의 순위는 0입니다. 목록 내에서 Dataproc은 사용되지 않은 예약이 있는 VM 유형을 우선하고 그 다음으로 가장 큰 VM 크기에 우선순위를 둡니다.
목록 내에서 CPU 수가 동일한 VM 유형은 동일하게 취급됩니다.
클러스터 설정 패널은 기본값으로 채워진 필드로 선택됩니다. 권장 이름과 클러스터 리전을 변경하고 다른 변경사항을 적용할 수 있습니다. Dataproc 자동 영역 배치가 가변형 VM 목록에 지정된 VM 유형에 가장 적합한 가용성을 제공하는 영역을 선택하도록 클러스터 영역으로 모두를 선택했는지 확인합니다.
노드 구성 패널을 선택합니다. 보조 작업자 노드 섹션에서 보조 작업자의 수와 선점을 지정합니다.
각 보조 작업자 순위로 보조 작업자 추가를 클릭하여 각 순위에 포함할 머신 유형을 한 개 이상 지정합니다.
다음 gcloud CLI 예시에서 Dataproc은 먼저 n2-standard-8 VM(0순위)으로 보조 작업자를 프로비저닝하려고 시도합니다. n2-standard-8 머신을 사용할 수 없는 경우 Dataproc은 e2-standard-8 또는 t2d-standard-8 VM(1순위)으로 보조 작업자를 프로비저닝하려고 시도합니다.
--zone="": 가변형 VM 기능을 사용하려면 Dataproc이 VM 유형을 사용할 수 있는 영역을 선택할 수 있도록 Dataproc 자동 영역 배치가 필요합니다. 빈 값('")을 --zone 플래그로 전달하면 기본 gcloud config list에 지정된 영역 선택이 재정의됩니다.
Dataproc은 머신 코어 및 메모리를 기준으로 구성요소 role 속성을 생성합니다. 다음 구문을 사용하여 --properties 플래그로 시스템 생성 속성을 재정의할 수 있습니다.
클러스터 속성을 사용하여 구성요소 역할 맞춤설정: Dataproc은 VM 코어 및 메모리를 기준으로 구성요소 role 속성을 생성합니다.
다음 key=value 구문을 사용하여 clusters.create 요청에 SoftwareConfig.properties를 추가하면 시스템 생성 속성을 재정의할 수 있습니다.
[[["이해하기 쉬움","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-08-27(UTC)"],[[["\u003cp\u003eFlexible VMs allow you to specify prioritized lists of VM types for Dataproc secondary workers, ensuring cluster creation success even if preferred VM types are unavailable.\u003c/p\u003e\n"],["\u003cp\u003eThis feature uses ranked lists of up to five different lists of machine types, with each list containing up to 10 VM types and employing Dataproc autozone placement to select the best-suited zone.\u003c/p\u003e\n"],["\u003cp\u003eFlexible VMs can be set up when creating a Dataproc cluster through the Google Cloud console, gcloud CLI, or Dataproc API, and they only apply to secondary workers that function as processing nodes without storing data.\u003c/p\u003e\n"],["\u003cp\u003eWhen using an autoscaling policy, flexible VMs can be from different families but must maintain the same memory and core count, and the use of a uniform CPU-to-memory ratio for all workers is advised to prevent performance degradation.\u003c/p\u003e\n"],["\u003cp\u003eWhen provisioning flexible VMs, Dataproc prioritizes VM types that have matching unused reservations and then the largest VM sizes within the specified ranks, adhering to Google Cloud quotas.\u003c/p\u003e\n"]]],[],null,["Flexible VMs is a Dataproc feature that lets you specify\nprioritized lists of [VM types](#vm_types) for Dataproc\n[secondary workers](#secondary_workers) when you\n[create a Dataproc cluster](/dataproc/docs/guides/create-cluster).\n\nWhy use flexible VMs\n\nPreviously, if a VM type was unavailable when you submitted\na cluster creation request, the request failed, and you needed to update\nyour request, script, or code to specify a \"next-best\" VM type. This\nre-request process could involve multiple iterations until you specified a VM type\nthat was available.\n\nThe Dataproc Flexible VM feature helps your cluster creation\nrequest succeed by selecting secondary worker VM types from your ranked VM lists, and then searching\nfor zones within your specified cluster region with availability of the listed VM types.\n\nTerminology\n\n- VM type:\n The family, memory capacity, and number of CPU cores of a VM instance.\n Dataproc supports the use of\n [predefined and custom VM types](/dataproc/docs/concepts/compute/supported-machine-types).\n\n- Secondary workers:\n [Secondary workers](/dataproc/docs/concepts/compute/secondary-vms#gcloud-command)\n don't store data. They function only as processing nodes. You can use\n secondary workers to scale compute without scaling storage.\n\nLimitations and considerations\n\n- Flexible VMs are available in Dataproc on Compute Engine `2.0.74+`,\n `2.1.22+` and later Dataproc on Compute Engine\n [image versions](/dataproc/docs/concepts/versioning/dataproc-version-clusters#supported-dataproc-image-versions).\n\n- You can specify flexible VMs for secondary workers only.\n\n- You can specify up to five ranked VM type lists, with up to 10 VM types\n in a list. For more information, see [How to request flexible VMs](#how_to_request_flexible_vms).\n\n- The creation of a cluster with flexible VMs requires the use of\n [Dataproc autozone placement](/dataproc/docs/concepts/configuring-clusters/auto-zone), which\n allows Dataproc to choose the zone that has the capacity to fulfill\n your VM type requests.\n\n- If your cluster creation request includes an\n [autoscaling policy](/dataproc/docs/concepts/configuring-clusters/autoscaling#create_an_autoscaling_cluster),\n flexible VMs can be from different VM families, but they must have the same\n amount of memory and core count.\n\n- When provisioning flexible VMs, Dataproc consumes \"any matching\"\n available reservations, but not \"specific\" reservations (see\n [Consume reserved instances](/compute/docs/instances/reservations-consume#consuming_reserved_instances)).\n Machine types that match reservations are first selected within a rank, followed by\n VM types with the largest number of CPUs.\n\n- [Dataproc applies Google Cloud quotas](/dataproc/quotas)\n to flexible VM provisioning.\n\n- Although you can specify different CPU-to-memory ratios for primary and\n secondary worker V types in a cluster, this can lead to performance degradation\n because the smallest CPU-to-memory ratio is used as the smallest container unit.\n\n | Use a uniform CPU-to-memory ratio for primary and secondary workers, including flexible VMs.\n\n \u003cbr /\u003e\n\n- If you update a cluster that was created using flexible VMs,\n Dataproc selects and adds workers from the flexible VM lists that\n you provided when you created your cluster.\n\nRequest flexible VMs\n\nYou can specify flexible VMs when you create a Dataproc cluster\nusing the Google Cloud console, Google Cloud CLI, or Dataproc API.\n\n- You can specify up to five ranked VM type lists, with up to 10 VM types in a list. Lowest ranked lists have the highest priority. By default, flexible VM lists have a rank of 0. Within a list, Dataproc prioritizes VM types with unused reservations, followed by the largest VM sizes. VM types within a list with the same CPU count are treated equally.\n\nConsole\n\nTo create a cluster with secondary worker flexible VMs:\n\n1. Open the Dataproc\n [**Create a cluster on Compute Engine**](https://console.cloud.google.com/dataproc/clustersAdd)\n page in the Google Cloud console.\n\n2. The **Set up cluster** panel is selected with fields filled in with default\n values. You can change the suggested name and the cluster region, and\n make other changes. Make sure that **Any** is selected as the cluster\n **Zone** to allow\n [Dataproc autozone placement](/dataproc/docs/concepts/configuring-clusters/auto-zone)\n to choose the zone that has the best availability of the\n VM types specified in your flexible VM lists.\n\n3. Select the **Configure nodes** panel. In the **Secondary worker nodes**\n section, specify the number and preemptibility of secondary workers.\n\n - Click **Add a secondary worker** for each rank of secondary workers, specifying one or more machine types to include in each rank.\n4. After confirming and specifying cluster details in the cluster create panels,\n click **Create**.\n\ngcloud\n\nUse the\n[`gcloud dataproc clusters create`](/sdk/gcloud/reference/dataproc/clusters/create)\ncommand to add multiple `secondary-worker-machine-types` flags to specify ranked\nflexible VM lists for\n[Dataproc secondary workers](/dataproc/docs/concepts/compute/secondary-vms).\nThe default flexible VM secondary worker type is Spot, which is a preemptible type.\n\nIn the following gcloud CLI example, Dataproc attempts\nto provision secondary workers with `n2-standard-8` VMs first (rank 0). If\nn2-standard-8 machines are not available, Dataproc attempts\nto provision secondary workers with either `e2-standard-8` or `t2d-standard-8`\nVMs (rank 1). \n\n```\ngcloud dataproc clusters create CLUSTER_NAME \\\n --region=REGION \\\n --zone=\"\" \\\n --master-machine-type=n1-standard-8 \\\n --worker-machine-type=n1-standard-8 \\\n --num-workers=4 \\\n --num-secondary-workers=4 \\\n --secondary-worker-type=non-preemptible \\\n --secondary-worker-machine-types=\"type=n2-standard-8,rank=0\" \\\n --secondary-worker-machine-types=\"type=e2-standard-8,type=t2d-standard-8,rank=1\"\n```\n\nNotes:\n\n- `--zone=\"\"`: The Flexible VM feature requires\n [Dataproc autozone placement](/dataproc/docs/concepts/configuring-clusters/auto-zone) to\n allow Dataproc to choose the zone that has your\n VM types available for use. Passing an empty value\n (\"\") to the `--zone` flag overrides any zone selection specified in your default\n `gcloud config list`.\n\n- Dataproc generates component `role` properties based on machine\n cores and memory. You can override these system-generated properties with the\n `--properties` flag, using the following syntax:\n\n ```\n --properties=\"ROLE:MACHINE_TYPE:COMPONENT_PREFIX:COMPONENT_PROPERTY=VALUE\"\n ```\n\n Only the `secondary_worker` role is the only supported role.\n\n In the following example, the `--properties` flag changes the number of cores\n of `e2-standard-8` machines assigned to secondary worker nodes from `8` to `6`: \n\n ```\n --properties=\"secondary_worker:e2-standard-8:yarn:yarn.nodemanager.resource.cpu-vcores=6\"\n ```\n\nAPI\n\nUse the [`instanceFlexibilityPolicy.instanceSelectionList`](/dataproc/docs/reference/rest/v1/InstanceGroupConfig#InstanceFlexibilityPolicy.FIELDS.instance_selection_list)\nas part of a Dataproc API\n[`clusters.create`](/dataproc/docs/reference/rest/v1/projects.regions.clusters/create)\nrequest to specify a ranked list of [machineTypes]() for secondary workers.\n\nExample:\n\nThe following JSON snippet from a Dataproc `clusters.create`\n[request body](/dataproc/docs/reference/rest/v1/projects.regions.clusters/create#request-body)\nspecifies secondary workers machine types for rank 0 and rank 1. \n\n```\n\"config\": {\n \"secondaryWorkerConfig\": {\n \"instanceFlexibilityPolicy\": {\n \"instanceSelectionList\": [\n {\n \"machineTypes\": [\n \"n1-standard-4\",\n \"n2-standard-4\"\n ],\n \"rank\": 0\n },\n {\n \"machineTypes\": [\n \"e2-standard-4\",\n \"n2d-standard-4\"\n ],\n \"rank\": 1\n }\n ]\n }\n }\n}\n```\n\n**Use cluster properties to customize component roles:** Dataproc\ngenerates component `role` properties based on VM cores and memory.\nYou can override these system-generated properties by adding\n[`SoftwareConfig.properties`](/static/dataproc/docs/reference/rest/v1/ClusterConfig#SoftwareConfig.FIELDS.properties)\nto your `clusters.create` request, using the following \u003cvar translate=\"no\"\u003ekey\u003c/var\u003e`=`\u003cvar translate=\"no\"\u003evalue\u003c/var\u003e syntax: \n\n```\nROLE:MACHINE_TYPE:COMPONENT_PREFIX:COMPONENT_PROPERTY=VALUE\n```\n\nOnly the `secondary_worker` role is the only supported role.\n\nIn the following example, the `properties` field changes the number of cores\nassigned to the secondary worker node of an `e2-standard-8` VM from `8` to `6`:\n\n\u003cbr /\u003e\n\n```\n\"secondary_worker:e2-standard-8:yarn:yarn.nodemanager.resource.cpu-vcores=6\"\n \n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]