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 begin
- If you want to use the API examples in this guide, set up API access.
- If you want to use the command-line examples in this guide, install the Google Cloud CLI.
Delete a MIG
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.
When you delete a managed instance group and its instances by using the
Google Cloud console or the gcloud CLI,
any attached autoscalers are automatically deleted. However, if you use the
Compute Engine API, you
must first issue separate requests to delete any attached autoscalers with the
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 task
To perform this task, you must have the following permissions:
compute.instanceGroupManagers.deleteon the managed instance group
In the 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.
gcloud compute instance-groups managed delete INSTANCE_GROUP_NAME \ --zone ZONE
If the instance group is a regional managed instance group, replace