Monitor replica states and replication status for regional disks

Compute Engine maintains copies of eachregionaldisk in two Google Cloud zones. Each copy is called a zonal replica. When youwrite data to your disk, Compute Engine synchronously replicates that data toboth replicas to ensure high availability (HA). At any given time, thedisk replication status of the regional disk tells you aboutthe ability of a disk to synchronously write to both replicas. The disk'sreplication status is determined by thereplica states of the disk's zonalreplicas. The replica state for a zone is tells you the state of an individualzonal replica in comparison to the latest data on the disk. If a zonal replicacontains the latest disk data, then that replica is considered to besyncedwith the latest disk data. If both zonal replicas are synced, then yourRegional Persistent Disk orHyperdisk Balanced High Availability disk is considered to befully replicated.

This document explains how you can monitor the replica states of yourregional disks and their disk replication status over a periodof time. You can use this document to do the following:

  1. Check the current and historical replica states of your regional disks.
  2. Use the replica state information from a specific point in time to determineif your disk was fully replicated.

To learn more about replica state and disk replication status, seeAbout synchronous disk replication.

Required roles

To get the permissions that you need to view replication states using Cloud Monitoring, ask your administrator to grant you the following IAM roles:

  • To view regional disk metrics (one of the following):

For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

Monitor using the Google Cloud console

This section explains how you can monitor the replica states and diskreplication status of a Hyperdisk Balanced High Availability or Regional Persistent Diskvolume using the Google Cloud console.

Check if zonal replicas are synced for a single disk

You can use the Google Cloud console to check whether the zonal replicas of aregional disk are synced with the latest disk data.

To see detailed information about the exact zonal replica states for allregional disks in a project,check the zonal replica states using the Cloud Monitoring dashboard.

Console

To monitor the zonal replica states for your regional disks,do the following:

  1. In the Google Cloud console, go to theDisks page.

    Go to Disks

  2. On theDisks page, in theName column, select the disk for whichyou want to check the replica states.

    TheManage disk page opens for the selected disk and displaystheDetails tab for that disk.

  3. Click theObservability tab.

    TheManage disk page displays the monitoring information for thedisk.

  4. To see the historical replica state information for your disk, on theObservability tab, navigate to theRegional Persistent Disk Replication State graph.

    The graph displays the replica state values for your zonal replicasover the preceding hour in the form of two separate graph lines.

    The replica state value can be one of the following:

    • 0: The replica is not in sync with the latest disk data.
    • 1. The replica is synced with the latest disk data.
  5. To check the replica state value for your zonal replicas at a specificpoint in time, do the following:

    • Hold the pointer on the graph for the time value at which you wantto check the replica state.
    • To see the replica state values for your zonal replicas, navigate tothe bottom of the graph.
    • Optional: To see the name and replica state value denoted by agraph line, hold the pointer over the graph line for any specifictime value. The graph highlights the name and time-specific stateof that replica inside a tooltip.
  6. Optional: To modify the time period over which you want to see thereplica state data, select a time period at the top of theObservability tab. The following options are available:

    • 1 hour: the preceding hour. This is the default value.
    • 6 hours: the preceding 6 hours.
    • 1 day: the preceding day.
    • 1 week: the preceding week.
    • 1 month: the preceding month.
    • 6 weeks: the preceding 6 weeks.
    • Custom: a specific time period of your choice. To specify a custommonitoring time period, clickCustom and then do the following:

      • In theStart date and time field, specify the beginning ofyour monitoring time period. You must specify a time in the past.
      • In theEnd date and time field, specify the end ofyour monitoring time period. You must specify a time in the past.
      • To save your custom monitoring time period, clickApply.

Determine if the disk is fully replicated

After you determine whether or not your zonal replicas are synced with thelatest disk data, you can use that information to determine whether or notyour disk is fully replicated.

At any given time, the disk wasfully replicated if the replica state valuefor both zonal replicas was1. If that was not the case, check for the exactreplica states at that time to know whether your disk wasdegraded orcatching up. For more information, seeMonitor using Cloud Monitoring metrics.

Monitor using Cloud Monitoring metrics

You can check detailed information about the exact zonal replica states for allyour regional disks by using theRegional disk replica statemetric in Cloud Monitoring.

About theRegional disk replica state metric

You can see the current and historical disk replica states of your zonalreplicas on the Cloud Monitoring dashboard.Compute Engine captures the replica states of your disks every minute andreports it using theRegional disk replica state metric. However, ifthere is a zonal outage that impacts the compute instance to which azonal replica is attached, you won't see anyRegional disk replica statemetric data for either zonal replica.

The following are the possible values of theRegional disk replica statemetric. Your zonal replicas are always in one of thesedisk replica states.

  • Synced: The replica is available, synchronously receives all the writesperformed to the disk, and is up to date with all the data on the disk.
  • CatchingUp: The replica is available but is still catching up withthe data on the disk from the other replica.
  • OutOfSync: The replica is temporarily unavailable and out of syncwith the data on the disk.

