Enabling and disabling a zonal shift
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.
Enabling a zonal shift
Warning
If you are using a network or an L7 load balancer in combination with an instance group with autoscaling, before disabling a zone in the load balancer, first, disable this zone for the instance group. Otherwise, the instance group will continue creating instances in a zone which does not receive traffic.
-
In the management console
, navigate to the folder containing your L7 load balancer. -
Go to Application Load Balancer.
-
Select your L7 load balancer.
-
On the Overview page, under Allocation, click Set up zone locks.
-
Enable a zonal shift for one or more zones.
-
Optionally, to set auto-off time for the zonal shift, activate Disable block through and specify a value from
1mto72h. If no time is set, the zonal shift will be on until you disable it manually. -
Click Save.
Your load balancer will start shifting traffic away from inactive availability zones to other 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.
-
View the command description:
yc application-load-balancer load-balancer disable-zones --help -
To start redistributing traffic, enable a zonal shift and specify its duration:
yc application-load-balancer load-balancer disable-zones \ <load_balancer_name_or_ID> \ --zones <availability_zones> --duration <zonal_shift_duration>Where:
-
<load_balancer_name_or_ID>: Load balancer ID or name. -
--zones: Availability zones to shift traffic away from, separated by commas. -
--duration: Zonal shift duration from1mto72h.After this time, the zone will automatically recover. If this parameter is not set, the zonal shift will be on until you disable 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 enable a zonal shift, use the DisableZones REST API method for the LoadBalancer resource or the LoadBalancerService/DisableZones gRPC API call.
Viewing zonal shift off time
-
In the management console
, select the folder with your load balancer. -
Go to Application Load Balancer and select the load balancer.
-
Under Allocation, next to the availability zone, view its status.
If the zonal shift duration has been set, you will see the end time next to the zone.
Disabling a zonal shift
Warning
If you are using a network or an L7 load balancer in combination with an instance group with autoscaling, before enabling a zone in the load balancer, first, enable this zone for the instance group to distribute its instances across the zones.
- In the management console
, navigate to the folder containing your L7 load balancer. - Go to Application Load Balancer.
- Select your L7 load balancer.
- On the Overview page, under Allocation, click Set up zone locks.
- Disable the zonal shift.
- Click Save.
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 description of the command for disabling a zonal shift:
yc application-load-balancer load-balancer enable-zones --help -
Disable a zonal shift:
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 disable a zonal shift, 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 zonal shifts. They are now deprecated and will soon be removed.