Turn off repairs in a MIG

Preview — Action on failed health check

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

This document describes how to turn off repairs of failed and unhealthy VMs in amanaged instance group (MIG) and, if already turned off, how to configure theMIG to repair VMs.

By default, a MIG automatically repairs a failed VM in the group by recreatingthat VM. If you've configured an application-based health check, then the MIGalso repairs unhealthy VMs on which your application fails the healthcheck. Repairing a VM based on an application-based health check is also calledautohealing.

If you don't want a MIG to repair a failed VM or an unhealthy VM, you can turnoff repairs in the MIG. Turning off repairs is useful in scenarios when you wantto troubleshoot a failed VM, implement your own repair logic, or monitorapplication health without repairing unhealthy VMs.

To check whether repairs are already turned off in a MIG,check the repair configuration in a MIG.

For more information about repairs in a MIG, seeAbout repairing VMs for high availability.

Before you begin

Turn off repairs in a MIG

When you turn off repairs in a MIG, by default, both failed VM repairs andautohealing are turned off. If you only want to turn off autohealing, seeTurn off autohealing.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.update on the managed instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Click the name of the MIG in which you want to turn off repair.

  3. ClickEdit.

  4. ClickInstance lifecycle and autohealing to expand the section.

    1. In theAction on failure section, set theDefault action onfailure field toNo action.
    2. If you've configured autohealing and don't want the MIG to turn offautohealing, then in theAutohealing section, set theOn failed health check field toRepair instance.
  5. ClickSave.

gcloud

To turn off repairs in a MIG, then use theupdate commandas follows. This turns off autohealing by default.

gcloud compute instance-groups managed updateMIG_NAME \    --default-action-on-vm-failure=do-nothing \    --zone=ZONE

If autohealing is configured in the MIG and you don't want to turn offautohealing by default, use thebetaupdate commandto set the--action-on-vm-failed-health-check flag torepair. This ensures that autohealing of unhealthy VMs continues to workeven if repairing failed VMs is turned off.

gcloud beta compute instance-groups managed updateMIG_NAME \    --default-action-on-vm-failure=do-nothing \    --action-on-vm-failed-health-check=repair \    --zone=ZONE

Replace the following:

  • MIG_NAME: the name of the instance group.
  • ZONE: the zone where your MIG is located. For aregional MIG, use the--region=REGION flag.

REST

To turn off repairs in a MIG, then use the API methods as follows.This turns off autohealing by default.

For example, make the following call in a zonal MIG. This turns offautohealing by default.

PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME{  "instanceLifecyclePolicy":    {      "defaultActionOnFailure": "DO_NOTHING"    }  }

If autohealing is configured in the MIG and you don't want to turn offautohealing by default, use the API methods as follows to set theonFailedHealthCheck flag toREPAIR. This ensures that autohealing ofunhealthy VMs continues to work even if repairing failed VMs is turned off.

For example, make the following call in a zonal MIG:

PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME{  "instanceLifecyclePolicy":    {      "defaultActionOnFailure": "DO_NOTHING",      "onFailedHealthCheck": "REPAIR"    }  }

Replace the following:

  • PROJECT_ID: yourproject ID.
  • MIG_NAME: the name of the MIG.
  • ZONE: the zone where the MIG is located. For aregional MIG, useregions/REGION in the URL.

Limitations

If a MIG has any of the following, then you cannot turn off the repairs inthe MIG by setting thedefaultActionOnFailure field toDO_NOTHING:

Turn off autohealing

When you've configured an application health check in a MIG, if you don't wantthe MIG to repair any unhealthy VMs, you can turn off autohealing separately.This doesn't turn off repairs of failed VMs.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.update on the managed instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Click the name of the MIG in which you want to turn off autohealing.

  3. ClickEdit.

  4. ClickInstance lifecycle and autohealing to expand the section.

  5. In theAutohealing section, set theOn failed health check fieldtoNo action.

  6. ClickSave.

