This document describes how to allow a regional managed instance group (MIG) to repair a virtual machine (VM) instance in an alternate zone when the MIG cannot repair the VM in its original zone. To learn more about repairs in a MIG, see About repairing VMs for high availability.
When you create a regional MIG, you select one or more zones where the MIG distributes its VMs. By default, if a VM in the MIG fails, the MIG tries to repair that VM in its original zone. You can optionally allow the MIG to repair that VM in one of the other selected zones, which is useful in cases where the MIG cannot repair the VM in its original zone. The MIG picks the alternate zone based on available capacity and quota.
Limitations
When you configure a regional MIG to repair a VM in alternate zone, the following limitations apply:
You must enable update on repair.
Regional MIGs with the following configuration aren't supported:
MIGs with
EVENorANY_SINGLE_ZONEtarget distribution shapes.MIGs with stateful configuration.
Before you begin
-
If you haven't already, set up authentication.
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:
gcloud initIf you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- Set a default region and zone.
Terraform
To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
-
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.