Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to create scoped backup plans
that back up virtual machine (VM) workloads on a defined schedule in Google Distributed Cloud (GDC) air-gapped.
Backup plans provide the configuration and location for backups. A backup plan
contains a backup configuration including the source VM and the selection of
which VM to back up. Backup plans define a regular schedule for which backups of
VMs occur. Every VM-based backup plan references the target VM or VM disk
resources to be backed up using a label selector defined in a
ProtectedApplication resource.
Before you begin
To create VM backup plans, you must have the following:
An existing VirtualMachineBackupPlanTemplate. For more information, see Create a backup plan.
To create VM backups on a defined schedule that have a scope specified, you must create a VirtualMachineBackupPlan resource using the API. This resource specifies the scope of the VM backup and the cron schedule that defines the frequency of backup creation.
Set the scope of the VM backup plan in two ways:
Use a list: Specify the virtual machines or virtual machine disks to back up in the form of a list. These backup targets are listed in the fields selectedVirtualMachines and selectedVirtualMachineDisks.
Use a label: Provide a label that selects all virtual machines or virtual machine disks that contain that label value. Any matching VMs are backed up by this backup plan.
Create a VM backup plan using a list
To create a VM backup plan using the list method, specify the backup targets in the selectedVirtualMachines and selectedVirtualMachineDisks fields:
BACKUP_PLAN_NAMESPACE: the namespace containing the backup plan.
BACKUP_TEMPLATE_NAME: the virtual machine backup plan template that points to the relevant backup repository created in Create a backup plan.
VM_NAME: Specify the VM names as a list in the selectedVirtualMachines field. This list of VMs is backed up by this virtual machine backup plan. If more than one VM is specified, the list must be in the following format:
VM_DISK_NAME: The list of VM disks that is backed up by this virtual machine backup plan. If more than one VM disk is specified, the list must be in the following format:
BACKUP_PLAN_NAMESPACE: the namespace containing the backup plan.
BACKUP_TEMPLATE_NAME: the virtual machine backup plan template that points to the relevant backup repository created in Create a backup plan.
KEY: VALUE: the label selector that matches the given labels to any VMs that contain that label. Any matching VMs found in the same namespace are backed up by this backup plan. This object must be in the format keys:string, values:string.
VOLUME_STRATEGY: The type of volume backup to perform. For example, LocalSnapshotOnly.
CRON_SCHEDULE: the cron expression that defines the chosen backup schedule. For example, a cron value of 0 */12 * * * creates a backup every 12 hours.
[[["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."],[[["\u003cp\u003eThis guide details how to create scoped backup plans for virtual machine (VM) workloads in Google Distributed Cloud (GDC) air-gapped, including setting a defined backup schedule.\u003c/p\u003e\n"],["\u003cp\u003eBackup plans require a \u003ccode\u003eVirtualMachineBackupPlanTemplate\u003c/code\u003e and the correct identity and access roles, to establish the configuration and location for backups, as well as the selection of VMs to back up.\u003c/p\u003e\n"],["\u003cp\u003eThe scope of a VM backup plan can be defined by either listing specific VMs or VM disks in the \u003ccode\u003eselectedVirtualMachines\u003c/code\u003e and \u003ccode\u003eselectedVirtualMachineDisks\u003c/code\u003e fields or by using a label selector that matches relevant VM resources.\u003c/p\u003e\n"],["\u003cp\u003eThe frequency of backups is determined by a cron schedule defined within the \u003ccode\u003eVirtualMachineBackupPlan\u003c/code\u003e resource, specifying when backups should occur.\u003c/p\u003e\n"],["\u003cp\u003eOnce the backup plans are set, users can also create manual backups or restore from backups through other functions.\u003c/p\u003e\n"]]],[],null,["# Create a scoped backup plan\n\nThis page describes how to create scoped backup plans\nthat back up virtual machine (VM) workloads on a defined schedule in Google Distributed Cloud (GDC) air-gapped.\n\nBackup plans provide the configuration and location for backups. A backup plan\ncontains a backup configuration including the source VM and the selection of\nwhich VM to back up. Backup plans define a regular schedule for which backups of\nVMs occur. Every VM-based backup plan references the target VM or VM disk\nresources to be backed up using a label selector defined in a\n`ProtectedApplication` resource.\n\nBefore you begin\n----------------\n\nTo create VM backup plans, you must have the following:\n\n- An existing `VirtualMachineBackupPlanTemplate`. For more information, see [Create a backup plan](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/create-backup-plan#api).\n- The necessary identity and access role. For more information, see [Prepare roles and permissions](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/scope-schedule/vm-scope-overview#prepare-roles-permissions).\n\nCreate a backup plan\n--------------------\n\nTo create VM backups on a defined schedule that have a scope specified, you must create a `VirtualMachineBackupPlan` resource using the API. This resource specifies the scope of the VM backup and the cron schedule that defines the frequency of backup creation.\n\nSet the scope of the VM backup plan in two ways:\n\n- [Use a list](#create-backup-plan-list): Specify the virtual machines or virtual machine disks to back up in the form of a list. These backup targets are listed in the fields `selectedVirtualMachines` and `selectedVirtualMachineDisks`.\n- [Use a label](#create-backup-plan-label): Provide a label that selects all virtual machines or virtual machine disks that contain that label value. Any matching VMs are backed up by this backup plan.\n\n### Create a VM backup plan using a list\n\nTo create a VM backup plan using the list method, specify the backup targets in the `selectedVirtualMachines` and `selectedVirtualMachineDisks` fields: \n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineBackupPlan\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_PLAN_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_PLAN_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n spec:\n virtualMachineBackupPlanTemplate: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_TEMPLATE_NAME\u003c/span\u003e\u003c/var\u003e\n backupConfig:\n backupScope:\n selectedVirtualMachines:\n - resourceName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_NAME\u003c/span\u003e\u003c/var\u003e\n selectedVirtualMachineDisks:\n - resourceName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_DISK_NAME\u003c/span\u003e\u003c/var\u003e\n volumeStrategy: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVOLUME_STRATEGY\u003c/span\u003e\u003c/var\u003e\n backupSchedule:\n cronSchedule: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCRON_SCHEDULE\u003c/span\u003e\u003c/var\u003e\n paused: false\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eBACKUP_PLAN_NAME\u003c/var\u003e: the name of the backup plan.\n- \u003cvar translate=\"no\"\u003eBACKUP_PLAN_NAMESPACE\u003c/var\u003e: the namespace containing the backup plan.\n- \u003cvar translate=\"no\"\u003eBACKUP_TEMPLATE_NAME\u003c/var\u003e: the virtual machine backup plan template that points to the relevant backup repository created in [Create a backup plan](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/create-backup-plan#api).\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: Specify the VM names as a list in the `selectedVirtualMachines` field. This list of VMs is backed up by this virtual machine backup plan. If more than one VM is specified, the list must be in the following format:\n\n selectedVirtualMachines:\n - resourceName: \"virtualmachine\"\n - resourceName: \"virtualmachine-2\"\n ...\n - resourceName: \"virtualmachine-n\"\n\n- \u003cvar translate=\"no\"\u003eVM_DISK_NAME\u003c/var\u003e: The list of VM disks that is backed up by this virtual machine backup plan. If more than one VM disk is specified, the list must be in the following format:\n\n selectedVirtualMachineDisks:\n - resourceName: \"disk-1\n - resourceName: \"disk-2\"\n ...\n - resourceName: \"disk-n\"\n\n- \u003cvar translate=\"no\"\u003eVOLUME_STRATEGY\u003c/var\u003e: The type of volume backup to perform. For example, `LocalSnapshotOnly`.\n\n- \u003cvar translate=\"no\"\u003eCRON_SCHEDULE\u003c/var\u003e: the cron expression that defines the chosen backup schedule. For example, a cron value of `0 */12 * * *` creates a backup every 12 hours.\n\n### Create a VM backup plan using a label\n\nTo create a VM backup plan using the label method, specify a label in `vmResourceLabelSelector` field that matches the target VMs you want to back up: \n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineBackupPlan\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_PLAN_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_PLAN_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n spec:\n virtualMachineBackupPlanTemplate: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_TEMPLATE_NAME\u003c/span\u003e\u003c/var\u003e\n backupConfig:\n backupScope:\n vmResourceLabelSelector:\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nt\"\u003eKEY\u003c/span\u003e\u003c/var\u003e: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVALUE\u003c/span\u003e\u003c/var\u003e\n volumeStrategy: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVOLUME_STRATEGY\u003c/span\u003e\u003c/var\u003e\n backupSchedule:\n cronSchedule: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCRON_SCHEDULE\u003c/span\u003e\u003c/var\u003e\n paused: false\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eBACKUP_PLAN_NAME\u003c/var\u003e: the name of the backup plan.\n- \u003cvar translate=\"no\"\u003eBACKUP_PLAN_NAMESPACE\u003c/var\u003e: the namespace containing the backup plan.\n- \u003cvar translate=\"no\"\u003eBACKUP_TEMPLATE_NAME\u003c/var\u003e: the virtual machine backup plan template that points to the relevant backup repository created in [Create a backup plan](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/create-backup-plan#api).\n- \u003cvar translate=\"no\"\u003eKEY\u003c/var\u003e`: `\u003cvar translate=\"no\"\u003eVALUE\u003c/var\u003e: the label selector that matches the given labels to any VMs that contain that label. Any matching VMs found in the same namespace are backed up by this backup plan. This object must be in the format `keys:string, values:string`.\n- \u003cvar translate=\"no\"\u003eVOLUME_STRATEGY\u003c/var\u003e: The type of volume backup to perform. For example, `LocalSnapshotOnly`.\n- \u003cvar translate=\"no\"\u003eCRON_SCHEDULE\u003c/var\u003e: the cron expression that defines the chosen backup schedule. For example, a cron value of `0 */12 * * *` creates a backup every 12 hours.\n\nWhat's next\n-----------\n\n- [Create a manual backup](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/scope-schedule/create-manual-backup-scoped)\n- [Create a restore](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/vm-backup/scope-schedule/create-restore-scoped)"]]