Automated restore verification

Automated restore verification validates backup recoverability by scheduling restores and running validation scripts on temporary instances. This feature helps you verify that backups can be successfully restored, validate recovery time objectives (RTO), and satisfy data governance requirements.

Overview of automated restore verification

To validate backup recoverability for Compute Engine instances, Persistent Disk and Google Cloud Hyperdisk volumes, and Cloud SQL instances, you define how to restore and validate your data by using restore templates. Each restore template specifies restore parameters and optional pre-restore, post-restore, and verification scripts that run as Cloud Run jobs. A restore template maps to a specific data source, which represents a backed-up resource in a backup vault, rather than to a single backup. While a template is tied to one data source, a single data source can have multiple templates for different testing scenarios.

To automate testing, you create restore verification plans that define the execution schedule and lifecycle policies, such as how long temporary test resources are retained. You link a verification plan to a restore template by using a restore verification plan association. A single plan can manage multiple associations, enabling complex testing schedules.

When an automated run or an on-demand test triggers, a restore template execution is created. By default, this process orchestrates the restoration of the latest backup from the data source to a temporary test instance.

Architecture and isolation

To enforce security isolation, automated restore verification lets you separate responsibilities across distinct project roles:

  • Source resource project: Contains the active production resources being backed up.

  • Backup vault project: Stores the immutable backups and data sources in a backup vault, along with your restore templates. The restore template and the backup vault containing the data source must reside in the same project.

  • Restore orchestration project: Serves as the scheduling control plane, storing your restore verification plans and restore verification plan associations. These resources can reside in a different project from the restore template and backup vault.

  • Target resource project: Acts as the sandbox where temporary test resources are provisioned during verification executions, and can reside in a separate project.

  • Cloud Run jobs project: Hosts optional pre-restore, post-restore, and verification Cloud Run jobs, which can also reside in a separate project.

Regional requirements

The restore verification plan, restore verification plan association, restore template, provisioned target resource, and Cloud Run jobs must all reside in the same Google Cloud region. However, to support cross-region disaster recovery topologies, the backup vault containing the data source can reside in a different region. The backup vault and data source must still reside in the same project as the restore template.

Limitations

Automated restore verification has the following limitations:

  • Supported workloads: Automated restore verification supports only the following workload resource types:

    • Compute Engine instances (compute.googleapis.com/Instance)
    • Zonal Persistent Disk and Hyperdisk volumes (compute.googleapis.com/Disk)
    • Regional Persistent Disk and Hyperdisk volumes (compute.googleapis.com/RegionDisk)
    • Cloud SQL instances (sqladmin.googleapis.com/Instance)
  • Encryption key downgrade not supported: Restoring a backup encrypted with customer-managed encryption keys (CMEK) to a target instance or disk encrypted with Google-owned and Google-managed encryption keys (GMEK) isn't supported for Compute Engine instance and disk (Persistent Disk and Hyperdisk) workloads.

  • Selective disk restore not supported: Selective disk restores (restoring individual disks from a Compute Engine instance backup) aren't supported for Compute Engine instance and disk workloads.

  • Management interfaces: Creating, updating, deleting, and triggering restore templates, restore verification plans, plan associations, and template executions through the Google Cloud console or Terraform aren't supported.

Before you begin

Before you begin, complete the following prerequisites:

  • Project allowlist: Automated restore verification is available only for projects on an allowlist. To add your project to the allowlist, request access through your TAM or create a support case with Customer Care.

  • Backup and DR service enabled: The Backup and DR API must be enabled in the source resource, backup vault, restore orchestration, and target resource projects.

  • Backup vault configuration: A functional backup vault must be active and assigned to protect the primary workload resources.

  • Active workload backups: Active, valid backup snapshots must exist for the target Compute Engine, Persistent Disk, Hyperdisk, or Cloud SQL resources.

  • Cloud Run hook scripts (optional): If you intend to run pre-restore, post-restore, or verification hooks, build and deploy your script containers as Cloud Run jobs in the same region as your restore template.

Get required roles

To get the permissions that you need to set up and manage automated restore verification, ask your administrator to grant you the following IAM roles on your project:

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

You might also be able to get the required permissions through custom roles or other predefined roles.

To use custom roles instead of predefined roles for managing automated restore verification, expand the following section:

Granular permissions for custom roles

To use custom roles instead of predefined roles, include the granular permissions in your custom roles. For mutating actions, also include the backupdr.operations.get permission to poll or check the status of returned long-running operations. The following table lists the required permissions for each action:

Target resource Action Required permissions
Restore template Create
  • backupdr.restoreTemplates.createForRESOURCE_TYPE
  • backupdr.bvdataSources.get and backupdr.bvdataSources.useReadOnlyForRESOURCE_TYPE (on the data source)
  • backupdr.compute.restoreFromBackupVault (on the target project for Compute Engine, Persistent Disk, and Hyperdisk)
  • backupdr.restoreTargets.useForCloudSqlInstance (on the target project for Cloud SQL)
  • run.jobs.get, run.jobs.run, and run.jobs.runWithOverrides (on any configured Cloud Run jobs)
Restore template Update
  • backupdr.restoreTemplates.updateForRESOURCE_TYPE
  • backupdr.compute.restoreFromBackupVault (on the target project for Compute Engine, Persistent Disk, and Hyperdisk)
  • backupdr.restoreTargets.useForCloudSqlInstance (on the target project for Cloud SQL)
  • run.jobs.get, run.jobs.run, and run.jobs.runWithOverrides (on any configured Cloud Run jobs)
Restore template Delete backupdr.restoreTemplates.deleteForRESOURCE_TYPE
Restore template Get backupdr.restoreTemplates.getForRESOURCE_TYPE
Restore template List backupdr.restoreTemplates.list
Restore template Run backupdr.restoreTemplates.runForRESOURCE_TYPE
Restore verification plan Create backupdr.restoreVerificationPlans.create
Restore verification plan Delete backupdr.restoreVerificationPlans.delete
Restore verification plan List backupdr.restoreVerificationPlans.list
Restore verification plan Get backupdr.restoreVerificationPlans.get
Restore verification plan association Create
  • backupdr.restoreVerificationPlanAssociations.createForRESOURCE_TYPE (on the plans project)
  • backupdr.restoreTemplates.useForRESOURCE_TYPE (on the restore template project)
Restore verification plan association Delete backupdr.restoreVerificationPlanAssociations.deleteForRESOURCE_TYPE
Restore verification plan association Get backupdr.restoreVerificationPlanAssociations.getForRESOURCE_TYPE
Restore verification plan association List backupdr.restoreVerificationPlanAssociations.list
Restore verification plan association Trigger backupdr.restoreVerificationPlanAssociations.triggerRestoreVerificationForRESOURCE_TYPE
Restore template execution Get backupdr.restoreTemplateExecutions.getForRESOURCE_TYPE
Restore template execution List backupdr.restoreTemplateExecutions.list
Restore template execution Trigger cleanup backupdr.restoreTemplateExecutions.triggerRestoreCleanupForRESOURCE_TYPE
Long-running operation Get

backupdr.operations.get

Required to poll or check the status of long-running operations from mutating actions (create, update, delete, run, trigger, and trigger cleanup). You need this permission when you pass the --no-async flag, run the gcloud backup-dr operations describe command, or poll an operation through the API. For restore template and execution actions, include this permission in your custom role on the backup vault project. For restore verification plan and association actions, include this permission in your custom role on the restore orchestration project.

Replace RESOURCE_TYPE with CloudSqlInstance, ComputeInstance, or ComputeDisk.

Grant roles to service agents

To let verification runs succeed without PERMISSION_DENIED errors, grant the required roles to the project-level Backup and DR service agents. Use the service agent for the backup vault project (service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com), not the service agent for an individual backup vault (vault-VAULT_PROJECT_NUMBER-UID@gcp-sa-backupdr-pr.iam.gserviceaccount.com). In these addresses, VAULT_PROJECT_NUMBER is the project number of the backup vault project, and UID is the unique identifier generated for the vault. The service agent for an individual backup vault captures source backups and isn't used for restore verification execution or cleanup.