gcloud

To turn off autohealing in a MIG, use thebetaupdate commandand set the--action-on-vm-failed-health-check flag todo-nothing.

For example, use the following command for a zonal MIG:

gcloud beta compute instance-groups managed updateMIG_NAME \    --action-on-vm-failed-health-check=do-nothing \    --zone=ZONE

Replace the following:

  • MIG_NAME: the name of the MIG.
  • ZONE: the zone where the MIG is located. For aregional MIG, use the--region=REGION flag.

REST

To turn off autohealing in a MIG, use the API methods as follows andset the--action-on-vm-failed-health-check flag todo-nothing.

For example, make the following request to turn off autohealing in azonal MIG:

POST https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers{  "instanceLifecyclePolicy":   {     "onFailedHealthCheck": "DO_NOTHING"   }}

Replace the following:

  • PROJECT_ID: yourproject ID.
  • ZONE: The zone where the MIG is located. For aregional MIG, useregions/REGION in the URL.
  • MIG_NAME: the name of the instance group.

Turn on repairs or autohealing

By default, a MIG repairs failed VMs and, if autohealing is configured, the MIGalso repairs unhealthy VMs. If you've turned off repairs or autohealing or both,you can turn them back on again.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instanceGroupManagers.update on the managed instance group

Console

  1. In the Google Cloud console, go to theInstance groups page.

    Go to Instance groups

  2. Click the name of the MIG in which you want to turn on repair.

  3. ClickEdit.

  4. ClickInstance lifecycle and autohealing to expand the section.

    • To repair failed VMs, in theAction on failure section, set theDefault action on failure field toRepair instance.
    • To repair unhealthy VMs, in theAutohealing section, set theOn failed health check field toRepair instance. If you setthis value toDefault action, then autohealing uses the samesetting that you configure for theDefault action on failurefield.
  5. After you finish, clickSave to apply the changes.

gcloud

To turn on repairs in a MIG, use theupdate command.This also turns on autohealing, if the value of the--action-on-vm-failed-health-check flag isdefault-action.

gcloud compute instance-groups managed updateMIG_NAME \    --default-action-on-vm-failure=repair

If you've turned off autohealing separately and you want to turn it back onagain, use thebetaupdate command:

gcloud beta compute instance-groups managed updateMIG_NAME \    --action-on-vm-failed-health-check=default-action ORrepair

Replace the following:

  • MIG_NAME with the name of a MIG.
  • default-action ORrepair: If youwant autohealing to use the same setting that you configure for repairs offailed VMs, set the value todefault-action. For example, when you turnoff repairing of failed VMs, the MIG turns off autohealing also. If youwant to control repairs of unhealthy VMs separately, set the value torepair.

REST

To turn on repairs in a MIG, use the API method as follows. This also turnson autohealing, if the value of theonFailedHealthCheck field isDEFAULT_ACTION.

For example, make the following request in a zonal MIG:

    PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME    {      "instanceLifecyclePolicy": {        "defaultActionOnFailure": "REPAIR"      }    }

If you've turned off autohealing separately and you want to turn it back onagain, use the beta API method as follows:

  PATCH https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instanceGroupManagers/MIG_NAME  {    "instanceLifecyclePolicy": {      "onFailedHealthCheck": "DEFAULT_ACTION ORREPAIR"    }  }

Replace the following:

  • PROJECT_ID: yourproject ID.
  • ZONE: the zone where your MIG is located. For aregional MIG, useregions/REGION in the URL.
  • MIG_NAME: the name of the MIG.
  • DEFAULT_ACTION ORREPAIR: If youwant autohealing to use the same setting as for repairs of failed VMs,set the value toDEFAULT_ACTION. For example, when you turn offrepairing of failed VMs, the MIG turns off autohealing also. If you wantto configure autohealing separately, set the value toREPAIR.

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.