Delete a MIG Stay organized with collections Save and categorize content based on your preferences.
This document describes how to delete amanaged instance group (MIG)that you no longer need so you can stop paying for the resources it uses.
Before you begin
- 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.
Delete a MIG
When you delete a managed instance group, all VMs in the group aredeleted. If you want to keep any of the VMs,abandon the VMsfirst to remove those VMs from the group. Then, delete the managed instancegroup.
The disks in a MIG are deleted only if you had set the disk's auto-deleteproperty to true when defining the disks in the MIG's instance template. If adisk's auto-delete property is set to false, then you can manually clean up thedisks when you no longer need them.
Note: You cannot delete an instance group if it is being used by aload balancer'sbackend service.Remove the backend servicebefore deleting the instance group.When you delete a managed instance group and its instances by using theGoogle Cloud console or thegcloud CLI,any attached autoscaler is automatically deleted. However, if you use theREST, youmust first issue a separate request to delete any attached autoscaler with theautoscalers.delete methodorregionAutoscalers.delete method.If you happen to delete the managed instance group first, you can still deletethe attached autoscaler using REST.
For each disk, you can also override the auto-delete property to specify whetherthe disk should be deleted when its associated instance is deleted.
Permissions required for this task
To perform this task, you must have the followingpermissions:
compute.instanceGroupManagers.deleteon the managed instance group
Console
In the Google Cloud console, go to theInstance groups page.
Select one or more groups on the list that you want to delete.
ClickDelete to delete the group and all of the VMs in themanaged instance group.
gcloud
Use thedelete command.
gcloud compute instance-groups managed deleteINSTANCE_GROUP_NAME \ --zoneZONE
REST
Call thedelete method for azonalorregionalMIG resource. If the MIG has an attached autoscaler, you must first deletethe autoscaler using theautoscalers.delete methodorregionAutoscalers.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, replacezones/ZONE withregions/REGION.
What's next
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.