Manage disks that use Persistent Disk Asynchronous Replication


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

  • Create a primary disk.
  • Create a secondary disk.
  • If you haven't already, set up authentication. Authentication is the process by which your identity is verified for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine as follows.

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init
    2. Set a default region and zone.

    REST

    To 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, then initialize it by running the following command:

      gcloud init

Resize disks

If you require additional storage space or increased performance limits, you can increase the size of a primary disk to up to 32 TiB. 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 gcloud CLI, or REST.

Console

Clone all secondary disks in a consistency group by doing the following:

  1. In the Google Cloud console, go to the Asynchronous replication page.

    Go to Asynchronous replication

  2. Click the Consistency groups tab.

  3. Click the name of the consistency group that contains the secondary disks.

  4. Click Clone consistency group. The Clone consistency group window opens.

  5. Click Clone consistency group.

gcloud

Clone all secondary disks in a consistency group using the gcloud compute disks bulk create command:

gcloud 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.

REST

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/v1/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/v1/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