Grant the following predefined roles to the service agents:

  • Service agent for the backup vault project (service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com):

    • On the target resource project, grant the workload-specific role that lets the service agent create and delete temporary test resources:

      • Compute Engine instances: Compute Editor (roles/compute.editor). If a restored VM has an attached service account, also grant the Service Account User role (roles/iam.serviceAccountUser) on that VM service account.
      • Persistent Disk and Hyperdisk volumes: Compute Editor (roles/compute.editor)
      • Cloud SQL instances: Cloud SQL Admin (roles/cloudsql.admin)
    • On the source resource project (for Cloud SQL workloads, if the source Cloud SQL instance is in a different project from the target resource project), grant the Cloud SQL Viewer role (roles/cloudsql.viewer), which gives the cloudsql.backupRuns.get permission.

    • On the Cloud Run jobs project (if you configure pre-restore, post-restore, or verification jobs), grant the Cloud Run Developer role (roles/run.developer). Also grant the Service Account User role (roles/iam.serviceAccountUser) on the runtime service account attached to each hook job.

  • Service agent for the plans project (service-PLANS_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com), where PLANS_PROJECT_NUMBER is the project number of the restore orchestration project:

    • If the restore verification plan is in a different project from the restore template, grant the Backup and DR Service Agent role (roles/backupdr.serviceAgent) on the restore template project (the backup vault project).

To use custom roles instead of predefined roles for the service agents, expand the following section:

Granular permissions for service agent custom roles

To use custom roles instead of predefined roles for the service agent for the backup vault project (service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com), create project-scoped custom roles by using the Backup and DR permissions and workload Identity and Access Management (IAM) references in the following table. Grant each custom role to the applicable service agent:

Project Scope or workload Required permissions
Backup vault project Vault and backup read
  • backupdr.bvdataSources.get
  • backupdr.bvbackups.list
  • backupdr.bvbackups.get
  • backupdr.bvbackups.useReadOnlyForRESOURCE_TYPE

If you retain the default Backup and DR Service Agent role (roles/backupdr.serviceAgent) on the backup vault project, you can omit these permissions.

Backup vault project Scheduled and plan trigger invocation
  • backupdr.operations.get
  • backupdr.restoreTemplates.runWithCleanupForRESOURCE_TYPE

If restore verification plans reside in the backup vault project, include these permissions in the custom role for that project. If plans reside in a separate restore orchestration project, create a custom role with these permissions on the backup vault project. Grant that role to the service agent for the plans project (service-PLANS_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com).

Source resource project (Cloud SQL only) Cross-project Cloud SQL backup validation

Include Cloud SQL permissions to read backup runs on the project that contains the source Cloud SQL instance when it differs from the target resource project. For the specific permissions, see the backup read permissions for Cloud SQL Viewer (roles/cloudsql.viewer) in Cloud SQL roles and permissions.

Target resource project Cloud SQL instances

Include Cloud SQL permissions to create, read, restore backups to, and delete temporary Cloud SQL instances. If the source instance resides in the same project, also include permissions to read backup runs. For the specific permissions, see the instance and backup permissions for Cloud SQL Admin (roles/cloudsql.admin) in Cloud SQL roles and permissions.

Restore verification polls operation status by reading the instance rather than polling Cloud SQL operations, so omit unsupported operation permissions. To check which permissions are supported in custom roles, see Support levels for permissions in custom roles.

Target resource project Zonal and regional Persistent Disk and Hyperdisk volumes

Include Compute Engine permissions to create, read, label, use, and delete disks, and to read disk types and poll zonal and regional operations. If the target disk uses storage pools, resource policies, or tags, also include the permissions for those features. For the specific permissions, see Compute Engine IAM roles and permissions.

Target resource project Compute Engine instances

Include the disk permissions from the preceding row, plus Compute Engine permissions to create, read, use, and delete VM instances. Also include permissions to configure instance metadata, labels, tags, and service accounts, read machine types, use subnets, and poll global operations.

Include external or static IP address permissions if the restored VM uses them and you don't remove external IP addresses in the --restore-properties flag. For Shared VPC, include subnet usage permissions in a role granted on the host project subnet.

If the restored VM has an attached service account, grant Service Account User (roles/iam.serviceAccountUser) or an equivalent custom role on that service account. For the specific Compute Engine permissions, see Compute Engine IAM roles and permissions.

Cloud Run jobs project (optional) Pre-restore, post-restore, or verification hooks

Include Cloud Run permissions to read and run jobs (including running with overrides) and to read job executions on the project that hosts the hook jobs. For the specific permissions, see Cloud Run IAM roles and Cloud Run IAM permissions.

