Enabling and disabling an availability zone
If an availability zone is under maintenance or fails, Yandex Cloud technicians may temporarily disable that zone.
You can also manually disable one or more availability zones to address the following scenarios:
-
Reducing load during localized issues, e.g., after a faulty app release on your backend or an incident caused by high traffic or misconfiguration. Temporarily disabling the affected zone helps prevent service disruption or quickly restore app functionality for your users.
-
Testing the resilience of your load balancer and traffic failover mechanisms. This way, you can proactively identify potential weaknesses, apply fixes, and optimize your load balancer settings in advance.
Disabling an availability zone
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.
-
View the command description:
yc application-load-balancer load-balancer disable-zones --help -
To start redistributing traffic, disable the availability zone and specify the deactivation time:
yc application-load-balancer load-balancer disable-zones \ <load_balancer_name_or_ID> \ --zones <availability_zones> --duration <deactivation_time>Where:
-
<load_balancer_name_or_ID>: Load balancer ID or name. -
--zones: Availability zones to disable, separated by commas. -
--duration: Time from1mto72hwhen the zone will be disabled.After the specified time elapses, the zone will automatically return to its initial state (enabled) for the CLI and API. These settings will be applied without your intervention.
If this parameter is not specified, the zone will remain disabled until you enable it manually.
Here is an example:
yc application-load-balancer load-balancer disable-zones \ my-balancer \ --zones ru-central1-a \ --duration 1hResult:
id: ds70q425egoe******** name: my-balancer ... allocation_policy: locations: - zone_id: ru-central1-a subnet_id: e2lptlobccu6******** zonal_shift_active: true zonal_traffic_disabled: true - zone_id: ru-central1-b subnet_id: e9bo5ir5prfi******** ... -
To disable an availability zone, use the DisableZones REST API method for the LoadBalancer resource or the LoadBalancerService/DisableZones gRPC API call.
Viewing the availability zone activation time
-
In the management console
, select the folder with your load balancer. -
From the list of services, select Application Load Balancer and then select the load balancer you need.
-
Under Allocation, next to the availability zone, view its status.
If you set the deactivation duration, you will see the end time next to the zone.
Enabling an availability zone
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 command to enable an availability zone:
yc application-load-balancer load-balancer enable-zones --help -
Enable an availability zone:
yc application-load-balancer load-balancer enable-zones \ <load_balancer_name_or_ID> \ --zones <availability_zones>Here is an example:
yc application-load-balancer load-balancer enable-zones \ my-balancer \ --zones ru-central1-aResult:
id: ds70q425egoe******** name: my-balancer ... allocation_policy: locations: - zone_id: ru-central1-a subnet_id: e9bo5ir5prfi******** - zone_id: ru-central1-b subnet_id: e2lptlobccu6******** ...
To enable an availability zone, use the EnableZones REST API method for the LoadBalancer resource or the LoadBalancerService/EnableZones gRPC API call.
Note
Previously, the start-zonal-shift and cancel-zonal-shift CLI commands and the StartZonalShift and CancelZonalShift API methods were used to enable and disable availability zones. They are now deprecated and will soon be removed.