A RetroSearch Logo

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

Search Query:

Showing content from https://cloud.google.com/compute/docs/instance-groups/create-resize-requests-mig below:

Create resize requests in a MIG | Compute Engine Documentation

Skip to main content Create resize requests in a MIG

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

This document describes how to create resize requests in a managed instance group (MIG) of virtual machine (VM) instances that have attached GPUs. To learn more about resize requests, see About resize requests in a MIG.

Creating a MIG resize request helps you obtain highly-demanded resources, like GPUs, and optimize costs by creating the exact number of VMs all at once. To create a MIG resize request that can use the features and services available from Cluster Director, see Create a MIG and a resize request in the AI Hypercomputer documentation.

Before you begin Required roles

To get the permissions that you need to create MIG resize requests, ask your administrator to grant you the Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on the project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to create MIG resize requests. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to create MIG resize requests:

You might also be able to get these permissions with custom roles or other predefined roles.

Prepare a MIG for resize requests

To create a MIG resize requests, you must configure an instance template and the MIG as described in the following sections.

Create an instance template

Based on your use case for MIG resize requests, create an instance template by using one of the following methods:

Use the flex-start provisioning model

Preview — The flex-start provisioning model

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions.

To create an instance template configured for MIG resize requests and for creating VMs as soon as resources are available, you must specify the following in the template:

Note: If you want to run data science or machine learning workloads, then consider using a Deep Learning VM Images image when you create an instance template. Deep Learning VM is a set of prepackaged VM images that comes with machine learning frameworks and essential tools. For more information about these images, see Choose an image in the Deep Learning VM documentation.

To create an instance template, select one of the following options:

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

    Go to Instance templates

  2. Click Create instance template. The Create an instance template page opens.

  3. In the Name field, enter a name for the instance template.

  4. In the Location section, select one of the following options:

  5. In the Machine configuration section, do the following:

    1. Click the GPUs tab.

    2. In the GPU type list, select a GPU type.

    3. In the Number of GPUs list, select the number of GPUs.

    4. Optional: If your chosen GPU type supports NVIDIA RTX Virtual Workstations (vWS) for graphics workloads, and you plan to run graphics-intensive workloads, then select Enable Virtual Workstation (NVIDIA GRID).

    5. In the Machine type section, select a machine type.

  6. In the Provisioning model section, complete the following steps:

    1. In the VM provisioning model field, select Flex-start.

    2. Expand VM provisioning model advanced settings.

    3. Select the Set a time limit for the VM checkbox.

    4. To set a run duration for the VMs created through the instance template, in the Enter number of hours field, enter the number of hours. The value must be between 36 seconds (0.01) and seven days (168).

  7. Optional: To change the default value boot disk type or image, in the Boot disk section, click Change. Then, follow the prompts to change the boot disk.

  8. Click Create.

gcloud

To create an instance template, use the beta instance-templates create command with the following flags:

For example, to create a regional instance template, run the following command. If you want to create a global instance template, then use the same command without the --instance-template-region flag.

gcloud beta compute instance-templates create INSTANCE_TEMPLATE_NAME \
    --image-project=IMAGE_PROJECT \
    --image-family=IMAGE_FAMILY \
    --instance-template-region=REGION \
    --instance-termination-action=DELETE \
    --machine-type=MACHINE_TYPE \
    --maintenance-policy=TERMINATE \
    --max-run-duration=RUN_DURATION \
    --provisioning-model=FLEX_START \
    --reservation-affinity=none

Replace the following:

REST

To create an instance template, make a POST request to one of the following methods:

In the request body, include the following fields:

For example, to create a regional instance template, make a request as follows:

POST https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/regions/REGION/instanceTemplates

