---
title: "POST /v1/{+parent}/nodeGroups"
method: POST
path: "/v1/{+parent}/nodeGroups"
tags: ["projects"]
---

# POST /v1/{+parent}/nodeGroups

`POST /v1/{+parent}/nodeGroups`

Creates a node group in a cluster. The returned Operation.metadata is NodeGroupOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).

## Path parameters

- `parent` string, required

## Query parameters

- `nodeGroupId` string
- `parentOperationId` string
- `requestId` string

## Request body

- NodeGroup — Node Group. The NodeGroup resource is not related to the NodeGroupAffinity resource.
  - `roles` string[] — Required. Node group roles.
  - `name` string — The Node group resource name (https://aip.dev/122).
  - `labels` object — Optional. Node group labels. Label keys must consist of from 1 to 63 characters and conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values can be empty. If specified, they must consist of from 1 to 63 characters and conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). The node group must have no more than 32 labels.
  - `nodeGroupConfig` InstanceGroupConfig — The config settings for Compute Engine resources in an instance group, such as a master or worker group.
    - `instanceNames` string[] — Output only. The list of instance names, derived from cluster_name, num_instances, and the instance group.
    - `preemptibility` 'PREEMPTIBILITY_UNSPECIFIED' | 'NON_PREEMPTIBLE' | 'PREEMPTIBLE' | 'SPOT' — Optional. Specifies the preemptibility of the instance group.The default value for master and worker groups is NON_PREEMPTIBLE. This default cannot be changed.The default value for secondary instances is PREEMPTIBLE.
    - `minCpuPlatform` string — Optional. Specifies the minimum cpu platform for the Instance Group. See Minimum CPU Platform (https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu).
    - `startupConfig` StartupConfig — Configuration to handle the startup of instances during cluster create and update process.
      - `requiredRegistrationFraction` number, double — Optional. The config setting to enable cluster creation/ updation to be successful only after required_registration_fraction of instances are up and running. This configuration is applicable to only secondary workers for now. The cluster will fail if required_registration_fraction of instances are not available. This will include instance creation, agent registration, and service registration (if enabled).
    - `managedGroupConfig` ManagedGroupConfig — Specifies the resources used to actively manage an instance group.
      - `instanceGroupManagerUri` string — Output only. The partial URI to the instance group manager for this group. E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm.
      - `instanceTemplateName` string — Output only. The name of the Instance Template used for the Managed Instance Group.
      - `instanceGroupManagerName` string — Output only. The name of the Instance Group Manager for this group.
    - `minNumInstances` integer — Optional. The minimum number of primary worker instances to create. If min_num_instances is set, cluster creation will succeed if the number of primary workers created is at least equal to the min_num_instances number.Example: Cluster creation request with num_instances = 5 and min_num_instances = 3: If 4 VMs are created and 1 instance fails, the failed VM is deleted. The cluster is resized to 4 instances and placed in a RUNNING state. If 2 instances are created and 3 instances fail, the cluster in placed in an ERROR state. The failed VMs are not deleted.
    - `instanceFlexibilityPolicy` InstanceFlexibilityPolicy — Instance flexibility Policy allowing a mixture of VM shapes and provisioning models.
      - `instanceMachineTypes` object — Output only. A map of instance short name to machine type. The key is the short name of the Compute Engine instance, and the value is the full machine-type name (e.g., 'n1-standard-16'). See Machine types for more information on valid machine type strings.
      - `instanceSelectionList` InstanceSelection[] — Optional. List of instance selection options that the group will use when creating new VMs.
        - `machineTypes` string[] — Optional. Full machine-type names, e.g. "n1-standard-16".
        - `rank` integer — Optional. Preference of this instance selection. Lower number means higher preference. The service will first try to create a VM based on the machine-type with priority rank and fallback to next rank based on availability. Machine types and instance selections with the same priority have the same preference.
        - `diskConfig` DiskConfig — Specifies the config of boot disk and attached disk options for a group of VM instances.
          - `numLocalSsds` integer — Optional. Number of attached SSDs, from 0 to 8 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.Note: Local SSD options may vary by machine type and number of vCPUs selected.
          - `bootDiskProvisionedIops` string, int64 — Optional. Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. This field is supported only if boot_disk_type is hyperdisk-balanced.
          - `bootDiskType` string — Optional. Type of the boot disk (default is pd-standard). Valid values: pd-balanced (Persistent Disk Balanced Solid State Drive), pd-ssd (Persistent Disk Solid State Drive), or pd-standard (Persistent Disk Hard Disk Drive). See Disk types (https://cloud.google.com/compute/docs/disks#disk-types).
          - `bootDiskSizeGb` integer — Optional. Size in GB of the boot disk (default is 500GB).
          - `localSsdInterface` string — Optional. Interface type of local SSDs (default is scsi). Valid values: scsi (Small Computer System Interface), nvme (Non-Volatile Memory Express). See local SSD performance (https://cloud.google.com/compute/docs/disks/local-ssd#performance).
          - `bootDiskProvisionedThroughput` string, int64 — Optional. Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. This field is supported only if boot_disk_type is hyperdisk-balanced.
          - `attachedDiskConfigs` AttachedDiskConfig[] — Optional. A list of attached disk configs for a group of VM instances.
            - `diskType` 'DISK_TYPE_UNSPECIFIED' | 'HYPERDISK_BALANCED' | 'HYPERDISK_EXTREME' | 'HYPERDISK_ML' | 'HYPERDISK_THROUGHPUT' — Optional. Disk type.
            - `diskSizeGb` integer — Optional. Disk size in GB.
            - `provisionedIops` string, int64 — Optional. Indicates how many IOPS to provision for the attached disk. This sets the number of I/O operations per second that the disk can handle. See https://cloud.google.com/compute/docs/disks/hyperdisks#hyperdisk-features
            - `provisionedThroughput` string, int64 — Optional. Indicates how much throughput to provision for the attached disk. This sets the number of throughput mb per second that the disk can handle. See https://cloud.google.com/compute/docs/disks/hyperdisks#hyperdisk-features
      - `instanceSelectionResults` InstanceSelectionResult[] — Output only. A list of instance selection results in the group.
        - `vmCount` integer — Output only. Number of VM provisioned with the machine_type.
        - `machineType` string — Output only. Full machine-type names, e.g. "n1-standard-16".
      - `provisioningModelMix` ProvisioningModelMix — Defines how to create VMs with a mixture of provisioning models.
        - `standardCapacityBase` integer — Optional. The base capacity that will always use Standard VMs to avoid risk of more preemption than the minimum capacity you need. The service will create only standard VMs until it reaches standard_capacity_base, then it will start using standard_capacity_percent_above_base to mix Spot with Standard VMs. eg. If 15 instances are requested and standard_capacity_base is 5, the service will create 5 standard VMs and thenstart mixing spot and standard VMs for remaining 10 instances.
        - `standardCapacityPercentAboveBase` integer — Optional. The percentage of target capacity that should use Standard VM. The remaining percentage will use Spot VMs. The percentage applies only to the capacity above standard_capacity_base. eg. If 15 instances are requested and standard_capacity_base is 5 and standard_capacity_percent_above_base is 30, the service will create 5 standard VMs and then start mixing spot and standard VMs for remaining 10 instances. The mix will be 30% standard and 70% spot.
    - `instanceReferences` InstanceReference[] — Output only. List of references to Compute Engine instances.
      - `publicKey` string — The public RSA key used for sharing data with this instance.
      - `publicEciesKey` string — The public ECIES key used for sharing data with this instance.
      - `instanceId` string — The unique identifier of the Compute Engine instance.
      - `instanceName` string — The user-friendly name of the Compute Engine instance.
    - `imageUri` string — Optional. The Compute Engine image resource used for cluster instances.The URI can represent an image or image family.Image examples: https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/[image-id] projects/[project_id]/global/images/[image-id] image-idImage family examples. The service will use the most recent image from the family: https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/family/[custom-image-family-name] projects/[project_id]/global/images/family/[custom-image-family-name]If the URI is unspecified, it will be inferred from SoftwareConfig.image_version or the system default.
    - `accelerators` AcceleratorConfig[] — Optional. The Compute Engine accelerator configuration for these instances.
      - `acceleratorTypeUri` string — Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Compute Engine AcceleratorTypes (https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).Examples: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4 projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4 nvidia-tesla-t4Auto Zone Exception: If you are using Auto Zone Placement (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement), you must use the short name of the accelerator type resource, for example, nvidia-tesla-t4.
      - `acceleratorCount` integer — The number of the accelerator cards of this type exposed to this instance.
    - `numInstances` integer — Optional. The number of VM instances in the instance group. For HA cluster master_config groups, must be set to 3. For standard cluster master_config groups, must be set to 1.
    - `diskConfig` DiskConfig — Specifies the config of boot disk and attached disk options for a group of VM instances.
      - `numLocalSsds` integer — Optional. Number of attached SSDs, from 0 to 8 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and the boot disk contains only basic config and installed binaries.Note: Local SSD options may vary by machine type and number of vCPUs selected.
      - `bootDiskProvisionedIops` string, int64 — Optional. Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. This field is supported only if boot_disk_type is hyperdisk-balanced.
      - `bootDiskType` string — Optional. Type of the boot disk (default is pd-standard). Valid values: pd-balanced (Persistent Disk Balanced Solid State Drive), pd-ssd (Persistent Disk Solid State Drive), or pd-standard (Persistent Disk Hard Disk Drive). See Disk types (https://cloud.google.com/compute/docs/disks#disk-types).
      - `bootDiskSizeGb` integer — Optional. Size in GB of the boot disk (default is 500GB).
      - `localSsdInterface` string — Optional. Interface type of local SSDs (default is scsi). Valid values: scsi (Small Computer System Interface), nvme (Non-Volatile Memory Express). See local SSD performance (https://cloud.google.com/compute/docs/disks/local-ssd#performance).
      - `bootDiskProvisionedThroughput` string, int64 — Optional. Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. This field is supported only if boot_disk_type is hyperdisk-balanced.
      - `attachedDiskConfigs` AttachedDiskConfig[] — Optional. A list of attached disk configs for a group of VM instances.
        - `diskType` 'DISK_TYPE_UNSPECIFIED' | 'HYPERDISK_BALANCED' | 'HYPERDISK_EXTREME' | 'HYPERDISK_ML' | 'HYPERDISK_THROUGHPUT' — Optional. Disk type.
        - `diskSizeGb` integer — Optional. Disk size in GB.
        - `provisionedIops` string, int64 — Optional. Indicates how many IOPS to provision for the attached disk. This sets the number of I/O operations per second that the disk can handle. See https://cloud.google.com/compute/docs/disks/hyperdisks#hyperdisk-features
        - `provisionedThroughput` string, int64 — Optional. Indicates how much throughput to provision for the attached disk. This sets the number of throughput mb per second that the disk can handle. See https://cloud.google.com/compute/docs/disks/hyperdisks#hyperdisk-features
    - `isPreemptible` boolean — Output only. Specifies that this instance group contains preemptible instances.
    - `machineTypeUri` string — Optional. The Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2 projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2 n1-standard-2Auto Zone Exception: If you are using Auto Zone Placement (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement), you must use the short name of the machine type resource, for example, n1-standard-2.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dataproc.md) · [All operations](https://skmtc.net/google/apis/dataproc/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dataproc/versions/15847ccbcf7d/schema)