Also grant Service Account User (roles/iam.serviceAccountUser) or an equivalent custom role on the runtime service account attached to each hook job.

Replace RESOURCE_TYPE with CloudSqlInstance, ComputeInstance, or ComputeDisk.

For more information about creating IAM custom roles and checking Backup and DR permissions, see Create and manage custom roles and Backup and Disaster Recovery roles and permissions.

To grant these roles to the service agents, use the Google Cloud console or the gcloud CLI:

Console

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

    Go to IAM

  2. Select the target resource project.

  3. Click Grant access.

  4. In the New principals field, enter service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com, where VAULT_PROJECT_NUMBER is the project number of the backup vault project.

  5. In the Select a role menu, select the role for your target workload:

    • For Compute Engine instances or Persistent Disk and Hyperdisk volumes, select Compute Editor.
    • For Cloud SQL instances, select Cloud SQL Admin.
  6. Click Save.

  7. For Cloud SQL workloads, if the source Cloud SQL instance is in a different project from the target resource project, switch to the source resource project and click Grant access. In the New principals field, enter service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com. In the Select a role menu, select Cloud SQL Viewer, and then click Save.

  8. If you configure pre-restore, post-restore, or verification Cloud Run jobs, switch to the Cloud Run jobs project and click Grant access. In the New principals field, enter service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com. In the Select a role menu, select Cloud Run Developer, and then click Save. Also grant Service Account User to this service agent on the runtime service account attached to each hook job.

  9. If the restore verification plan is in a different project from the restore template, switch to the backup vault project (the restore template project) and click Grant access. In the New principals field, enter service-PLANS_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com. In the Select a role menu, select Backup and DR Service Agent, and then click Save.

gcloud

  1. On the target resource project, grant the workload-specific role (roles/compute.editor for Compute Engine and disk workloads, or roles/cloudsql.admin for Cloud SQL workloads) to the service agent for the backup vault project:

    gcloud projects add-iam-policy-binding TARGET_PROJECT_ID \
        --member="serviceAccount:service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com" \
        --role="TARGET_WORKLOAD_ROLE"
    
  2. For Cloud SQL workloads, if the source Cloud SQL instance is in a different project from the target resource project, grant the roles/cloudsql.viewer role to the service agent for the backup vault project on the source resource project:

    gcloud projects add-iam-policy-binding SOURCE_PROJECT_ID \
        --member="serviceAccount:service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com" \
        --role="roles/cloudsql.viewer"
    
  3. If you configure pre-restore, post-restore, or verification Cloud Run jobs, grant the roles/run.developer role to the service agent for the backup vault project on the Cloud Run jobs project, and grant the roles/iam.serviceAccountUser role on the runtime service account attached to each hook job:

    gcloud projects add-iam-policy-binding CLOUD_RUN_PROJECT_ID \
        --member="serviceAccount:service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com" \
        --role="roles/run.developer"
    
    gcloud iam service-accounts add-iam-policy-binding HOOK_JOB_SERVICE_ACCOUNT \
        --project=CLOUD_RUN_PROJECT_ID \
        --member="serviceAccount:service-VAULT_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com" \
        --role="roles/iam.serviceAccountUser"
    
  4. If the restore verification plan is in a different project from the restore template, grant the roles/backupdr.serviceAgent role to the service agent for the plans project on the restore template project (the backup vault project):

    gcloud projects add-iam-policy-binding VAULT_PROJECT_ID \
        --member="serviceAccount:service-PLANS_PROJECT_NUMBER@gcp-sa-backupdr.iam.gserviceaccount.com" \
        --role="roles/backupdr.serviceAgent"
    

Replace the following:

  • TARGET_PROJECT_ID: the project ID of the target resource project.

  • VAULT_PROJECT_NUMBER: the project number of the backup vault project.

  • TARGET_WORKLOAD_ROLE: the role for the target workload (roles/compute.editor for Compute Engine instances and Persistent Disk or Hyperdisk volumes, or roles/cloudsql.admin for Cloud SQL instances).

  • SOURCE_PROJECT_ID: the project ID of the source resource project (for Cloud SQL workloads when the source instance is in a different project from the target resource project).

  • CLOUD_RUN_PROJECT_ID: the project ID of the Cloud Run jobs project.

  • HOOK_JOB_SERVICE_ACCOUNT: the email address of the runtime service account attached to the Cloud Run hook job.

  • VAULT_PROJECT_ID: the project ID of the restore template project (the backup vault project).

  • PLANS_PROJECT_NUMBER: the project number of the restore orchestration project.

