Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for Valkey™
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Valkey™ version upgrade
      • Working with Valkey™ modules
      • Stopping and starting a cluster
      • Managing cluster hosts
      • Migrating hosts to a different availability zone
      • Managing backups
      • Deleting a cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Clusters
  3. Migrating hosts to a different availability zone

Migrating Valkey™ cluster hosts to a different availability zone

Written by
Yandex Cloud
Updated at January 22, 2026

Note

Clusters with hosts residing in the ru-central1-d availability zone do not support:

  • Intel Broadwell
  • Local SSD storage if using Intel Cascade Lake

Yandex Managed Service for Valkey™ cluster hosts reside in Yandex Cloud availability zones. To migrate hosts from one availability zone to another, add hosts in the target availability zone to the cluster and delete hosts in the source availability zone:

  1. Create a subnet in your target availability zone.

  2. If your cluster uses the b2.medium or b3-c1-m4 host class, change it. Otherwise, you will not be able to add hosts to the cluster and perform migration.

    The cluster is unavailable for about five to seven minutes after changing the host class.

    You can revert to the previous host class after the migration is complete.

  3. Add a host to your cluster:

    Management console
    CLI
    Terraform
    REST API
    gRPC API
    1. Go to Yandex Managed Service for Valkey™.

    2. Click the cluster name and navigate to the Hosts tab.

    3. Click  Create host.

    4. Specify the following host settings:

      • Availability zone to move your hosts to.
      • New subnet.
      • Select Public access to make the host accessible from outside Yandex Cloud, if required.
    5. 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.

    Run this command:

    yc managed-redis host add \
       --cluster-name <cluster_name> \
       --host zone-id=<availability_zone>,`
             `subnet-id=<new_subnet_ID>,`
             `assign-public-ip=<allow_public_access_to_host>
    

    You can get the cluster name with the list of clusters in the folder.

    In the zone-id argument, specify the target availability zone for your hosts.

    1. Add a host manifest to the Terraform configuration file describing your infrastructure:

      resource "yandex_mdb_redis_cluster_v2" "<cluster_name>" {
        ...
        host {
          zone             = "<availability_zone>"
          subnet_id        = "<new_subnet_ID>"
          assign_public_ip = <allow_public_access_to_host>
        }
      }
      

      In the zone attribute, specify the target availability zone for your hosts.

    2. Make sure the settings are correct.

      1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

      2. Run this command:

        terraform validate
        

        Terraform will show any errors found in your configuration files.

    3. Confirm updating the resources.

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

    1. Get an IAM token for API authentication and save it as an environment variable:

      export IAM_TOKEN="<IAM_token>"
      
    2. Call the Cluster.AddHosts method, e.g., via the following cURL request:

      curl \
          --request POST \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --header "Content-Type: application/json" \
          --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts:batchCreate' \
          --data '{
                    "hostSpecs": [
                      {
                        "zoneId": "<availability_zone>",
                        "subnetId": "<subnet_ID>",
                        "shardName": "<shard_name>",
                        "replicaPriority": "<host_priority>",
                        "assignPublicIp": <allow_public_access_to_host>
                      }
                    ]
                  }'
      

      Where hostSpecs sets the host parameters:

      • zoneId: Availability zone.
      • subnetId: Subnet ID. Specify it if the selected availability zone has two or more subnets.
      • shardName: Shard name for the host. Only used if cluster sharding is enabled.
      • replicaPriority: Host priority for promotion to master if the primary master fails.
      • assignPublicIp: Internet access to the host via a public IP address, true or false. You can only enable public access if your cluster supports TLS.

      You can get the cluster ID with the list of clusters in the folder.

    3. Check the server response to make sure your request was successful.

    1. Get an IAM token for API authentication and save it as an environment variable:

      export IAM_TOKEN="<IAM_token>"
      
    2. Clone the cloudapi repository:

      cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
      

      Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

    3. Call the ClusterService.AddHosts method, e.g., via the following gRPCurl request:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                "cluster_id": "<cluster_ID>",
                "host_specs": [
                  {
                    "zone_id": "<availability_zone>",
                    "subnet_id": "<subnet_ID>",
                    "shard_name": "<shard_name>",
                    "replica_priority": "<host_priority>",
                    "assign_public_ip": <allow_public_access_to_host>
                  }
                ] 
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.redis.v1.ClusterService.AddHosts
      

      Where host_specs sets the host parameters:

      • zone_id: Availability zone.
      • subnet_id: Subnet ID. Specify it if the selected availability zone has two or more subnets.
      • shard_name: Shard name for the host. Only used if cluster sharding is enabled.
      • replica_priority: Host priority for assignment as a master if the primary master fails.
      • assign_public_ip: Internet access to the host via a public IP address, true or false. Public access is only a possibility if the cluster has TLS support enabled.

      You can get the cluster ID from the folder’s cluster list.

    4. Check the server response to make sure your request was successful.

  4. To connect to the database after migration, specify the new host’s FQDN in your backend or client, e.g., in your application code or graphical IDE. Delete the original host's FQDN in your source availability zone.

    To get the FQDN, request the list of hosts in the cluster:

    yc managed-redis host list --cluster-name <cluster_name>
    

    You will see the FQDN under NAME in the command output.

  5. Delete the hosts in the source availability zone:

    Management console
    CLI
    Terraform
    REST API
    gRPC API
    1. Go to Yandex Managed Service for Valkey™.
    2. Click the cluster name and select the Hosts tab.
    3. Click in the host row, select Delete, and confirm the deletion.

    Run the following command for each host:

    yc managed-redis host delete <host_FQDN> --cluster-name <cluster_name>
    
    1. In your Terraform infrastructure configuration file, delete the host resource sections with the source availability zone from your cluster description.

    2. Make sure the settings are correct.

      1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

      2. Run this command:

        terraform validate
        

        Terraform will show any errors found in your configuration files.

    3. Type yes and press Enter.

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

    1. Get an IAM token for API authentication and save it as an environment variable:

      export IAM_TOKEN="<IAM_token>"
      
    2. Call the Cluster.DeleteHosts method, e.g., via the following cURL request:

      curl \
          --request POST \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --header "Content-Type: application/json" \
          --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts:batchDelete' \
          --data '{
                    "hostNames": [ "<host_name>" ]
                  }'
      

      Where hostNames is the name of the host to delete. To find out the name, get a list of hosts in the cluster.

      You can get the cluster ID with a list of clusters in the folder.

    3. View the server response to make sure the request was successful.

    1. Get an IAM token for API authentication and save it as an environment variable:

      export IAM_TOKEN="<IAM_token>"
      
    2. Clone the cloudapi repository:

      cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
      

      Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

    3. Call the ClusterService.DeleteHosts method, e.g., via the following gRPCurl request:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                "cluster_id": "<cluster_ID>",
                "host_names": [ "<host_name>" ]
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.redis.v1.ClusterService.DeleteHosts
      

      Where host_names is the name of the host to delete. To find out the name, get the list of hosts in the cluster.

      You can get the cluster ID with the list of clusters in the folder.

    4. Check the server response to make sure your request was successful.

  6. Wait for the cluster state to change to Alive. In the management console, navigate to the folder dashboard and select Yandex Managed Service for Valkey™. You can see the cluster state in the Availability column.

Was the article helpful?

Previous
Managing cluster hosts
Next
Managing backups
© 2026 Direct Cursus Technology L.L.C.