For information about the metric definition, see theCompute Engine Monitoring metricssection.

Note: You can use theRegional disk replica state metric to track thereplica state data only for attached Hyperdisk Balanced High Availability or Regional Persistent Diskvolumes.

You can use theRegional disk replica state metric data to do the following:

  • Determine the replication status of your regional disk.
  • Review the replica state history of your regional diskto understand whether your failover architecture works as intendedand take necessary action in case the state of your regional disk changes.
  • Create alerts based on theRegional disk replica state metric data, detectany changes in your replica states, and take the necessary actions. For moreinformation about how to create metric-based alerts, seeHow to add an alerting policy.

Check theRegional disk replica state metric data

To see the status of the zonal replicas of an attached regionaldisk, build a query and create a temporary chart for theRegional disk replica state metric. You can do this on Metrics Explorerby using the menu-driven interface orPromQL.

Menu-driven interface

  1. In the Google Cloud console, go to the Metrics explorer page:

    Go toMetrics explorer

    If you use the search bar to find this page, then select the result whose subheading isMonitoring.

    TheMetrics explorer page opens and displays theQueries tab.

  2. To see the replica state data for each zonal replica in a project,select the time series data for theRegional disk replica statemetric and then remove the aggregation filter by doing the following inthe toolbar of the query pane:

    1. In theMetric menu, clickSelect a metric and thenselectDisk >Disk >Regional disk replica state.

    2. ClickApply.

    3. In theAggregation menu, selectUnaggregated by None.

    A chart appears and displays the metric data from the preceding hourfor each replica as a time series. You see the metric data only forzonal replicas of attached disks.

    For more information about selecting time series for a metric, seeSelect metrics when using Metrics Explorer.

  3. To view chart and table views simultaneously, at the top of thechart, clickBoth.

  4. To view data for all available regional disk properties,at the top of the table view, clickColumn display options..., select all the columns and then clickOk.

    The dashboard displays the following fields for every row in the table,along with their current values:

    • disk_id: ID of the disk
    • zone: The region where the regional disk was created.
    • replica_zone: Replica zone
    • state: Replica state
    • storage_type: Storage type of the disk
    • value: Value for the replica state

    To view this data on the corresponding time series in the chartview, hold the pointer on the chart at the current time. The chartdisplays these values inside a tooltip.

    Note: The chart view doesn't display the names of the fields.
  5. To check the historical replica states at aspecific point in time, do the following:

    1. Hold the pointer over the chart at a specific time value of yourchoice. The dashboard displays the metric data for all replicastates of all the zonal replicas in your project at that specificpoint in time.

      In the chart view, this information appears inside a tooltip.

      In the table view, this information appears as individual rows.

    2. Note the replica states and their corresponding values. At anygiven time, if a particular state has a value of1, thenthe replica was in that state.

      In the chart view, check the replica states and values insidethe tooltip for the disk IDs and replica zones that you want.

      In the table view, check thestate andvalue columns forthe specific disk IDs and replica zones that you want.

    To learn more about what the replica states and their values mean,seeUnderstand theRegional disk replica state metric data.

  6. Optional: To view the replica state information for a specific label,in theFilter menu, select the label for which you want to view thedata and then complete the dialogue. You can add multiple filters.

    The dashboard displays the metric data only for the filtered labels.For more information about filters, seeFilter charted data.

    For example, to view the replica state datafor a specific disk, do the following:

    1. In theFilter menu, select either thename label.
    2. In theComparator menu, select= (equals).
    3. In theValue menu, select the name of the disk thatyou want.
  7. Optional: To determine what percentage of the time a specific disk'sreplicas were synced, filter the data for the specific disk and stateand then use the aggregation menu:

    1. In theFilter menu, select thename label.
    2. In theComparator menu, select= (equals).
    3. In theValue menu, select the name of the disk.
    4. In theFilter menu, select thestate label.
    5. In theComparator menu, select= (equals).
    6. In theValue menu, selectSynced.
    7. In theAggregation menu, selectMean by replica_zone.
    8. Select the time period for which you want to see the data.

    The dashboard displays the data about the averagesynced status foryour disk's replicas over the specified time period. Multiple this databy 100 to determine the percentage of the time for which the replicaswere synced. If the value for the average value shows as1 for thattime period, then the replica was always up to date with the latest data.An average value that is less than1 indicates that the replica wasnot synced at some point of time during the specified time period.

    For more information about grouping and alignment, seeChoose how to display charted data.

  8. Optional: To modify the time period over which you want to monitor themetric data, at the top of the dashboard, clickLast 1 hour selectthe time period that you want.

    You can select a relative time period to the current time, or specifystart and end times of your choice. By default, you see the metric datafor the preceding hour.

