---
title: "POST /projects/{project}/regions/{region}/instanceGroupManagers"
method: POST
path: "/projects/{project}/regions/{region}/instanceGroupManagers"
tags: ["regionInstanceGroupManagers"]
---

# POST /projects/{project}/regions/{region}/instanceGroupManagers

`POST /projects/{project}/regions/{region}/instanceGroupManagers`

Creates a managed instance group using the information that you specify
in the request. After the group is created, instances in the group are
created using the specified instance template.
This operation is marked as DONE when the group is created
even if the instances in the group have not yet been created. You must
separately verify the status of the individual instances with thelistmanagedinstances
method.

A regional managed instance group can contain up to 2000 instances.

## Path parameters

- `project` string, required
- `region` string, required

## Query parameters

- `requestId` string

## Request body

- InstanceGroupManager — Represents a Managed Instance Group resource. An instance group is a collection of VM instances that you can manage as a single entity. For more information, readInstance groups. For zonal Managed Instance Group, use the instanceGroupManagers resource. For regional Managed Instance Group, use theregionInstanceGroupManagers resource.
  - `instanceGroup` string — Output only. The URL of the Instance Group resource.
  - `selfLink` string — Output only. The URL for this managed instance group. The server defines this URL.
  - `targetSize` integer — The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.
  - `baseInstanceName` string — The base instance name is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?))
  - `distributionPolicy` DistributionPolicy
    - `targetShape` 'ANY' | 'ANY_SINGLE_ZONE' | 'BALANCED' | 'EVEN' — The distribution shape to which the group converges either proactively or on resize events (depending on the value set inupdatePolicy.instanceRedistributionType).
    - `zones` DistributionPolicyZoneConfiguration[] — Zones where the regional managed instance group will create and manage its instances. By default, a regional MIG doesn't automatically select an AI zone to create instances, even if an AI zone is available in the specified region. To create instances in an AI zone in the selected region, you must explicitly specify it in the distribution policy together with the other preferred zones.
      - `zone` string — The URL of thezone. The zone must exist in the region where the managed instance group is located.
  - `currentActions` InstanceGroupManagerActionsSummary
    - `creating` integer — Output only. The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
    - `none` integer — Output only. The number of instances in the managed instance group that are running and have no scheduled actions.
    - `refreshing` integer — Output only. The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
    - `resuming` integer — Output only. The number of instances in the managed instance group that are scheduled to be resumed or are currently being resumed.
    - `stopping` integer — Output only. The number of instances in the managed instance group that are scheduled to be stopped or are currently being stopped.
    - `suspending` integer — Output only. The number of instances in the managed instance group that are scheduled to be suspended or are currently being suspended.
    - `restarting` integer — Output only. The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
    - `starting` integer — Output only. The number of instances in the managed instance group that are scheduled to be started or are currently being started.
    - `verifying` integer — Output only. The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation.
    - `deleting` integer — Output only. The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
    - `recreating` integer — Output only. The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
    - `creatingWithoutRetries` integer — Output only. The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.
    - `abandoning` integer — Output only. The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
  - `status` InstanceGroupManagerStatus
    - `appliedAcceleratorTopologies` InstanceGroupManagerStatusAcceleratorTopology[] — Output only. The accelerator topology applied to this MIG. Currently only one accelerator topology is supported.
      - `acceleratorTopology` string — Output only. Topology in the format of: "16x16", "4x4x4", etc. The value is the same as configured in the WorkloadPolicy.
      - `stateDetails` InstanceGroupManagerStatusAcceleratorTopologyAcceleratorTopologyStateDetails
        - `timestamp` string, google-datetime — Output only. Timestamp is shown only if there is an error. The field has // RFC3339 // text format.
        - `error` object — Output only. Encountered errors.
          - `errors` object[] — [Output Only] The array of errors encountered while processing this operation.
            - `code` string — [Output Only] The error type identifier for this error.
            - `message` string — [Output Only] An optional, human-readable error message.
            - `errorDetails` object[] — [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.
              - …
            - `location` string — [Output Only] Indicates the field in the request that caused the error. This property is optional.
      - `state` 'ACTIVATING' | 'ACTIVE' | 'DEACTIVATING' | 'FAILED' | 'INCOMPLETE' | 'REACTIVATING' — Output only. The state of the accelerator topology.
    - `currentInstanceStatuses` InstanceGroupManagerStatusInstanceStatusSummary — The list of instance statuses and the number of instances in this managed instance group that have the status. For more information about how to interpret each status check the instance lifecycle documentation. Currently only shown for TPU MIGs.
      - `nonExistent` integer — Output only. The number of instances that have not been created yet or have been deleted. Includes only instances that would be shown in the listManagedInstances method and not all instances that have been deleted in the lifetime of the MIG. Does not include FlexStart instances that are waiting for the resources availability, they are considered as 'pending'.
      - `stopped` integer — Output only. The number of instances in the managed instance group that have STOPPED status.
      - `running` integer — Output only. The number of instances in the managed instance group that have RUNNING status.
      - `terminated` integer — Output only. The number of instances in the managed instance group that have TERMINATED status.
      - `provisioning` integer — Output only. The number of instances in the managed instance group that have PROVISIONING status.
      - `deprovisioning` integer — Output only. The number of instances in the managed instance group that have DEPROVISIONING status.
      - `repairing` integer — Output only. The number of instances in the managed instance group that have REPAIRING status.
      - `pending` integer — Output only. The number of instances in the managed instance group that have PENDING status, that is FlexStart instances that are waiting for resources. Instances that do not exist because of the other reasons are counted as 'non_existent'.
      - `pendingStop` integer — Output only. The number of instances in the managed instance group that have PENDING_STOP status.
      - `suspended` integer — Output only. The number of instances in the managed instance group that have SUSPENDED status.
      - `stopping` integer — Output only. The number of instances in the managed instance group that have STOPPING status.
      - `suspending` integer — Output only. The number of instances in the managed instance group that have SUSPENDING status.
      - `staging` integer — Output only. The number of instances in the managed instance group that have STAGING status.
    - `stateful` InstanceGroupManagerStatusStateful
      - `perInstanceConfigs` InstanceGroupManagerStatusStatefulPerInstanceConfigs
        - `allEffective` boolean — Output only. A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs.
      - `hasStatefulConfig` boolean — Output only. A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.
    - `autoscaler` string — Output only. The URL of theAutoscaler that targets this instance group manager.
    - `allInstancesConfig` InstanceGroupManagerStatusAllInstancesConfig
      - `effective` boolean — Output only. A bit indicating whether this configuration has been applied to all managed instances in the group.
      - `currentRevision` string — Output only. Current all-instances configuration revision. This value is in RFC3339 text format.
    - `versionTarget` InstanceGroupManagerStatusVersionTarget
      - `isReached` boolean — Output only. A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified byversion field on Instance Group Manager.
    - `bulkInstanceOperation` InstanceGroupManagerStatusBulkInstanceOperation — Bulk instance operation is the creation of VMs in a MIG when the targetSizePolicy.mode is set to BULK.
      - `inProgress` boolean — Output only. Informs whether bulk instance operation is in progress.
      - `lastProgressCheck` InstanceGroupManagerStatusBulkInstanceOperationLastProgressCheck
        - `error` object — Output only. Errors encountered during bulk instance operation.
          - `errors` object[] — [Output Only] The array of errors encountered while processing this operation.
            - `message` string — [Output Only] An optional, human-readable error message.
            - `errorDetails` object[] — [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.
              - …
            - `location` string — [Output Only] Indicates the field in the request that caused the error. This property is optional.
            - `code` string — [Output Only] The error type identifier for this error.
        - `timestamp` string, google-datetime — Output only. Timestamp of the last progress check of bulk instance operation. Timestamp is in RFC3339 text format.
    - `isStable` boolean — Output only. A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.
  - `kind` string — Output only. The resource type, which is alwayscompute#instanceGroupManager for managed instance groups.
  - `targetSizePolicy` InstanceGroupManagerTargetSizePolicy
    - `mode` 'BULK' | 'INDIVIDUAL' | 'UNSPECIFIED_MODE' — The mode of target size policy based on which the MIG creates its VMs individually or all at once.
  - `targetPools` string[] — The URLs for all TargetPool resources to which instances in theinstanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.
  - `instanceTemplate` string — The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
  - `satisfiesPzs` boolean — Output only. Reserved for future use.
  - `allInstancesConfig` InstanceGroupManagerAllInstancesConfig
    - `properties` InstancePropertiesPatch — Represents the change that you want to make to the instance properties.
      - `metadata` object — The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata.
      - `labels` object — The label key-value pairs that you want to patch onto the instance.
  - `targetSuspendedSize` integer — The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method.
  - `fingerprint` string, byte — Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.
  - `satisfiesPzi` boolean — Output only. Reserved for future use.
  - `description` string — An optional description of this resource.
  - `autoHealingPolicies` InstanceGroupManagerAutoHealingPolicy[] — The autohealing policy for this managed instance group. You can specify only one value.
    - `initialDelaySec` integer — The initial delay is the number of seconds that a new VM takes to initialize and run its startup script. During a VM's initial delay period, the MIG ignores unsuccessful health checks because the VM might be in the startup process. This prevents the MIG from prematurely recreating a VM. If the health check receives a healthy response during the initial delay, it indicates that the startup process is complete and the VM is ready. The value of initial delay must be between 0 and 3600 seconds. The default value is 0.
    - `healthCheck` string — The URL for the health check that signals autohealing.
  - `instanceLifecyclePolicy` InstanceGroupManagerInstanceLifecyclePolicy
    - `onRepair` InstanceGroupManagerInstanceLifecyclePolicyOnRepair — Configuration for VM repairs in the MIG.
      - `allowChangingZone` 'NO' | 'YES' — Specifies whether the MIG can change a VM's zone during a repair. Valid values are: - NO (default): MIG cannot change a VM's zone during a repair. - YES: MIG can select a different zone for the VM during a repair.
    - `defaultActionOnFailure` 'DO_NOTHING' | 'REPAIR' — The action that a MIG performs on a failed VM. If the value of the onFailedHealthCheck field is `DEFAULT_ACTION`, then the same action also applies to the VMs on which your application fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed VM.
    - `forceUpdateOnRepair` 'NO' | 'YES' — A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
    - `onFailedHealthCheck` 'DEFAULT_ACTION' | 'DO_NOTHING' | 'REPAIR' — The action that a MIG performs on an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are: - DEFAULT_ACTION (default): MIG uses the same action configured for instanceLifecyclePolicy.defaultActionOnFailure field. - REPAIR: MIG automatically repairs an unhealthy VM by recreating it. - DO_NOTHING: MIG doesn't repair an unhealthy VM. For more information, see About repairing VMs in a MIG.
  - `listManagedInstancesResults` 'PAGELESS' | 'PAGINATED' — Pagination behavior of the listManagedInstances API method for this managed instance group.
  - `zone` string — Output only. The URL of azone where the managed instance group is located (for zonal resources).
  - `resourcePolicies` InstanceGroupManagerResourcePolicies
    - `workloadPolicy` string — The URL of the workload policy that is specified for this managed instance group. It can be a full or partial URL. For example, the following are all valid URLs to a workload policy: - https://www.googleapis.com/compute/v1/projects/project/regions/region/resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy
  - `statefulPolicy` StatefulPolicy
    - `preservedState` StatefulPolicyPreservedState — Configuration of preserved resources.
      - `disks` object — Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.
      - `internalIPs` object — Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.
      - `externalIPs` object — External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.
  - `versions` InstanceGroupManagerVersion[] — Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and aname. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about therelationships between these fields. Exactly one version must leave thetargetSize field unset. That version will be applied to all remaining instances. For more information, read aboutcanary updates.
    - `targetSize` FixedOrPercent — Encapsulates numeric value that can be either absolute or relative.
      - `fixed` integer — Specifies a fixed number of VM instances. This must be a positive integer.
      - `calculated` integer — Output only. Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.
      - `percent` integer — Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
    - `name` string — Name of the version. Unique among all versions in the scope of this managed instance group.
    - `instanceTemplate` string — The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached.
  - `id` string, uint64 — Output only. A unique identifier for this resource type. The server generates this identifier.
  - `namedPorts` NamedPort[] — [Output Only] Named ports configured on the Instance Groups complementary to this Instance Group Manager.
    - `name` string — The name for this named port. The name must be 1-63 characters long, and comply withRFC1035.
    - `port` integer — The port number, which can be a value between 1 and 65535.
  - `name` string — The name of the managed instance group. The name must be 1-63 characters long, and comply withRFC1035.
  - `targetStoppedSize` integer — The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method.
  - `standbyPolicy` InstanceGroupManagerStandbyPolicy
    - `mode` 'MANUAL' | 'SCALE_OUT_POOL' — Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `MANUAL`.
    - `initialDelaySec` integer — Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0.
  - `updatePolicy` InstanceGroupManagerUpdatePolicy
    - `maxUnavailable` FixedOrPercent — Encapsulates numeric value that can be either absolute or relative.
      - `fixed` integer — Specifies a fixed number of VM instances. This must be a positive integer.
      - `calculated` integer — Output only. Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.
      - `percent` integer — Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
    - `minimalAction` 'NONE' | 'REFRESH' | 'REPLACE' | 'RESTART' — Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action toREFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes.
    - `maxSurge` FixedOrPercent — Encapsulates numeric value that can be either absolute or relative.
      - `fixed` integer — Specifies a fixed number of VM instances. This must be a positive integer.
      - `calculated` integer — Output only. Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.
      - `percent` integer — Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
    - `replacementMethod` 'RECREATE' | 'SUBSTITUTE' — What action should be used to replace instances. See minimal_action.REPLACE
    - `type` 'OPPORTUNISTIC' | 'PROACTIVE' — The type of update process. You can specify either PROACTIVE so that the MIG automatically updates VMs to the latest configurations orOPPORTUNISTIC so that you can select the VMs that you want to update.
    - `instanceRedistributionType` 'NONE' | 'PROACTIVE' — The instance redistribution policy for regional managed instance groups. Valid values are: - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - NONE: For non-autoscaled groups, proactive redistribution is disabled.
    - `mostDisruptiveAllowedAction` 'NONE' | 'REFRESH' | 'REPLACE' | 'RESTART' — Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions,REFRESH to avoid restarting the VM and to limit disruption as much as possible. RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
  - `region` string — Output only. [Output Only] The URL of theregion where the managed instance group resides (for regional resources).
  - `creationTimestamp` string — Output only. The creation timestamp for this managed instance group inRFC3339 text format.
  - `instanceFlexibilityPolicy` InstanceGroupManagerInstanceFlexibilityPolicy
    - `instanceSelections` object — Named instance selections configuring properties that the group will use when creating new VMs.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/compute.md) · [All operations](https://skmtc.net/google/apis/compute/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/compute/revisions/6120ed8969d4/schema)
