Create and manage regional Persistent Disk volumes


Regional Persistent Disk is a storage option that lets you implement high availability (HA) services in Compute Engine. Regional Persistent Disk synchronously replicates data between two zones in the same region and ensures HA for disk data for up to one zonal failure. You can use regional Persistent Disk with your virtual machine (VM) in one of the following ways:

This document explains how to do the following tasks for regional Persistent Disk:

  • Create and manage regional Persistent Disk volumes.
  • Add a regional Persistent Disk volume to your VMs.

Before you begin

  • Review the differences between different types of Persistent Disk.
  • Review the basics of regional Persistent Disk .
  • Read about regional Persistent Disk failover .
  • 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 .

    Terraform

    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.

    1. Install the Google Cloud CLI.
    2. To initialize the gcloud CLI, run the following command:

      gcloud init
    3. Create local authentication credentials for your Google Account:

      gcloud auth application-default login

    For more information, see Set up authentication for a local development environment .

    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

    For more information, see Authenticate for using REST in the Google Cloud authentication documentation.

Limitations

  • You can attach regional Persistent Disk only to VMs that use E2 , N1 , N2 , and N2D machine types.
  • You cannot create a regional Persistent Disk from an image.
  • When using read-only mode, you can attach a regional balanced Persistent Disk to a maximum of 10 VM instances.
  • The minimum size of a regional standard Persistent Disk is 200 GiB.
  • You can only increase the size of a regional Persistent Disk volume; you can't decrease its size.
  • Regional Persistent Disk volumes have different performance characteristics than zonal Persistent Disk volumes. For more information, see Block storage performance .
  • If you create a regional Persistent Disk by cloning a zonal disk, then the two zonal replicas aren't fully in sync at the time of creation. After creation, you can use the regional disk clone within 3 minutes, on average. However, you might need to wait for tens of minutes before the disk reaches a fully replicated state and the recovery point objective (RPO) is close to zero. Learn how to check if your regional Persistent Disk is fully replicated .

Create a new VM with regional Persistent Disk

When creating a VM, you can optionally include regional Persistent Disk volumes as additional disks.

To create and attach a regional Persistent Disk volume to a VM during VM creation, see Create a VM instance with additional non-boot disks or Create a new instance template .

Add a regional Persistent Disk volume to your VM

Create a regional Persistent Disk volume and attach it to a VM. The VM must be in the same region as your disks.

If you create a disk in the Google Cloud console, the default disk type is pd-balanced . If you create a disk using the gcloud CLI or REST, the default disk type is pd-standard .

Permissions required for this task

To perform this task, you must have the following permissions :

  • compute.disks.create on the project, to be able to create a new disk
  • compute.instances.attachDisk on the VM
  • compute.disks.use on the disk to attach