Manage instance replication

This guide shows you how to use Filestore instance replication.

Before you begin

  1. Complete the setup steps needed to use Filestore. Quota for instances varies by project, region, and tier. Ensure you have enough to complete these tasks. For more information, see Quotas or Request a quota increase.

  2. If you haven't already done so, create a Filestore instance. In the context of this guide, this is the source instance.

Create an instance replica

Google Cloud console

  1. In the Google Cloud console, go to the Filestore Instances page.

    Go to Instances

  2. Click the instance ID of the instance you want to replicate.

  3. Click the Replications tab.

  4. Click Create replica.

  5. Click the documentation link to review the supported recovery point objective (RPO) and click Next.

  6. Enter all required fields and optional fields as needed.

    • The specified capacity must be greater than or equal to the source.
    • The following specifications must match the source instance:
    • For reduced risk of data loss, you are encouraged to choose a region and zone unique to the source.
  7. Click Next.

  8. Review the details and click Next.

  9. Click Create.

  10. Wait for the operation to complete. When finished, the replica will be listed under the source instance on the Instances page.

  11. Click the replica's instance ID to view its details.

gcloud

  1. You can create a replica instance by running the filestore instances create command.

    gcloud filestore instances create INSTANCE_ID \
        --source-instance=projects/PROJECT_ID/locations/LOCATION/instances/SOURCE_INSTANCE \
        --project=PROJECT_ID \
        --location=LOCATION \
        --network=name="NETWORK" \
        --tier=TIER \
        --file-share=name="FILE_SHARE_NAME",capacity=FILE_SHARE_SIZE \
    

Where:

  • INSTANCE_ID with the name of the instance that you want to create, such as my-replica.
  • SOURCE_INSTANCE with the name and location of the source instance for which you want to create a replica. For example, projects/my-genomics-project/locations/us-east1-b/instances/my-genomics-instance.
  • PROJECT_ID with the project ID of the Google Cloud project where the source instance is located.
  • LOCATION with the location where you want the replica instance to reside, such as us-central1-a. If the source is in a zonal service tier, you must specify both a region and zone for the replica.
  • NETWORK with the name of the network you want to use, such as default.
  • TIER with the service tier you need, such as ZONAL. The tier and capacity range must match the source.
  • FILE_SHARE_NAME with the name you specify for the NFS file share that is served from the instance, such as vol1.
  • FILE_SHARE_SIZE with the size you want for the file share, such as 1.25TiB.

REST API

  1. Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  2. Use cURL to call the Filestore API:

    curl -s \
      --header "Authorization: Bearer $(gcloud auth print-access-token)" \
      --header "Content-Type: application/json" \
      -d '{"tier": "TIER",
          "networks": { "network": "NETWORK" },
          "file_shares": {"name": "SHARE_NAME","capacity_gb": "CAPACITY"},
          "replication": {"replicas":[{"peer_instance": "projects/PROJECT/locations/ACTIVE_LOCATION/instances/ACTIVE_NAME"}], "role":"standby"},
          "description": "DESCRIPTION" }' \
      "https://file.googleapis.com/v1beta1/projects/PROJECT/locations/REPLICA_LOCATION/instances?instanceId=REPLICA_INSTANCE_NAME"
    

    Where:

    • TIER is the name of the service tier you want to use for the replica. For example, REGIONAL.
    • NETWORK is the name of the network you want to use for the replica. For example, default. You must use the same network as the source.
    • SHARE_NAME is the name of the file share. For example, vol1.
    • CAPACITY is the size, in GiB, you want to allocate for the replica. For example, 1024. Capacity must be greater than or equal to that of the source instance.
    • PROJECT is the name of the project where your replica will reside. For example, my-genomics-project. The source and replica must be located in the same project.
    • ACTIVE_LOCATION is the location where the source resides. For example, us-east1.
    • ACTIVE_NAME is the name of the instance you want to replicate. For example, my-genomics-instance.
    • DESCRIPTION is a description of the replica instance you want to create. For example, My genomics replica.
    • REPLICA_LOCATION is the location where you want the replica to reside. For example, us-central1.
    • REPLICA_INSTANCE_NAME is the name of the replica instance you want to create. For example, my-genomics-replica.

View replica status

Google Cloud console

  1. In the Google Cloud console, go to the Filestore Instances page.

    Go to Instances