Create a restore template

A restore template defines the parameters for the restore operation, including the target project and optional custom hooks. You can link a restore template to a restore verification plan for scheduled runs, or run the template directly for on-demand testing.

Create a restore template by using the gcloud backup-dr restore-templates create command:

gcloud backup-dr restore-templates create RESTORE_TEMPLATE_ID \
    --project=VAULT_PROJECT_ID \
    --location=LOCATION \
    --resource-type="RESOURCE_TYPE" \
    --data-source="projects/VAULT_PROJECT_ID/locations/VAULT_LOCATION/backupVaults/VAULT_ID/dataSources/DATA_SOURCE_ID" \
    --restore-properties='RESTORE_PROPERTIES_JSON' \
    --description="Restore template for automated verification" \
    --pre-restore-cloud-run-job="projects/CLOUD_RUN_PROJECT_ID/locations/LOCATION/jobs/PRE_JOB" \
    --pre-restore-timeout="300s" \
    --post-restore-cloud-run-job="projects/CLOUD_RUN_PROJECT_ID/locations/LOCATION/jobs/POST_JOB" \
    --post-restore-timeout="600s" \
    --verification-cloud-run-job="projects/CLOUD_RUN_PROJECT_ID/locations/LOCATION/jobs/VERIFY_JOB" \
    --verification-timeout="300s"

Replace the following:

  • RESTORE_TEMPLATE_ID: the ID of the restore template to create.

  • VAULT_PROJECT_ID: the project ID of the backup vault project.

  • LOCATION: the region where the restore template and plans reside.

  • RESOURCE_TYPE: the target resource type. Specify one of the following supported values:

    • compute.googleapis.com/Instance (Compute Engine instance)
    • compute.googleapis.com/Disk (zonal Persistent Disk or Hyperdisk volume)
    • compute.googleapis.com/RegionDisk (regional Persistent Disk or Hyperdisk volume)
    • sqladmin.googleapis.com/Instance (Cloud SQL instance)
  • VAULT_LOCATION: the region of the backup vault.

  • VAULT_ID: the ID of the backup vault.

  • DATA_SOURCE_ID: the ID of the data source.

  • RESTORE_PROPERTIES_JSON: a JSON object containing the workload-specific restore parameters. For the required schema and examples for each workload type, see Configure --restore-properties by workload type.

  • CLOUD_RUN_PROJECT_ID: the project ID of the Cloud Run jobs project.

  • PRE_JOB: the name of the optional pre-restore Cloud Run job.

  • POST_JOB: the name of the optional post-restore Cloud Run job.

  • VERIFY_JOB: the name of the optional verification Cloud Run job.

Configure --restore-properties by workload type

The --restore-properties flag accepts a JSON object that matches the REST API request structure for the target workload type. Passing the target project, location (zone or region), and target resource or instance name is mandatory for all workload types.

In the target resource or instance name field, include the {EXECUTION_ID} dynamic placeholder (for example, "name": "test-restore-vm-{EXECUTION_ID}"). The {EXECUTION_ID} placeholder dynamically appends the unique execution ID so that repeated or overlapping verification runs don't fail due to target resource name collisions. This placeholder is especially important for Cloud SQL, where deleted instance names can't be reused right away.

The following table lists the REST API request schema, mandatory fields, and an example --restore-properties JSON payload for each supported workload type:

Workload resource type REST API request schema Mandatory fields Example --restore-properties JSON

Compute Engine instance

(compute.googleapis.com/Instance)

instances.insert project, zone, and resource.name
{"project": "TARGET_PROJECT_ID", "zone": "TARGET_ZONE", "resource": {"name": "test-restore-vm-{EXECUTION_ID}", "machineType": "zones/TARGET_ZONE/machineTypes/e2-medium"}}

Zonal disk

(compute.googleapis.com/Disk)

