Allowing and denying availability zone shutdown
If an availability zone is under maintenance or shows signs of failure, Yandex Cloud technicians may temporarily shut down that zone. In which case the load balancer will automatically redistribute traffic among the remaining zones. As soon as the zone is back on track, it gets re-enabled, and uniform traffic distribution is resumed.
You can allow or deny auto-disabling an availability zone. However, you cannot select a particular zone to disable. Before allowing the automatic mode, you can try disabling different availability zones.
By default, availability zone shutdown is not allowed.
Allowing availability zone shutdown
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.
When creating or updating an L7 load balancer, specify the --allow-zonal-shift parameter, e.g.:
yc application-load-balancer load-balancer update \
<load_balancer_name_or_ID> \
--allow-zonal-shift
Result:
id: ds70q425egoe********
name: my-balancer
...
allow_zonal_shift: true
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
-
In the configuration file, specify the
allow_zonal_shiftparameter set totruein theyandex_alb_load_balancerresource description:resource "yandex_alb_load_balancer" "my-balancer" { ... allow_zonal_shift = true ... } -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will change all required resources. You can check the update in the management console
.Timeouts
The Terraform provider limits operations with Application Load Balancer load balancers to 10 minutes.
Operations in excess of this time will be interrupted.
How do I modify these limits?
Add the
timeoutssection to the load balancer description, e.g.:resource "yandex_alb_load_balancer" "<load_balancer_name>" { ... timeouts { create = "60m" update = "60m" delete = "60m" } } -
For more information about yandex_alb_load_balancer properties, see this Terraform article.
To allow zonal shift when creating an L7 load balancer, use the create REST API method for the LoadBalancer resource and set "allowZonalShift": "true", or use the LoadBalancerService/Create gRPC API call and set "allow_zonal_shift": "true".
To allow zonal shift when updating an L7 load balancer, use the update REST API method for the LoadBalancer resource and specify "allowZonalShift": "true", or use the LoadBalancerService/Update gRPC API call with "allow_zonal_shift": "true".
Denying availability zone shutdown
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.
When creating or updating an L7 load balancer, specify the --allow-zonal-shift=false parameter, e.g.:
yc application-load-balancer load-balancer update \
<load_balancer_name_or_ID> \
--allow-zonal-shift=false
Result:
id: ds70q425egoe********
name: my-balancer
...
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
-
In the configuration file, specify the
allow_zonal_shiftparameter set tofalsein theyandex_alb_load_balancerresource description:resource "yandex_alb_load_balancer" "my-balancer" { ... allow_zonal_shift = false ... } -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will change all required resources. You can check the update in the management console
.Timeouts
The Terraform provider limits operations with Application Load Balancer load balancers to 10 minutes.
Operations in excess of this time will be interrupted.
How do I modify these limits?
Add the
timeoutssection to the load balancer description, e.g.:resource "yandex_alb_load_balancer" "<load_balancer_name>" { ... timeouts { create = "60m" update = "60m" delete = "60m" } } -
For more information about yandex_alb_load_balancer properties, see this Terraform article.
To deny zonal shift when creating an L7 load balancer, use the create REST API method for the LoadBalancer resource and set "allowZonalShift": "false", or use the LoadBalancerService/Create gRPC API call and set "allow_zonal_shift": "false".
To deny zonal shift when updating an L7 load balancer, use the update REST API method for the LoadBalancer resource and specify "allowZonalShift": "false", or use the LoadBalancerService/Update gRPC API call with "allow_zonal_shift": "false".