{
  "name": "INSTANCE_TEMPLATE_NAME",
  "properties": {
    "disks": [
      {
        "boot": true,
        "initializeParams": {
          "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"
        }
      }
    ],
    "machineType": "MACHINE_TYPE",
    "networkInterfaces": [
      {
        "network": "global/networks/default"
      }
    ],
    "reservationAffinity": {
      "consumeReservationType": "NO_RESERVATION"
    },
    "scheduling": {
      "instanceTerminationAction": "DELETE",
      "maxRunDuration": {
        "seconds": RUN_DURATION
      },
      "onHostMaintenance": "TERMINATE",
      "provisioningModel": "FLEX_START"
    }
  }
}

Replace the following:

For more information about creating an instance template, see Create instance templates.

Use the reservation-bound provisioning model

To create an instance template configured for MIG resize requests and for consuming a reservation, you must specify the following in the template:

Note: If you want to run data science or machine learning workloads, then consider using a Deep Learning VM Images image when you create an instance template. Deep Learning VM is a set of prepackaged VM images that comes with machine learning frameworks and essential tools. For more information about these images, see Choose an image in the Deep Learning VM documentation.

To create an instance template, select one of the following options:

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

    Go to Instance templates

  2. Click Create instance template. The Create an instance template page opens.

  3. In the Name field, enter a name for the instance template.

  4. In the Location section, select one of the following options:

  5. In the Machine configuration section, do the following:

    1. Click the GPUs tab.

    2. In the GPU type list, select one of the following options as specified in the reservation that you want to consume:

      • To use A4 VMs: NVIDIA B200 180GB

      • To use A3 Ultra VMs: NVIDIA H200 141GB

      This action automatically sets the provisioning model of the instance template to Reservation-bound.

    3. In the Number of GPUs list, select the number of GPUs.

    4. Optional: If your chosen GPU type supports NVIDIA RTX Virtual Workstations (vWS) for graphics workloads, and you plan to run graphics-intensive workloads, then select Enable Virtual Workstation (NVIDIA GRID).

    5. In the Machine type section, select a machine type.

  6. In the Provisioning model section, complete the following steps:

    1. Expand VM provisioning model advanced settings.

    2. In the On VM termination list, select Delete.

  7. Optional: To change the default value boot disk type or image, in the Boot disk section, click Change. Then, follow the prompts to change the boot disk.

  8. Expand the Advanced options section, and then do the following:

    1. Expand the Management section.

    2. In the Reservations section, select Choose a reservation, and then click Choose reservation. In the pane that appears, follow the prompts to select the reservation that you want to consume.

  9. Click Create.

gcloud

To create an instance template, use the instance-templates create command with the following flags:

For example, to create a regional instance template, run the following command. If you want to create a global instance template, then use the same command without the --instance-template-region flag.

gcloud compute instance-templates create INSTANCE_TEMPLATE_NAME \
    --image-project=IMAGE_PROJECT \
    --image-family=IMAGE_FAMILY \
    --instance-termination-action=DELETE \
    --instance-template-region=REGION \
    --machine-type=MACHINE_TYPE \
    --maintenance-policy=TERMINATE \
    --provisioning-model=RESERVATION_BOUND \
    --reservation-affinity=specific \
    --reservation=RESERVATION_URL

Replace the following:

REST

To create an instance template, make a POST request to one of the following methods:

In the request body, include the following fields:

For example, to create a regional instance template, make a request as follows:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/instanceTemplates

{
  "name": "INSTANCE_TEMPLATE_NAME",
  "properties": {
    "disks": [
      {
        "boot": true,
        "initializeParams": {
          "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"
        }
      }
    ],
    "machineType": "MACHINE_TYPE",
    "networkInterfaces": [
      {
        "network": "global/networks/default"
      }
    ],
    "reservationAffinity": {
      "consumeReservationType": "SPECIFIC_RESERVATION",
      "key": "compute.googleapis.com/reservation-name",
      "values": [
        "RESERVATION_URL"
      ]
    },
    "scheduling": {
      "instanceTerminationAction": "DELETE",
      "onHostMaintenance": "TERMINATE",
      "provisioningModel": "RESERVATION_BOUND"
    }
  }
}

Replace the following:

For more information about creating an instance template, see Create instance templates.

Create or update a MIG

