Stay organized with collections Save and categorize content based on your preferences.
This document describes how to start and stop Asynchronous Replication.
Asynchronous Replication is useful for low-RPO, low-RTO disaster recovery. To learn more about asynchronous replication, see About Asynchronous Replication.
LimitationsSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
RESTTo use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
Start replication using the Google Cloud console, Google Cloud CLI, REST, or Terraform.
Console Note: If you created a secondary disk using the Google Cloud console, replication started when you created the disk.In the Google Cloud console, go to the Asynchronous replication page.
Click the name of the secondary disk that you want to start replication to.
Click Start replication. The Start replication window opens.
Click Start replication.
Start replication using the gcloud compute disks start-async-replication
command:
gcloud compute disks start-async-replication PRIMARY_DISK_NAME \ --PRIMARY_LOCATION_FLAG=PRIMARY_LOCATION \ --secondary-disk=SECONDARY_DISK_NAME \ --SECONDARY_LOCATION_FLAG=SECONDARY_LOCATION \ --secondary-disk-project=SECONDARY_PROJECT
Replace the following:
PRIMARY_DISK_NAME
: the name of the primary disk.PRIMARY_LOCATION_FLAG
: the location flag for the primary disk. For regional disks, use --region
. For zonal disks, use --zone
.PRIMARY_LOCATION
: The primary disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.SECONDARY_DISK_NAME
: the name of the secondary disk.SECONDARY_LOCATION_FLAG
: the location flag for the secondary disk. For regional disks, use --secondary-disk-region
. For zonal disks, use --secondary-disk-zone
.SECONDARY_LOCATION
: the secondary disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.SECONDARY_PROJECT
: the project that contains the secondary disk.Start replication using one of the following methods:
Start replication for zonal disks using the disks.startAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PRIMARY_DISK_PROJECT/zones/PRIMARY_LOCATION/disks/PRIMARY_DISK_NAME/startAsyncReplication { "asyncSecondaryDisk": "projects/SECONDARY_DISK_PROJECT/SECONDARY_LOCATION_PARAMETER/SECONDARY_LOCATION/disks/SECONDARY_DISK_NAME" }
Start replication for regional disks using the regionDisks.startAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PRIMARY_DISK_PROJECT/regions/PRIMARY_LOCATION/regionDisks/PRIMARY_DISK_NAME/startAsyncReplication { "asyncSecondaryDisk": "projects/SECONDARY_DISK_PROJECT/SECONDARY_LOCATION_PARAMETER/SECONDARY_LOCATION/disks/SECONDARY_DISK_NAME" }
Replace the following:
PRIMARY_DISK_PROJECT
: the project that contains the primary disk.PRIMARY_LOCATION
: The primary disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.PRIMARY_DISK_NAME
: the name of the primary disk.SECONDARY_DISK_PROJECT
: the project that contains the secondary disk.SECONDARY_LOCATION_PARAMETER
: the location parameter for the secondary disk. For regional disks, use regions
. For zonal disks, use zones
.SECONDARY_LOCATION
: The secondary disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.SECONDARY_DISK_NAME
: the name of the secondary disk.To start replication between primary and secondary disks, use the compute_disk_async_replication
resource.
To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.
Stop replicationYou can stop replication for a single primary or secondary disk, or for all disks in a consistency group. If you stop replication for a single disk in a consistency group, the replication time for that disk becomes out of sync with the other disks in the consistency group.
Stopping replication is performed in failover and failback scenarios. If you stop replication, you can't restart replication to the same secondary disk. If you want to restart replication, you must create a new secondary disk and start again.
When you stop replication on a disk, the disk's replication state changes to STOPPED
. The replication state of the other disk in the disk's replication pair (the corresponding primary or secondary disk) updates to STOPPED
at a later time. If you want to avoid the time gap and update the replication state of the other disk to STOPPED
immediately, you must manually stop replication on the other disk as well. Stopping replication on both disks doesn't affect the time at which replication stops, it only affects the disks' replication states.
Stop replication for a single disk using the Google Cloud console, the Google Cloud CLI, or REST.
ConsoleStop replication by doing the following:
In the Google Cloud console, go to the Asynchronous replication page.
Click the name of primary or secondary disk for which you want to stop replication. The Manage disk page opens.
Click Terminate replication. The Terminate replication window opens.
Click Terminate replication.
Stop replication using the gcloud compute disks stop-async-replication
command:
gcloud compute disks stop-async-replication DISK_NAME \ --LOCATION_FLAG=LOCATION
Replace the following:
DISK_NAME
: the name of the disk.LOCATION_FLAG
: the location flag for the disk. For a regional disk, use --region
. For a zonal disk, use --zone
.LOCATION
: the disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.Stop replication using one of the following methods:
Stop replication for zonal disks using the disks.stopAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/LOCATION/disks/DISK_NAME/stopAsyncReplication { }
Stop replication for regional disks using the regionDisks.stopAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT/regions/LOCATION/regionDisks/DISK_NAME/stopAsyncReplication { }
Replace the following:
PROJECT
: the project that contains the disk.DISK_NAME
: the name of the disk.LOCATION
: the zone or region of the disk. For zonal disks, use the zone. For regional disks, use the region.To stop the replication on primary and secondary disks, remove the compute_disk_async_replication
resource.
Stop replication for all disks in a consistency group using the Google Cloud console, the Google Cloud CLI, or REST.
ConsoleStop replication for all disks in a consistency group by doing the following:
In the Google Cloud console, go to the Asynchronous replication page.
Click the Consistency groups tab.
Click the name of the consistency group for which you want to stop replication. The Manage consistency group page opens.
Click Terminate replication. The Terminate replication window opens.
Click Terminate replication.
Stop replication for all disks in a consistency group using the gcloud compute disks stop-group-async-replication
command:
gcloud compute disks stop-group-async-replication CONSISTENCY_GROUP \ --LOCATION_FLAG=LOCATION
Replace the following:
CONSISTENCY_GROUP
: the URL of the consistency group. For example, projects/PROJECT/regions/REGION/resourcePolicies/CONSISTENCY_GROUP_NAME
.LOCATION_FLAG
: the location flag for the disks in the consistency group. For regional disks, use --region
. For zonal disks, use --zone
.LOCATION
: the disk's region or zone. For regional disks, use the region. For zonal disks, use the zone.Stop replication for all disks in a consistency group using one of the following methods:
Stop replication for zonal disks using the disks.stopGroupAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/LOCATION/disks/stopGroupAsyncReplication { "resourcePolicy": "CONSISTENCY_GROUP" }
Stop replication for regional disks using the regionDisks.stopGroupAsyncReplication
method:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT/regions/LOCATION/regionDisks/DISK_NAME/stopAsyncReplication { "resourcePolicy": "CONSISTENCY_GROUP" }
Replace the following:
DISK_NAME
: the name of the diskLOCATION
: the zone or region of the disk. For zonal disks, use the zone. For regional disks, use the region.CONSISTENCY_GROUP
: the URL of the consistency group. For example, projects/PROJECT/regions/REGION/resourcePolicies/CONSISTENCY_GROUP_NAME
.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This document explains the process of starting and stopping Persistent Disk Asynchronous Replication (PD Async Replication), which is useful for disaster recovery with low RPO and RTO."],["Replication can be started using the Google Cloud console, Google Cloud CLI, REST, or Terraform, and the specific commands and steps vary depending on the chosen method."],["Stopping replication can be done for individual disks or for all disks within a consistency group, and after stopping, replication to the same secondary disk cannot be resumed."],["Before starting replication, it is important to have a primary disk, a secondary disk, and you may need to set up authentication to access Google Cloud services and APIs."],["Limitations of PD Async Replication are that a primary disk can only replicate to one secondary disk, secondary disks cannot be modified during replication, and replication fails if a zonal outage occurs."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4