Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come creare piani di backup con ambito
che eseguono il backup dei carichi di lavoro delle macchine virtuali (VM) in base a una pianificazione definita in Google Distributed Cloud (GDC) air-gapped.
I piani di backup forniscono la configurazione e la posizione dei backup. Un piano di backup
contiene una configurazione di backup che include la VM di origine e la selezione
della VM di cui eseguire il backup. I piani di backup definiscono una pianificazione regolare per l'esecuzione dei backup delle VM. Ogni piano di backup basato su VM fa riferimento alle risorse VM o disco VM di destinazione di cui eseguire il backup utilizzando un selettore di etichette definito in una risorsa ProtectedApplication.
Prima di iniziare
Per creare piani di backup delle VM, devi disporre di quanto segue:
Per creare backup delle VM in base a una pianificazione definita con un ambito specificato, devi creare una risorsa VirtualMachineBackupPlan utilizzando l'API. Questa risorsa specifica l'ambito del backup della VM e la pianificazione cron che definisce la frequenza di creazione del backup.
Imposta l'ambito del piano di backup delle VM in due modi:
Utilizza un elenco: specifica le macchine virtuali o i dischi delle macchine virtuali di cui eseguire il backup sotto forma di elenco. Questi target di backup sono elencati nei campi selectedVirtualMachines e selectedVirtualMachineDisks.
Utilizza un'etichetta: fornisci un'etichetta che selezioni tutte le macchine virtuali o i dischi delle macchine virtuali che contengono il valore dell'etichetta. Tutte le VM corrispondenti vengono sottoposte a backup da questo piano di backup.
Crea un piano di backup delle VM utilizzando un elenco
Per creare un piano di backup della VM utilizzando il metodo di elenco, specifica le destinazioni di backup nei campi selectedVirtualMachines e selectedVirtualMachineDisks:
BACKUP_PLAN_NAMESPACE: lo spazio dei nomi contenente il piano di backup.
BACKUP_TEMPLATE_NAME: il modello di piano di backup della macchina virtuale che punta al repository di backup pertinente creato in Crea un piano di backup.
VM_NAME: specifica i nomi delle VM come elenco nel campo selectedVirtualMachines. Questo elenco di VM viene sottoposto a backup da questo piano di backup delle macchine virtuali. Se viene specificata più di una VM, l'elenco deve avere il seguente formato:
VM_DISK_NAME: l'elenco dei dischi VM di cui viene eseguito il backup da questo piano di backup della macchina virtuale. Se vengono specificati più dischi VM, l'elenco deve avere il seguente formato:
VOLUME_STRATEGY: Il tipo di backup del volume da eseguire. Ad esempio, LocalSnapshotOnly.
CRON_SCHEDULE: l'espressione cron che definisce la pianificazione di backup scelta. Ad esempio, un valore cron pari a 0 */12 * * * crea un backup ogni 12 ore.
Crea un piano di backup della VM utilizzando un'etichetta
Per creare un piano di backup delle VM utilizzando il metodo delle etichette, specifica un'etichetta nel campo vmResourceLabelSelector che corrisponda alle VM di destinazione di cui vuoi eseguire il backup:
BACKUP_PLAN_NAMESPACE: lo spazio dei nomi contenente il piano di backup.
BACKUP_TEMPLATE_NAME: il modello di piano di backup della macchina virtuale che punta al repository di backup pertinente creato in Crea un piano di backup.
KEY: VALUE: il selettore di etichette che corrisponde alle etichette specificate per qualsiasi VM che contiene quell'etichetta. Tutte le VM corrispondenti trovate nello stesso spazio dei nomi vengono sottoposte a backup da questo piano di backup. Questo oggetto deve essere nel formato keys:string, values:string.
VOLUME_STRATEGY: Il tipo di backup del volume da eseguire. Ad esempio, LocalSnapshotOnly.
CRON_SCHEDULE: l'espressione cron che definisce la pianificazione di backup scelta. Ad esempio, un valore cron pari a 0 */12 * * * crea un backup ogni 12 ore.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)"]]