After creating the instance template as described in the previous section, use that instance template to create a MIG as follows, or update a MIG. Additionally, you must do the following to prepare the MIG for resize requests:

Note: When you create a MIG using the Google Cloud console, you can also create a resize request in the MIG at the same time. Otherwise, if you want to use the gcloud CLI or REST, you must create a MIG as follows, and then create a resize request in the MIG as described in the next section.

To create a MIG that is compatible with resize requests, select one of the following options:

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

    Go to Instance groups

  2. Click Create instance group. The Create instance group page opens.

  3. In the Name field, enter a name for the MIG.

  4. Before you select an instance template, you must delete the autoscaling configuration and turn off repairs as follows:

    1. To delete the autoscaling configuration, do the following:

      1. In the Autoscaling section, click the Autoscaling mode list, and then click Delete autoscaling configuration.

      2. In the confirmation dialog, click Delete.

    2. To turn off repairs, in the VM instance lifecycle section, click the Default action on failure list, and then select No action.

  5. Go back to the Instance template field. In the Instance template list, select the instance template that you created in the previous section. If you select a regional instance template, then the Region list is set to the template's region.

  6. Do one of the following:

  7. In the Location section, specify whether you want to create a zonal or a regional MIG as follows:

    1. To create a zonal MIG, select Single zone. Or, to create a regional MIG, select Multiple zones.

    2. Select the Region and Zones of the MIG.

    3. If you're creating a regional MIG, then do the following:

      1. In the Target distribution shape field, select Any single zone.

      2. In the dialog that appears, click Disable instance redistribution.

  8. Click Create.

gcloud

Use the instance-groups managed create command with the --default-action-on-vm-failure flag set to do_nothing. If you're creating a regional MIG, then you must also include the --target-distribution-shape flag set to any-single-zone, and the --instance-redistribution-type flag set to none.

Replace the following:

REST

Replace the following:

Create a resize request in a MIG

Preview — Resize requests in regional MIGs and resize request creation by specifying VM names in zonal and regional MIGs.

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions.

Before you create MIG resize requests, make sure that you've prepared the MIG as described in the previous section.

After you create a resize request and all your requested resources become available, the MIG creates the requested number of VMs all at once. The VMs run until the MIG deletes them after the specified run duration ends, or until you delete them.

To create a resize request in a MIG, select one of the following options. To add VMs with specific names to the MIG through a resize request, use the gcloud CLI or REST API.

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

    Go to Instance groups

  2. In the Name column, click the name of the MIG in which to create the resize request.

    The overview page of the MIG opens.

  3. In the Resize requests row, click edit Edit resize requests.

  4. Click add New resize request.

    The New resize requests pane appears.

  5. In the Name field, enter the name of the resize request.

  6. In the Number of additional instances needed field, enter the number of VMs to add to the MIG all at once.

  7. Optional: If the MIG's instance template specifies a run duration, then you can specify a different run duration. To do so, in the Requested run duration field and Unit lists, specify a run duration. You must specify a duration between one hour and seven days.

  8. Click Create.

gcloud

Replace the following:

Optionally, you can do the following:

REST

In the request body, include the following:

{
  "name": "RESIZE_REQUEST_NAME",
  "resizeBy": COUNT
}

Replace the following:

Optionally, you can do the following:

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 resize requests in a managed instance group (MIG) for virtual machines (VMs) with attached GPUs to optimize resource allocation."],["Before creating a resize request, users must review how resize requests work, check their GPU quota, and set up authentication for Google Cloud services."],["Users must prepare a MIG for resize requests by configuring an instance template that stops VMs during host maintenance events and does not use reservations."],["To prepare the MIG for resize requests, set the MIG's update type to opportunistic, turn off repairs, delete the autoscaling configuration, and if using a regional MIG, set the target distribution shape to `ANY_SINGLE_ZONE`."],["A resize request involves specifying the number of VMs to add all at once and defining the duration these VMs will run, with a range between 1 hour and 7 days."]]],[]]


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