Stay organized with collections Save and categorize content based on your preferences.
This document explains how to suspend and stop virtual machine (VM) instances in a managed instance group (MIG), and how to resume their operation.
Before you beginSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
You can suspend a running VM in a MIG using the Google Cloud console, the Google Cloud CLI, or the Compute Engine API.
ConsoleUse the instance-groups managed suspend-instances
command.
gcloud compute instance-groups managed suspend-instances MIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME
: the name of the MIG in which to suspend an instance.INSTANCE_NAME
: the name of the instance to suspend. To suspend multiple instances, provide a comma-separated list of names.REGION
: for a regional MIG, the region where the MIG is located.ZONE
: for a zonal MIG, the zone where the MIG is located.Use the instanceGroupManager.suspendInstances
method and specify the instances in the request body. For regional MIGs, use the regionInstanceGroupManager.suspendInstances
method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME/suspendInstances { "instances": [ "INSTANCE_NAME_URL" ] }
Replace the following:
PROJECT_ID
: the project ID for the request.ZONE
: for a zonal MIG, the zone where the MIG is located.
zones/ZONE
with regions/REGION
and specify the region of the MIG.MIG_NAME
: the name of the MIG in which to suspend an instance.INSTANCE_NAME_URL
: the URL of the instance to suspend—for example, zones/us-central1-a/instances/example-instance-name1
. To suspend multiple instances, provide a comma-separated list of URLs—for example, "zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2"
.You can resume a suspended VM in a MIG using the Google Cloud console, the gcloud CLI, or the Compute Engine API.
ConsoleUse the instance-groups managed resume-instances
command.
gcloud compute instance-groups managed resume-instances MIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME
: the name of the MIG in which to resume an instance.INSTANCE_NAME
: the name of the instance to resume. To resume multiple instances, provide a comma-separated list of names.REGION
: for a regional MIG, the region where the MIG is located.ZONE
: for a zonal MIG, the zone where the MIG is located.Use the instanceGroupManager.resumeInstances
method and specify the instances in the request body. For regional MIGs, use the regionInstanceGroupManager.resumeInstances
method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME/resumeInstances { "instances": [ "INSTANCE_NAME_URL" ] }
Replace the following:
PROJECT_ID
: the project ID for the request.ZONE
: for a zonal MIG, the zone where the MIG is located.
zones/ZONE
with regions/REGION
and specify the region of the MIG.MIG_NAME
: the name of the MIG in which to resume an instance.INSTANCE_NAME_URL
: the URL of the instance to resume—for example, zones/us-central1-a/instances/example-instance-name1
. To resume multiple instances, provide a comma-separated list of URLs—for example, "zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2"
.You can stop a running VM in a MIG using the Google Cloud console, the Google Cloud CLI, or the Compute Engine API.
ConsoleUse the instance-groups managed stop-instances
command.
gcloud compute instance-groups managed stop-instances MIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME
: the name of the MIG in which to stop an instance.INSTANCE_NAME
: the name of the instance to stop. To stop multiple instances, provide a comma-separated list of names.REGION
: for a regional MIG, the region where the MIG is located.ZONE
: for a zonal MIG, the zone where the MIG is located.Use the instanceGroupManager.stopInstances
method and specify the instances in the request body. For regional MIGs, use the regionInstanceGroupManager.stopInstances
method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME/stopInstances { "instances": [ "INSTANCE_NAME_URL" ] }
Replace the following:
PROJECT_ID
: the project ID for the request.ZONE
: for a zonal MIG, the zone where the MIG is located.
zones/ZONE
with regions/REGION
and specify the region of the MIG.MIG_NAME
: the name of the MIG in which to stop an instance.INSTANCE_NAME_URL
: the URL of the instance to stop—for example, zones/us-central1-a/instances/example-instance-name1
. To stop multiple instances, provide a comma-separated list of URLs—for example, "zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2"
.You can start a stopped VM in a MIG using the Google Cloud console, the gcloud CLI, or the Compute Engine API.
ConsoleUse the instance-groups managed start-instances
command.
gcloud compute instance-groups managed start-instances MIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME
: the name of the MIG in which to start an instance.INSTANCE_NAME
: the name of the instance to start. To start multiple instances, provide a comma-separated list of names.REGION
: for a regional MIG, the region where the MIG is located.ZONE
: for a zonal MIG, the zone where the MIG is located.Use the instanceGroupManager.startInstances
method and specify the instances in the request body. For regional MIGs, use the regionInstanceGroupManager.startInstances
method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME/startInstances { "instances": [ "INSTANCE_NAME_URL" ] }
Replace the following:
PROJECT_ID
: the project ID for the request.ZONE
: for a zonal MIG, the zone where the MIG is located.
zones/ZONE
with regions/REGION
and specify the region of the MIG.MIG_NAME
: the name of the MIG in which to start an instance.INSTANCE_NAME_URL
: the URL of the instance to start—for example, zones/us-central1-a/instances/example-instance-name1
. To start multiple instances, provide a comma-separated list of URLs—for example, "zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2"
.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 guide provides instructions on how to suspend, stop, resume, and start virtual machines (VMs) within a managed instance group (MIG)."],["You can suspend or stop running VMs in a MIG using the Google Cloud console, the gcloud CLI, or the Compute Engine API, and resume or start them back."],["The gcloud CLI commands `suspend-instances`, `stop-instances`, `resume-instances`, and `start-instances` are used to manage VM states within a MIG."],["The Compute Engine API provides methods like `suspendInstances`, `stopInstances`, `resumeInstances`, and `startInstances` for managing VMs in MIGs, and the process differs depending if the MIG is regional or zonal."],["Authentication is required to interact with the Google Cloud Services and APIs, and the document provides instructions on setting it up, based on whether you are using the Console, gcloud CLI or REST API."]]],[]]
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