disks.insert project, zone, and resource.name
{"project": "TARGET_PROJECT_ID", "zone": "TARGET_ZONE", "resource": {"name": "test-restore-disk-{EXECUTION_ID}", "type": "projects/TARGET_PROJECT_ID/zones/TARGET_ZONE/diskTypes/pd-balanced"}}

Regional disk

(compute.googleapis.com/RegionDisk)

regionDisks.insert project, region, and resource.name
{"project": "TARGET_PROJECT_ID", "region": "TARGET_REGION", "resource": {"name": "test-restore-regdisk-{EXECUTION_ID}", "replicaZones": ["projects/TARGET_PROJECT_ID/zones/REPLICA_ZONE_1", "projects/TARGET_PROJECT_ID/zones/REPLICA_ZONE_2"]}}

Cloud SQL instance

(sqladmin.googleapis.com/Instance)

instances.restoreBackup project, instance, and body.restoreInstanceSettings.region
{"project": "TARGET_PROJECT_ID", "instance": "test-restore-sql-{EXECUTION_ID}", "body": {"restoreInstanceSettings": {"region": "TARGET_REGION", "settings": {"tier": "db-custom-2-7680"}}}}

Set up restore verification schedules

After you create a restore template, follow these steps to schedule automated verification runs by using the gcloud CLI:

  1. Create a restore verification plan to define the schedule and lifecycle policy for automated verification runs by using the gcloud backup-dr restore-verification-plans create command:

    gcloud backup-dr restore-verification-plans create PLAN_ID \
        --project=ORCHESTRATION_PROJECT_ID \
        --location=LOCATION \
        --schedule="0 1 * * *" \
        --time-zone="America/New_York" \
        --success-cleanup-delay="1h" \
        --failure-cleanup-delay="24h" \
        --description="Daily restore verification plan"
    

    Replace the following:

    • PLAN_ID: the ID of the restore verification plan to create.

    • ORCHESTRATION_PROJECT_ID: the project ID of the restore orchestration project.

    • LOCATION: the region where the plan is created.

    The --schedule flag requires fixed integer values for both the minute (0-59) and hour (0-23) fields—that is, at most one scheduled run per day. Wildcards (* or */N), ranges, or lists in the minute or hour fields are rejected.

  2. Create a restore verification plan association to link the restore verification plan to a specific restore template by using the gcloud backup-dr restore-verification-plan-associations create command:

    gcloud backup-dr restore-verification-plan-associations create ASSOCIATION_ID \
        --project=ORCHESTRATION_PROJECT_ID \
        --location=LOCATION \
        --restore-verification-plan=PLAN_ID \
        --resource-type="RESOURCE_TYPE" \
        --restore-template="projects/VAULT_PROJECT_ID/locations/LOCATION/restoreTemplates/RESTORE_TEMPLATE_ID"
    

    Replace the following:

    • ASSOCIATION_ID: the ID of the restore verification plan association to create.

    • ORCHESTRATION_PROJECT_ID: the project ID of the restore orchestration project.

    • LOCATION: the region where the association is created.

    • PLAN_ID: the ID of the restore verification plan.

    • RESOURCE_TYPE: the target resource type matching the restore template (compute.googleapis.com/Instance, compute.googleapis.com/Disk, compute.googleapis.com/RegionDisk, or sqladmin.googleapis.com/Instance).

    • VAULT_PROJECT_ID: the project ID of the backup vault project.

    • RESTORE_TEMPLATE_ID: the ID of the restore template.

Run on-demand restore verification tests