PromQL

  1. In the Google Cloud console, go to the Metrics explorer page:

    Go toMetrics explorer

    If you use the search bar to find this page, then select the result whose subheading isMonitoring.

    TheMetrics explorer page opens and displays theQueries tab.

  2. In the toolbar of your query pane, click the button whose name startswith< >.

  3. In theLanguage field, selectPromQL as your querylanguage. This field is in the same toolbar that lets youformat your query.

  4. Optional: Disable theAuto-run toggle.

  5. Enter your query and then clickRun query.

    When theAuto-run toggle is enabled, theRun querybutton isn't displayed.

    For example, to view the replica state data for a disk calleddisk-1,run the following query:

    avg_over_time(compute_googleapis_com:disk_regional_replica_state{monitored_resource="gce_disk",metadata_system_name="disk-1"}[${__interval}])

    As another example, to determine what percentage of the time thereplicas were synced for a disk calleddisk-1, run the following query:

    avg by (replica_zone)(avg_over_time(compute_googleapis_com:disk_regional_replica_state{monitored_resource="gce_disk",state="Synced",metadata_system_name="disk-1"}[${__interval}]))
  6. To modify the time period over which you want to monitor the metric data,at the top of the dashboard, clickLast 1 hour select the timeperiod and time zone that you want.

    You can select a relative time period to the current time, or specifystart and end times of your choice. By default, you see the metric datafor the preceding hour.

Determine the exact zonal replica states using metric data

To understand theRegional disk replica state metric data for aregional disk, you must check thestate andvaluecolumns for the zonal replicas in your generated chart. If you don't add anyfilters to your query, the following things happen:

  • Thestate column displays all the possible disk replica statesfor a zonal replica, one ofSynced,CatchingUp, andOutOfSync.The chart displays each of these states in the form of a time seriesfor all zonal replicas of all regional disks in your project.
  • Thevalue column indicates whether the zonal replica is in aspecific disk replica state or not. This column shows acorresponding binary value (either0 or1) for everyvalue ofstate for all zonal replica of all regionaldisks in your project.

For any zonal replica, if thevalue column shows1 for a specific diskreplica state, then that zonal replica is in thatspecific state. If thevalue column shows0 for a specific state, thenthat replica is not in that specific state. At any given time, a zonal replicahas exactly one of the disk replica states with1 in thevalue column. Theother two disk replica states have0 in their respectivevalue columns.

For every zonal replica, the chart and table display a separateentry for each disk replica state:Synced,CatchingUp, andOutOfSync.Thevalue column for each entry is a binary value (either0 or1) thatindicates whether or not the replica is in that state. At any given time,a zonal replica has exactly one replica state with its value as1.

Determine the exact disk replication status

You can use the replica states of your zonal replicas to determine thereplication state of your regional disks in the following way:

  • If both the zonal replicas have1 as the value for theSynced state,then the disk isfully replicated.
  • If one of the zonal replicas has1 as the value for theSynced stateand the other zonal replica has1 as the value for theCatchingUpstate, then the disk iscatching up.
  • If one of the zonal replicas has1 as the value for theSynced stateand the other zonal replica has1 as the value for theOutOfSyncstate, then the disk isdegraded.

For example, consider a disk namedmy-disk1 that has replicas inus-central1-a andus-central1-b. The following scenarios shows the valuesof thestate andvalue columns for the zonal replicas for eachpossible replication state ofmy-disk1:

Fully replicated

In this scenario, the replica inus-central1-a and the replica inus-central1-b are both updated with the latest data on the disk. The chartdisplays the following values for each disk replica state for the zonalreplicas ofmy-disk1:

replica_zonestatevalue
us-central1-aSynced1
us-central1-aCatchingUp0
us-central1-aOutOfSync0
us-central1-bSynced1
us-central1-bCatchingUp0
us-central1-bOutOfSync0

Catching up

In this scenario, the replica inus-central1-a is updated with the data onthe disk and the replica inus-central1-b is catching up with the data onthe disk. The chart displays the following values for each disk replicastate for the zonal replicas ofmy-disk1:

replica_zonestatevalue
us-central1-aSynced1
us-central1-aCatchingUp0
us-central1-aOutOfSync0
us-central1-bSynced0
us-central1-bCatchingUp1
us-central1-bOutOfSync0

Degraded

In this scenario, the replica inus-central1-a is updated with the data onthe disk and the replica inus-central1-b is out of sync. The chartdisplays the following values for each disk replica state for the zonalreplicas ofmy-disk1:

replica_zonestatevalue
us-central1-aSynced1
us-central1-aCatchingUp0
us-central1-aOutOfSync0
us-central1-bSynced0
us-central1-bCatchingUp0
us-central1-bOutOfSync1

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.