[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Managing an instance group > Disabling and enabling availability zones for an instance group

# Disabling and enabling availability zones for a Yandex Compute Cloud instance group

In Compute Cloud, you can temporarily disable one or more [availability zones](../../../overview/concepts/geo-scope.md) for an [instance group](../../concepts/instance-groups/index.md). This helps maintain your services available during events affecting the availability zone, such as testing, maintenance, outages, or [incidents](../../concepts/instance-groups/zonal-inc/overview.md).

> For example, disabling a zone for an instance group prevents _gray failures_ in that zone, i.e., situations where health checks and monitoring tools show no failures, yet a portion of the actual traffic fails to reach your instances there.
> 
> Also, a good practice is to temporarily disable a zone during a zonal incident, allowing you to gradually reintroduce instances from the affected zone in a controlled manner once the incident is over. See [Instance group in a temporarily disabled zone during an incident](../../concepts/instance-groups/disable-enable-zone.md#zonal-inc-shift) for details.

{% note warning %}

You cannot temporary disable zones for instance groups created by a [Managed Service for Kubernetes cluster](../../../managed-kubernetes/concepts/index.md#kubernetes-cluster) as its node groups.

{% endnote %}

You can re-enable a group’s availability zone at any time or set a timeout for automatic reactivation.

For more on what you get when disabling an availability zone, see [Temporarily disabling availability zones for Yandex Compute Cloud instance groups](../../concepts/instance-groups/disable-enable-zone.md).

## Enabling a zonal shift {#disable}

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the command to disable an availability zone:

      ```bash
      yc compute instance-group disable-zones --help
      ```

  1. Get a list of all instance groups in the default folder:

      ```bash
      yc compute instance-group list
      ```

      Result:

      ```text
      +----------------------+----------------------+--------+------+
      |          ID          |         NAME         | STATUS | SIZE |
      +----------------------+----------------------+--------+------+
      | amc65sbgfqeq******** | test-group           | ACTIVE |    3 |
      | cl1cvs4firjj******** | catsf2nfq0mh******** | ACTIVE |    1 |
      +----------------------+----------------------+--------+------+
      ```

  1. Disable one or more availability zones for the group:

      ```bash
      yc compute instance-group disable-zones \
        --id <instance_group_ID> \
        --zones=<zone_1_ID>,[<zone_2_ID>] \
        --duration=<duration> 
      ```

      Where:
      * `--id`: Instance group ID.
      * `--zones`: Availability zone IDs, e.g., `ru-central1-a`.
      * `--duration`: Duration, from `1m` to `72h`. No value stands for unlimited duration. If zones are provided as a list, they all will be disabled for the specified period.

{% endlist %}

## Disabling a zonal shift {#enable}

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the command to enable an availability zone:

      ```bash
      yc compute instance-group enable-zones --help
      ```

  1. Get a list of all instance groups in the default folder:

      ```bash
      yc compute instance-group list
      ```

      Result:

      ```text
      +----------------------+----------------------+--------+------+
      |          ID          |         NAME         | STATUS | SIZE |
      +----------------------+----------------------+--------+------+
      | amc65sbgfqeq******** | test-group           | ACTIVE |    3 |
      | cl1cvs4firjj******** | catsf2nfq0mh******** | ACTIVE |    1 |
      +----------------------+----------------------+--------+------+
      ```

  1. Enable one or more availability zones for the group:

      ```bash
      yc compute instance-group enable-zones \
        --id <instance_group_ID> \
        --zones=<zone_1_ID>,[<zone_2_ID>]
      ```

      Where:
      * `--id`: Instance group ID.
      * `--zones`: Availability zone IDs, e.g., `ru-central1-a`.

{% endlist %}

## Viewing the availability zone status and time before activation {#check}

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  Run the command below and specify the instance group ID:

  ```bash
  yc compute instance-group get \
    --id <instance_group_ID>
  ```

  Result:

  ```text
  id: amc65sbgfqeq********
  ...
  disable_zone_statuses:
    - zone_id: ru-central1-a
    - zone_id: ru-central1-b
      disabled_until: "2025-06-06T04:10:02.679608678Z"
  ```

  Where `disabled_until` indicates the availability zone auto-activation time.

{% endlist %}

### Useful links {#see-also}

* [Temporarily disabling availability zones for Yandex Compute Cloud instance groups](../../concepts/instance-groups/disable-enable-zone.md)
* [Disabling and enabling availability zones in Yandex Network Load Balancer](../../../network-load-balancer/operations/manage-zone/disable-enable-zone.md)
* [Disabling and enabling availability zones in Yandex Application Load Balancer](../../../application-load-balancer/operations/manage-zone/start-and-cancel-shift.md)
* [Yandex Compute Cloud instance groups during a zonal incident](../../concepts/instance-groups/zonal-inc/overview.md)