Stay organized with collections
Save and categorize content based on your preferences.
Autopilot
Standard
This page provides an overview of volume data restore policies. It also
explains how to configure volume data restore policy bindings and overrides.
Overview
The volume data restore policy defines how to restore volume data from a backup.
You can configure it at the restore plan level. It has the following policy options:
Provision new volumes and restore volume data from backup: New
persistent volumes (PVs) are restored using the corresponding volume
backup data in the backup.
Reuse existing volumes containing your data: PVs are pre-provisioned
using the volume handle of the original PV in the backup.
Don't restore volume data: PVs aren't restored. Backup for GKE only
restores the selected persistent volume claims (PVCs) and expects the
corresponding storage driver to either dynamically provision blank PVs
or bind them to pre-provisioned PVs created out-of-band.
For instructions on creating a restore plan with volume data restore policy,
see Create a restore plan.
There are a few reasons why you might want to define custom volume restore
behavior apart from the default volume data restore policy:
To restore a workload with a storage environment that includes different
types of volumes with varying levels of data backup support. For example,
your workload may contain NFS volumes and Persistent Disk volumes.
To apply a different restore process to a specific volume.
Backup for GKE provides two mechanisms for defining custom volume restore behavior:
Volume type specific bindings, which you can define as part of a restore plan.
Volume specific overrides, which you can define as part of a restore.
Volume data restore policy selection process
During the restore process, Backup for GKE selects the appropriate volume
restore policy for each PersistentVolumeClaim (PVC) using the following sequence:
Before any transformation rules are applied, each PVC to be restored moves
through a selection process and applies the first in-scope policy.
If the PVC is not bound to a backed up PersistentVolume (PV), only the PVC
configuration is restored. This doesn't include any data.
If the PVC is included in a volume data restore policy override, the
override policy takes precedence.
If the PVC's volume type is included in a volume data restore policy binding,
the binding policy is applied.
If none of the earlier conditions match, the PVC uses the default volume data
restore policy.
Volume data restore policy bindings
The volume data restore policy bindings let you restore volume data with a
policy for a specific volume type. This policy takes precedence over the
default volume restore policy. The volume data restore policy binding is only
supported for Compute Engine Persistent Disks.
gcloud
Add volume data restore policy bindings to an existing restore plan:
RESTORE_PLAN: the name of the restore plan that you want to update.
PROJECT_ID: the ID of your Google Cloud project.
LOCATION: the compute region
for the resource, such as us-central1.
VOLUME_TYPE=POLICY: binds a supported volume type to
a volume data restore policy. For example, gce-persistent-disk=restore-volume-data-from-backup
creates a binding that results in Persistent Disk volumes being restored using
the Restore volume data from backup policy.
Console
Use the following instructions to add bindings to an existing restore plan in the Google Cloud console:
In the Google Cloud console, go to the Google Kubernetes Engine page.
In the Restore configuration section, click Edit that is next to Scope.
In the Define policy override for specific volume types section,
click the GCE Persistent Disk checkbox.
From the Volume data restore policy list, choose a restore policy
type that you want to use for Compute Engine Persistent Disk.
Click Save changes.
Volume data restore policy overrides
The volume data restore policy overrides define how to restore specific volumes.
Volumes are selected by their PVC namespaces and PVC names. You can include
multiple volumes in a single override.
Overrides don't enforce unique scoping, unlike bindings. This means that during
volume restoration, the policy from the latest override that matches a volume's
namespace and name is used.
Override example
The following example overrides ns-1/test-pvc and ns-1/test-pvc-2 to use
the Reuse existing volumes containing your data policy and ns-2/test-pvc-3
to use the Don't restore volume data policy.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Define volume data restore behavior\n\nAutopilot Standard\n\n*** ** * ** ***\n\nThis page provides an overview of volume data restore policies. It also\nexplains how to configure volume data restore policy bindings and overrides.\n\nOverview\n--------\n\nThe volume data restore policy defines how to restore volume data from a backup.\nYou can configure it at the restore plan level. It has the following policy options:\n\n- **Provision new volumes and restore volume data from backup**: New persistent volumes (PVs) are restored using the corresponding volume backup data in the backup.\n- **Reuse existing volumes containing your data**: PVs are pre-provisioned using the volume handle of the original PV in the backup.\n- **Don't restore volume data**: PVs aren't restored. Backup for GKE only restores the selected persistent volume claims (PVCs) and expects the corresponding storage driver to either dynamically provision blank PVs or bind them to pre-provisioned PVs created out-of-band.\n\nFor instructions on creating a restore plan with volume data restore policy,\nsee [Create a restore plan](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore-plan#create_a_restore_plan).\n\nThere are a few reasons why you might want to define custom volume restore\nbehavior apart from the default volume data restore policy:\n\n- To restore a workload with a storage environment that includes different types of volumes with varying levels of data backup support. For example, your workload may contain NFS volumes and Persistent Disk volumes.\n- To apply a different restore process to a specific volume.\n\nBackup for GKE provides two mechanisms for defining custom volume restore behavior:\n\n- Volume type specific bindings, which you can define as part of a [restore plan](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore-plan#create_a_restore_plan).\n- Volume specific overrides, which you can define as part of a [restore](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore#create_a_restore).\n\nVolume data restore policy selection process\n--------------------------------------------\n\nDuring the restore process, Backup for GKE selects the appropriate volume\nrestore policy for each PersistentVolumeClaim (PVC) using the following sequence:\n\n1. Before any transformation rules are applied, each PVC to be restored moves through a selection process and applies the first in-scope policy.\n2. If the PVC is not bound to a backed up PersistentVolume (PV), only the PVC configuration is restored. This doesn't include any data.\n3. If the PVC is included in a volume data restore policy override, the override policy takes precedence.\n4. If the PVC's volume type is included in a volume data restore policy binding, the binding policy is applied.\n5. If none of the earlier conditions match, the PVC uses the default volume data restore policy.\n\n| **Note:** If the **Provision new volumes and restore volume data from backup** policy is applied to a volume without a volume backup, Backup for GKE restores the PVC configuration without data.\n\nVolume data restore policy bindings\n-----------------------------------\n\nThe volume data restore policy bindings let you restore volume data with a\npolicy for a specific volume type. This policy takes precedence over the\ndefault volume restore policy. The volume data restore policy binding is only\nsupported for Compute Engine Persistent Disks. \n\n### gcloud\n\nAdd volume data restore policy bindings to an existing restore plan: \n\n gcloud beta container backup-restore restore-plans update \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --volume-data-restore-policy-bindings=[\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nv\"\u003eVOLUME_TYPE\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e=\u003c/span\u003ePOLICY,...\u003c/var\u003e]\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e: the name of the restore plan that you want to update.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [compute region](/compute/docs/regions-zones#available) for the resource, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eVOLUME_TYPE=POLICY\u003c/var\u003e: binds a supported volume type to a volume data restore policy. For example, `gce-persistent-disk=restore-volume-data-from-backup` creates a binding that results in Persistent Disk volumes being restored using the **Restore volume data from backup** policy.\n\n### Console\n\nUse the following instructions to add bindings to an existing restore plan in the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine** page.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. In the navigation menu, click **Backup for GKE**.\n\n3. Click the **Restore plans** tab.\n\n4. Click the restore plan name.\n\n5. Click the **Details** tab.\n\n6. In the **Restore configuration** section, click **Edit** that is next to **Scope**.\n\n7. In the **Define policy override for specific volume types** section,\n click the **GCE Persistent Disk** checkbox.\n\n8. From the **Volume data restore policy** list, choose a restore policy\n type that you want to use for Compute Engine Persistent Disk.\n\n9. Click **Save changes**.\n\nVolume data restore policy overrides\n------------------------------------\n\nThe volume data restore policy overrides define how to restore specific volumes.\nVolumes are selected by their PVC namespaces and PVC names. You can include\nmultiple volumes in a single override.\n\nOverrides don't enforce unique scoping, unlike bindings. This means that during\nvolume restoration, the policy from the latest override that matches a volume's\nnamespace and name is used.\n\n### Override example\n\nThe following example overrides `ns-1/test-pvc` and `ns-1/test-pvc-2` to use\nthe **Reuse existing volumes containing your data** policy and `ns-2/test-pvc-3`\nto use the **Don't restore volume data** policy. \n\n volumeDataRestorePolicyOverrides:\n - policy: REUSE_VOLUME_HANDLE_FROM_BACKUP\n selectedPvcs:\n namespacedNames:\n - namespace: ns-1\n name: test-pvc\n - namespace: ns-1\n name: test-pvc-2\n - policy: NO_VOLUME_DATA_RESTORATION\n selectedPvcs:\n namespacedNames:\n - namespace: ns-2\n name: test-pvc-3\n\n### gcloud\n\nCreate a restore with overrides: \n\n gcloud beta container backup-restore restores create \u003cvar translate=\"no\"\u003eRESTORE\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --restore-plan=\u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e \\\n --backup=\u003cvar translate=\"no\"\u003eBACKUP\u003c/var\u003e \\\n --volume-data-restore-policy-overrides-file=\u003cvar translate=\"no\"\u003eOVERRIDES_FILE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRESTORE\u003c/var\u003e: the name of the restore that you want to create.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [compute region](/compute/docs/regions-zones#available) of the parent restore plan.\n- \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e: the name of the parent restore plan this restore is derived from.\n- \u003cvar translate=\"no\"\u003eBACKUP\u003c/var\u003e: the backup to restore.\n- \u003cvar translate=\"no\"\u003eOVERRIDES_FILE\u003c/var\u003e: the path to a YAML file that defines overrides in the schema as seen in the example.\n\n### Console\n\nTo create a volume data restore policy override, you need to provide the\nPVC name, PVC namespace, and a restore policy.\n\nUse the following instructions to create a restore with overrides in the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine** page.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. In the navigation menu, click **Backup for GKE**.\n\n3. Click the **Backups** tab.\n\n4. In the list of backups, find the backup that you want to restore and click **Set up a restore**.\n\n5. Choose a restore plan from the list of plans that apply to this backup.\n\n6. In the **Name the restore** section, enter a name and optional description for the restore.\n\n7. In the **Override volume data restore policy** section, click **Add policy**\n and complete the following for each override:\n\n 1. In **PVC name**, enter the name of the PVC.\n 2. In **Namespace**, enter the namespace of the PVC.\n 3. From the **Volume restore policy** list, choose how to restore that PVC's volume data.\n8. Click **Restore**.\n\nWhat's next\n-----------\n\n- Learn more about [restoring a backup](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore)."]]