Perform an ad hoc verification run to validate a specific recovery point on demand:

  1. Trigger on-demand restore verification to validate a specific recovery point by using a plan association with the gcloud backup-dr restore-verification-plan-associations trigger-restore-verification command:

    gcloud backup-dr restore-verification-plan-associations trigger-restore-verification ASSOCIATION_ID \
        --project=ORCHESTRATION_PROJECT_ID \
        --location=LOCATION \
        --restore-verification-plan=PLAN_ID
    

    Replace the following:

    • ASSOCIATION_ID: the ID of the restore verification plan association.

    • ORCHESTRATION_PROJECT_ID: the project ID of the restore orchestration project.

    • LOCATION: the region of the association.

    • PLAN_ID: the ID of the restore verification plan.

  2. Run a restore template directly to perform an ad hoc execution without a verification plan. The gcloud backup-dr restore-templates run command creates an on-demand execution without automatic cleanup. Passing the --backup flag is optional; if you omit --backup, the command restores the latest backup from the data source configured in the restore template:

    gcloud backup-dr restore-templates run RESTORE_TEMPLATE_ID \
        --project=VAULT_PROJECT_ID \
        --location=LOCATION \
        --backup="projects/VAULT_PROJECT_ID/locations/VAULT_LOCATION/backupVaults/VAULT_ID/dataSources/DATA_SOURCE_ID/backups/BACKUP_ID"
    

    Replace the following:

    • RESTORE_TEMPLATE_ID: the ID of the restore template.

    • VAULT_PROJECT_ID: the project ID of the backup vault project.

    • LOCATION: the region of the template.

    • VAULT_LOCATION: the region of the backup vault.

    • VAULT_ID: the ID of the backup vault.

    • DATA_SOURCE_ID: the ID of the data source.

    • BACKUP_ID (optional): the ID of a specific backup to restore for verification. Omit the --backup flag to use the latest backup from the data source configured in the restore template.

  3. Trigger on-demand cleanup to delete temporary test instances manually. The gcloud backup-dr restore-template-executions trigger-restore-cleanup command applies only to verification runs triggered by using a restore verification plan association, such as scheduled runs or on-demand runs from step 1. Use this command to clean up resources early during the cleanup delay window or to retry a failed cleanup. Calling the trigger-restore-cleanup command on an execution created by the restore-templates run command fails with a 400 FAILED_PRECONDITION (RESTORE_TEMPLATE_EXECUTION_CLEANUP_NOT_SUPPORTED) error:

    gcloud backup-dr restore-template-executions trigger-restore-cleanup EXECUTION_ID \
        --project=VAULT_PROJECT_ID \
        --location=LOCATION \
        --restore-template=RESTORE_TEMPLATE_ID
    

    Replace the following:

    • EXECUTION_ID: the ID of the restore execution.

    • VAULT_PROJECT_ID: the project ID of the backup vault project.

    • LOCATION: the region of the execution.

    • RESTORE_TEMPLATE_ID: the ID of the restore template.

Monitor, alert, and report on verification runs

You can monitor the status of your verification runs, set up alerts, and generate reports in the Google Cloud console.

  1. Monitor the status of your verification jobs centrally by using the Google Cloud console. Viewing the Restore verification report in the Google Cloud console requires your project to be on the allowlist and requires Observability Analytics to be enabled on the _Default log bucket in the project:

    1. In the Google Cloud console, go to the Reports dashboard page:

      Go to Reports dashboard

    2. Select the Restore verification tab:

      • If your project isn't on the allowlist, a banner appears stating that the feature is available only for projects on the allowlist. To add your project to the allowlist, request access through your TAM, create a support case with Customer Care, or click Support in the banner.

      • If your project is on the allowlist and the _Default log bucket isn't upgraded yet, follow the on-screen prompt to upgrade the bucket to use Observability Analytics.

    3. Select a time range (1 hour, 12 hours, 1 day, 7 days, 14 days, 30 days, or Custom) to view the summary widgets:

      • Overall status distribution: Shows the total count and status distribution of restore verification runs.

      • Failure status summary: Lists the Failure count for each verification phase (Preparing failures, Pre-restore failures, Restore failures, Post-restore failures, Verification failures, and Cleanup failures).

    4. In the Restore verification jobs table, use the Filter field to filter runs by property name or value, such as Overall status (Succeeded, Failed, Running, or Skipped), Resource name, Resource type, Job category, or Restore verification plan. To view the vaulted backup details for a resource, click its name in the Resource name column.

    5. Inspect the six status columns for each run:

      • Overall status: Shows the overall execution outcome, which fails if any phase encounters an error. Click the status in the Overall status column to open the Restore verification job details side panel, which displays run metadata (Resource name, Resource type, Job category, Backup ID, Restore verification plan, and Vault) and a phase breakdown table showing the Phase, Status, Start time, End time, Duration, Error code, Error type, and Error message for all execution phases (Preparing, Executing pre-restore, Restoring, Executing post-restore, Verifying, Waiting for cleanup, and Cleaning up). Click Close to close the side panel.

      • Pre-restore scripts: Indicates the status of scripts run before resource restoration, or Skipped if not configured.

      • Restore status: Indicates the status of restoring resource data from the backup to the target environment.

      • Post-restore scripts: Indicates the status of scripts run after resource restoration, or Skipped if not configured.

      • Verification scripts: Indicates the status of validation scripts run on the restored resource, or Skipped if not configured.

      • Cleanup status: Indicates the status of deleting the temporary restored test resource.

  2. Set up long-term retention for your verification logs by using BigQuery:

    1. In the Google Cloud console, go to the Log Router page:

      Go to Log Router

    2. Click Create sink to configure log export from Cloud Logging to a BigQuery dataset for retention beyond 30 days.

    3. Connect your BigQuery verification log dataset to Data Studio to generate immutable audit reports.

