A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/instance-groups/create-zonal-mig below:

Create a MIG in a single zone | Compute Engine Documentation

Create a MIG in a single zone

Stay organized with collections Save and categorize content based on your preferences.

This document describes how to create a managed instance group (MIG) in a single zone. Putting all your MIG's VMs in a single zone helps to minimize latency, which is useful for certain workloads—for example, batch workloads.

This type of MIG is also known as a zonal MIG.

You can also read about other basic scenarios for creating a MIG.

Before you begin Limitations

To see the full list of MIG limitations, which varies based on the configuration that you use, see MIG limitations.

Create a MIG in a single zone

To create a MIG in a single zone, use the Google Cloud console, the gcloud CLI, Terraform, or REST.

Permissions required for this task

To perform this task, you must have the following permissions:

Console
  1. In the Google Cloud console, go to the Instance groups page.

    Go to Instance groups

    The remaining steps appear in the Google Cloud console.

  2. Click Create instance group .
  3. If you want to create a stateful MIG, select the New managed instance group (stateful) option. To help you decide, see When to use stateful MIGs.
  4. Assign a name and optionally a description to your instance group.
  5. Choose an instance template for the instance group or create a new one.
  6. Specify the number of VMs for this group. Remember to provision enough VMs to support your application if a zone failure happens.
  7. For Location , select Single zone.
  8. Select the Region and the Zone where you want to create your MIG. If you chose a regional instance template, then the Region is automatically selected based on the template's region.
  9. For stateless MIGs, Autoscaling is enabled by default. With autoscaling, your group automatically adds or removes instances based on its utilization.
  10. Optionally, enable autohealing to perform application-based health checking on VMs within the group.
  11. Click Create to create the new group.
gcloud

If you haven't already created an instance template, which specifies the machine type, boot disk image, network, and other VM properties that you want for each VM in your MIG, create an instance template.

Create a managed instance group with the instance-groups managed create command and specify the group name, group size, instance template, and zone.

gcloud compute instance-groups managed create INSTANCE_GROUP_NAME \
    --size SIZE \
    --template INSTANCE_TEMPLATE_URL \
    --zone ZONE

Replace the following:

You can optionally supply the --base-instance-name flag. Because these VMs are based on a common template, each VM is assigned a random string as part of its VM name. The base name is prepended to this random string. For example, if you set the base name to test, VMs will have names like test-yahs and test-qtyz. If you need specific names, see Creating instances with specific names in MIGs.

For example, the following command creates an instance group named example-group, with base VM name test. The group contains three instances:

gcloud compute instance-groups managed create example-group \
    --base-instance-name test \
    --size 3 \
    --template an-instance-template \
    --zone us-central1-f
Terraform

If you haven't already created an instance template, which specifies the machine type, boot disk image, network, and other VM properties that you want for each VM in your MIG, create an instance template.

To create a zonal MIG, you can use the google_compute_instance_group_manager resource.

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

REST

If you haven't already created an instance template, which specifies the machine type, boot disk image, network, and other VM properties that you want for each VM in your MIG, create an instance template.

Create a managed instance group with the instanceGroupManagers.insert method. In the request body, include the group name, group size, and the URL to the instance template.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers

{
  "versions": [
    {
      "instanceTemplate": "INSTANCE_TEMPLATE_URL"
    }
  ],
  "name": "INSTANCE_GROUP_NAME",
  "targetSize": SIZE
}

Replace the following:

You can optionally supply the base-name field. Because these VMs are based on a common template, each VM is assigned a random string as part of its VM name. The base name is prepended to this random string. For example, if you set the base name to test, VMs will have names like test-yahs and test-qtyz. If you need specific names, see Creating instances with specific names in MIGs.

Depending on how you configure and act on a MIG, various policies and actions can affect the instances in the group. To determine which managed instances are up and running, see Checking the status of managed instances.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This document guides users on creating a managed instance group (MIG) within a single zone, also known as a zonal MIG, which minimizes latency for workloads like batch processing."],["Before creating a MIG, you must first create an instance template that defines the properties of the VMs within the group."],["You can create a single-zone MIG using the Google Cloud console, gcloud CLI, Terraform, or REST API, each method requiring specific configurations and steps."],["Managed instance groups support features like autoscaling, autohealing, and stateful configurations to manage the VMs within the group effectively."],["After setting up the MIG, there are several next steps, such as setting up autohealing, enabling autoscaling, applying new configurations, and configuring stateful MIGs."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4