Stay organized with collections Save and categorize content based on your preferences.
This document describes how to delete a managed instance group (MIG) that you no longer need so you can stop paying for the resources it uses.
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.
When you delete a managed instance group, all VMs in the group are deleted. If you want to keep any of the VMs, abandon the VMs first to remove those VMs from the group. Then, delete the managed instance group.
The disks in a MIG are deleted only if you had set the disk's auto-delete property to true when defining the disks in the MIG's instance template. If a disk's auto-delete property is set to false, then you can manually clean up the disks when you no longer need them.
Note: You cannot delete an instance group if it is being used by a load balancer's backend service. Remove the backend service before deleting the instance group.When you delete a managed instance group and its instances by using the Google Cloud console or the gcloud CLI, any attached autoscaler is automatically deleted. However, if you use the REST, you must first issue a separate request to delete any attached autoscaler with the autoscalers.delete
method or regionAutoscalers.delete
method. If you happen to delete the managed instance group first, you can still delete the attached autoscaler using REST.
For each disk, you can also override the auto-delete property to specify whether the disk should be deleted when its associated instance is deleted.
Permissions required for this taskTo perform this task, you must have the following permissions:
compute.instanceGroupManagers.delete
on the managed instance groupIn the Google Cloud console, go to the Instance groups page.
Select one or more groups on the list that you want to delete.
Click Delete to delete the group and all of the VMs in the managed instance group.
Use the delete
command.
gcloud compute instance-groups managed delete INSTANCE_GROUP_NAME \ --zone ZONEREST
Call the delete
method for a zonal or regional MIG resource. If the MIG has an attached autoscaler, you must first delete the autoscaler using the autoscalers.delete
method or regionAutoscalers.delete
method.
DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/INSTANCE_GROUP_NAME
If the instance group is a regional managed instance group, replace zones/ZONE
with regions/REGION
.
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 explains how to delete a managed instance group (MIG) and its associated resources to avoid incurring unnecessary costs."],["Deleting a MIG will remove all virtual machines (VMs) within it, unless you choose to abandon specific VMs beforehand."],["Disks within the MIG will only be deleted automatically if their auto-delete property was set to true during the MIG's template configuration, otherwise manual deletion is necessary."],["If a MIG is associated with a load balancer's backend service, the backend service must be removed before deleting the MIG, and any autoscalers attached to the MIG must be deleted separately when using the REST API."],["The process can be done using the Google Cloud Console, gcloud CLI, or REST API, each with specific instructions and requirements."]]],[]]
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