This document describes how to resize and clone Persistent Disk Asynchronous Replication (PD Async Replication) disks.
PD Async Replication is useful for low-RPO, low-RTO disaster recovery. To learn more about asynchronous replication, see About Persistent Disk Asynchronous Replication.
Limitations
- Primary and secondary disks must be the same size. If you resize a primary disk that is actively replicating, then the secondary disk is automatically resized. If the secondary disk fails to resize automatically, then you must manually resize it to the same size as the primary disk. Replication is paused until the secondary disk is the same size as the primary disk.
- You can't clone primary disks from a consistency group. You must clone primary disks individually. However, you can clone secondary disks from a consistency group.
Before you begin
- If you want to use the command-line examples in this guide, do the following:
- Install or update to the latest version of the Google Cloud CLI.
- Set a default region and zone.
- If you want to use the API examples in this guide, set up API access.
- Create a primary disk.
- Create a secondary disk.
Resize disks
If you require additional storage space or increased performance limits, you can increase the size of a primary disk to up to 2 TB. You can't decrease the size of a disk.
When you resize a primary disk that is actively replicating to a secondary disk, the secondary disk size is increased to the same size as the primary disk. If the secondary disk fails to resize automatically, then you must manually resize it to the same size as the primary disk.
For information about how to increase the size of a disk, see Increase the size of a disk.
Clone disks
You can clone a single primary or secondary disk, or all secondary disks in a consistency group.
Clone a single disk
Clone a PD Async Replication disk using the methods described in Create a disk clone.
Clone all disks in a consistency group
Before you can clone secondary disks from a consistency group, you must create a consistency group in the secondary region for the disks that you want to clone, then add the secondary disks to the consistency group.
Clone all secondary disks in a consistency group using the Google Cloud console, the Google Cloud CLI, or the Compute Engine API.
Console
Clone all secondary 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 that contains the secondary disks.
Click Clone consistency group. The Clone consistency group window opens.
Click Clone consistency group.
gcloud
Clone all secondary disks in a consistency group using the
gcloud beta compute disks bulk create
command:
gcloud beta compute disks bulk create \ --source-consistency-group-policy=CONSISTENCY_GROUP \ --LOCATION_FLAG=LOCATION
Replace the following:
CONSISTENCY_GROUP
: the URL of the consistency group that contains the secondary disks to clone. 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 zonal, use--zone
.LOCATION
: the region or zone that the disks in the consistency group are located in. For regional disks, use the region. For zonal disks, use the zone. The clones are created in this location.
API
Clone all secondary disks in a consistency group using one of the following methods:
To clone zonal disks in a consistency group, use the
disks.bulkInsert
method:POST https://www.googleapis.com/compute/beta/projects/CLONE_PROJECT/zones/ZONE/disks/bulkInsert { "sourceConsistencyGroupPolicy": "projects/CONSISTENCY_GROUP_PROJECT/regions/CONSISTENCY_GROUP_REGION/resourcePolicies/CONSISTENCY_GROUP_NAME", }
To clone regional disks in a consistency group, use the
regionDisks.bulkInsert
method:POST https://www.googleapis.com/compute/beta/projects/CLONE_PROJECT/regions/REGION/regionDisks/bulkInsert { "sourceConsistencyGroupPolicy": "projects/CONSISTENCY_GROUP_PROJECT/regions/CONSISTENCY_GROUP_REGION/resourcePolicies/CONSISTENCY_GROUP_NAME", }
Replace the following:
CLONE_PROJECT
: the project to create the disk clones in.ZONE
: the zone to create the disk clones in.REGION
: the region to create the disk clones in.CONSISTENCY_GROUP_PROJECT
: the project that contains the consistency group.CONSISTENCY_GROUP_REGION
: the region where the consistency group is located.CONSISTENCY_GROUP_NAME
: the name of the consistency group.
What's next
- Learn how to manage consistency groups.
- Learn how to manage replication.
- Learn how to failover and failback.
- Learn how to monitor Persistent Disk Asynchronous Replication performance.