Enabling and disabling availability zones
If an availability zone is under testing or maintenance or has technical problems, you can block traffic distribution to that zone. This will ensure your services stay operational. When appropriate, you can run a command to resume traffic to the blocked zone or it will be restored automatically by timeout.
You can enable and disable availability zones one by one or as a comma-separated list.
Disabling availability zones
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the availability zone disable command for a network load balancer:
yc load-balancer network-load-balancer disable-zones --help -
Get a list of all network load balancers in the default folder:
yc load-balancer network-load-balancer listResult:
+----------------------+-------------+-------------+----------+----------------+------------------------+--------+ | ID | NAME | REGION ID | TYPE | LISTENER COUNT | ATTACHED TARGET GROUPS | STATUS | +----------------------+-------------+-------------+----------+----------------+------------------------+--------+ | ds70q425egoe******** | my-balancer | ru-central1 | EXTERNAL | 1 | enpakget56sr******** | ACTIVE | | | | | | | enpakf7vhj2l******** | | | fw7fh46bnsge******** | my-nlb2 | ru-central1 | EXTERNAL | 1 | sn5u68knmswe******** | ACTIVE | +----------------------+-------------+-------------+----------+----------------+------------------------+--------+ -
Disable one or more availability zones using the following command:
yc load-balancer network-load-balancer disable-zones \ <load_balancer_name_or_ID> \ --zones=<zone_1_ID>,[<zone_2_ID>] \ --duration=<duration>Where:
--zones: Availability zone IDs.--duration: Duration, from1mto72h. No value stands for unlimited duration. If zones are provided as a list, they all will be disabled for the specified period.
Note
You cannot run the zone disable command more often than once every two minutes.
Examples
Disabling two availability zones
To disable two zones for a load balancer, list them separated by commas:
yc load-balancer network-load-balancer disable-zones ds70q425egoe******** \
--zones=ru-central1-b,ru-central1-d
Result:
id: ds70q425egoe********
...
disable_zone_statuses:
- zone_id: ru-central1-b
- zone_id: ru-central1-d
Disabling an availability zone for 30 minutes
To disable a single availability zone for 30 minutes, use the --duration parameter:
yc load-balancer network-load-balancer disable-zones ds70q425egoe******** \
--zones=ru-central1-b \
--duration=30m
Result:
id: ds70q425egoe********
...
disable_zone_statuses:
- zone_id: ru-central1-b
disabled_until: "2025-06-06T04:10:02.679608678Z"
You can extend the zone lock by running the above command with the --duration parameter once again for the same zone.
Enabling availability zones
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the availability zone enable command for a network load balancer:
yc load-balancer network-load-balancer enable-zones --help -
Get a list of all network load balancers in the default folder:
yc load-balancer network-load-balancer listResult:
+----------------------+-------------+-------------+----------+----------------+------------------------+--------+ | ID | NAME | REGION ID | TYPE | LISTENER COUNT | ATTACHED TARGET GROUPS | STATUS | +----------------------+-------------+-------------+----------+----------------+------------------------+--------+ | ds70q425egoe******** | my-balancer | ru-central1 | EXTERNAL | 1 | enpakget56sr******** | ACTIVE | | | | | | | enpakf7vhj2l******** | | | fw7fh46bnsge******** | my-nlb2 | ru-central1 | EXTERNAL | 1 | sn5u68knmswe******** | ACTIVE | +----------------------+-------------+-------------+----------+----------------+------------------------+--------+ -
Enable one or more availability zones:
yc load-balancer network-load-balancer enable-zones \ <load_balancer_name_or_ID> \ --zones=<zone_1_ID>,[<zone_2_ID>]Result:
id: ds70q425egoe******** ... allow_zonal_shift: false disable_zone_statuses:
Check availability zone lock settings
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To check if there are any disabled zones and whether a lock period is set, run the following command:
yc load-balancer network-load-balancer get \
<load_balancer_name_or_ID>
Result:
id: ds70q425egoe********
...
disable_zone_statuses:
- zone_id: ru-central1-b
- zone_id: ru-central1-d
disabled_until: "2025-06-06T04:10:02.679608678Z"