Manually suspend or stop VMs in a MIG Stay organized with collections Save and categorize content based on your preferences.
This document explains how to suspend and stop virtual machine (VM) instancesin a managed instance group (MIG), and how to resume their operation.
Before you begin
- Review the introductory page aboutsuspended and stopped VMs in a MIG.
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
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.- Set a default region and zone.
REST
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:
gcloudinit
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.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Suspend specific VMs in a MIG
You can suspend a running VM in a MIG using the Google Cloud console,the Google Cloud CLI, or the Compute Engine API.
Console
- In the Google Cloud console, go to theInstance groups page.
- Click the instance group name where you want to suspend VMs.
- In the instance groupOverview page, underVM instances,select all the VMs that you want to suspend.
- ClickSuspend.
- In the confirmation dialog that appears, clickSuspend to confirm.
gcloud
Use theinstance-groups managed suspend-instances command.
gcloud compute instance-groups managed suspend-instancesMIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME: the name of the MIG in whichto suspend an instance.INSTANCE_NAME: the name of theinstance to suspend. To suspend multiple instances, provide acomma-separated list of names.REGION: for a regional MIG, the regionwhere the MIG is located.ZONE: for a zonal MIG, the zonewhere the MIG is located.
REST
Use theinstanceGroupManager.suspendInstances methodand specify the instances in the request body.For regional MIGs, use theregionInstanceGroupManager.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, thezone where the MIG is located.- For a regional MIG, replace
zones/ZONEwithregions/REGIONand specify the region ofthe MIG.
- For a regional MIG, replace
MIG_NAME: the name of the MIG in which to suspendan instance.INSTANCE_NAME_URL: the URL of theinstance to suspend—for example,zones/us-central1-a/instances/example-instance-name1. To suspendmultiple instances, provide a comma-separated list of URLs—forexample,"zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2".
Resume selected VMs in a MIG
You can resume a suspended VM in a MIG using the Google Cloud console,the gcloud CLI, or the Compute Engine API.
Console
- In the Google Cloud console, go to theInstance groups page.
- Click the instance group name where you want to resume VMs.
- In the instance groupOverview page, underVM instances,select all the suspended VMs that you want to resume,then clickStart/Resume.
gcloud
Use theinstance-groups managed resume-instances command.
gcloud compute instance-groups managed resume-instancesMIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME: the name of the MIG in whichto resume an instance.INSTANCE_NAME: the name of theinstance to resume. To resume multiple instances, provide acomma-separated list of names.REGION: for a regional MIG, the regionwhere the MIG is located.ZONE: for a zonal MIG, the zonewhere the MIG is located.
REST
Use theinstanceGroupManager.resumeInstances methodand specify the instances in the request body.For regional MIGs, use theregionInstanceGroupManager.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, thezone where the MIG is located.- For a regional MIG, replace
zones/ZONEwithregions/REGIONand specify the region ofthe MIG.
- For a regional MIG, replace
MIG_NAME: the name of the MIG in which to resumean instance.INSTANCE_NAME_URL: the URL of theinstance to resume—for example,zones/us-central1-a/instances/example-instance-name1. To resume multipleinstances, provide a comma-separated list of URLs—forexample,"zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2".
Stop selected VMs in a MIG
You can stop a running VM in a MIG using the Google Cloud console,the Google Cloud CLI, or the Compute Engine API.
Console
- In the Google Cloud console, go to theInstance groups page.
- Click the instance group name where you want to stop VMs.
- In the instance groupOverview page, underVM instances,select all the VMs that you want to stop, then clickStop. If there isnoStop option, clickMore actions >Stop.
- In the confirmation dialog that appears, clickStop to confirm.
gcloud
Use theinstance-groups managed stop-instances command.
gcloud compute instance-groups managed stop-instancesMIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME: the name of the MIG in whichto stop an instance.INSTANCE_NAME: the name of theinstance to stop. To stop multiple instances, provide acomma-separated list of names.REGION: for a regional MIG, the regionwhere the MIG is located.ZONE: for a zonal MIG, the zonewhere the MIG is located.
REST
Use theinstanceGroupManager.stopInstances methodand specify the instances in the request body.For regional MIGs, use theregionInstanceGroupManager.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, thezone where the MIG is located.- For a regional MIG, replace
zones/ZONEwithregions/REGIONand specify the region ofthe MIG.
- For a regional MIG, replace
MIG_NAME: the name of the MIG in which to stopan instance.INSTANCE_NAME_URL: the URL of theinstance to stop—for example,zones/us-central1-a/instances/example-instance-name1. To stop multipleinstances, provide a comma-separated list of URLs—forexample,"zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2".
Start selected VMs in a MIG
You can start a stopped VM in a MIG using the Google Cloud console,the gcloud CLI, or the Compute Engine API.
Console
- In the Google Cloud console, go to theInstance groups page.
- Click the instance group name where you want to start VMs.
- In the instance groupOverview page, underVM instances,select all the stopped VMs that you want to start,then clickStart/Resume.
gcloud
Use theinstance-groups managed start-instances command.
gcloud compute instance-groups managed start-instancesMIG_NAME \ --instances=INSTANCE_NAME \ [--region=REGION | --zone=ZONE]
Replace the following:
MIG_NAME: the name of the MIG in whichto start an instance.INSTANCE_NAME: the name of theinstance to start. To start multiple instances, provide acomma-separated list of names.REGION: for a regional MIG, the regionwhere the MIG is located.ZONE: for a zonal MIG, the zonewhere the MIG is located.
REST
Use theinstanceGroupManager.startInstances methodand specify the instances in the request body.For regional MIGs, use theregionInstanceGroupManager.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, thezone where the MIG is located.- For a regional MIG, replace
zones/ZONEwithregions/REGIONand specify the region ofthe MIG.
- For a regional MIG, replace
MIG_NAME: the name of the MIG in which to startan instance.INSTANCE_NAME_URL: the URL of theinstance to start—for example,zones/us-central1-a/instances/example-instance-name1. To start multipleinstances, provide a comma-separated list of URLs—forexample,"zones/us-central1-a/instances/example-instance-name1","zones/us-central1-a/instances/example-instance-name2".
What's next
- Learn how toaccelerate scale out with the standby pool.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.