Manage verification plans and test configurations

You can manage your verification plans, plan associations, and restore templates, including modifying or deleting them:

  • You can update restore templates in place as needed.

  • Restore verification plans and restore verification plan associations are immutable after you create them. To change their settings, you must delete and recreate them.

Modify a template

Update a restore template configuration by using the gcloud backup-dr restore-templates update command:

gcloud backup-dr restore-templates update RESTORE_TEMPLATE_ID \
    --project=VAULT_PROJECT_ID \
    --location=LOCATION \
    --description="Updated restore template configuration" \
    --restore-properties='{"project": "TARGET_PROJECT_ID", "zone": "TARGET_ZONE", "resource": {"name": "test-restore-vm-v2-{EXECUTION_ID}", "machineType": "zones/TARGET_ZONE/machineTypes/e2-standard-4"}}' \
    --verification-cloud-run-job="projects/CLOUD_RUN_PROJECT_ID/locations/LOCATION/jobs/NEW_VERIFY_JOB" \
    --verification-timeout="600s"

Replace the following:

  • RESTORE_TEMPLATE_ID: the ID of the restore template to update.
  • VAULT_PROJECT_ID: the project ID of the backup vault project.
  • LOCATION: the region of the template.
  • TARGET_PROJECT_ID: the project ID of the target resource project.
  • TARGET_ZONE: the zone for the target resource.
  • CLOUD_RUN_PROJECT_ID: the project ID of the Cloud Run jobs project.
  • NEW_VERIFY_JOB: the name of the new verification Cloud Run job.

Delete or detach verification resources

Delete or detach verification resources when they are no longer needed.

Detach a restore verification plan association

Detach a restore verification plan association from a template by using the gcloud backup-dr restore-verification-plan-associations delete command:

gcloud backup-dr restore-verification-plan-associations delete ASSOCIATION_ID \
    --project=ORCHESTRATION_PROJECT_ID \
    --location=LOCATION \
    --restore-verification-plan=PLAN_ID

Replace the following:

  • ASSOCIATION_ID: the ID of the restore verification plan association to delete.

  • ORCHESTRATION_PROJECT_ID: the project ID of the restore orchestration project.

  • LOCATION: the region of the association.

  • PLAN_ID: the ID of the restore verification plan.

Delete a restore verification plan

Delete a restore verification plan by using the gcloud backup-dr restore-verification-plans delete command. The --force flag also deletes any child restore verification plan associations under the plan:

gcloud backup-dr restore-verification-plans delete PLAN_ID \
    --project=ORCHESTRATION_PROJECT_ID \
    --location=LOCATION \
    --force

Replace the following:

  • PLAN_ID: the ID of the restore verification plan to delete.

  • ORCHESTRATION_PROJECT_ID: the project ID of the restore orchestration project.

  • LOCATION: the region of the plan.

Delete a restore template

Delete a restore template by using the gcloud backup-dr restore-templates delete command. The --force flag also deletes child execution records under the template, unless an execution is in the RUNNING state. An execution remains in the RUNNING state while waiting in its cleanup delay window. In this case, the trigger-restore-cleanup command must complete before you can delete the template:

gcloud backup-dr restore-templates delete RESTORE_TEMPLATE_ID \
    --project=VAULT_PROJECT_ID \
    --location=LOCATION \
    --force

Replace the following:

  • RESTORE_TEMPLATE_ID: the ID of the restore template to delete.

  • VAULT_PROJECT_ID: the project ID of the backup vault project.

  • LOCATION: the region of the template.

What's next