This document provides an overview of virtual machine (VM) backup and restore operations in Google Distributed Cloud (GDC) air-gapped environments. It outlines the different methodologies and the distinction between GDC console and API capabilities.
This document is for developers in platform administrator or application operator groups that manage VM backup operations. For more information, see Audiences for GDC air-gapped documentation.
GDC supports the ability to back up and restore VM-based and container-based workloads. GDC VM backup supports the backup and restoration of multiple VM or VM disk snapshots. Backups are managed through backup plans, which let you schedule regular backups or create backups manually. You can restore entire VMs, creating a new instance with the same configuration and disk state as the backup, or restore disk snapshots.
GDC backup for VMs offer the following features:
- Support for different VM instance configurations and sizes.
- Customer data stored in primary storage in the form of Kubernetes persistent volumes and VM disk images.
- Local snapshots for VM disks.
Backup and restoration process
You can back up and restore your Distributed Cloud data in the GDC console or the API.
To back up and restore VM and container workloads, follow these general steps:
- Create a backup repository.
- Create a backup plan that references the backup repository:
- Either let the backup plan automatically create scheduled backups or manually create a backup.
- Back up VMs or back up disks in the form of snapshots.
- Restore VMs or snapshots based on the backups.
Backup repository overview
Before you create backups or snapshots, you must create a backup repository. A backup repository contains configuration information, for example, the bucket name, region, and storage endpoint. The backup repository name is provided as an input parameter when you create a VM backup plan.
For more information, see Create a backup repository.
VM backup resources
The VM backup system in GDC consists of these key user-managed custom resources:
BackupRepository: Defines the storage location for your backup data. You can manage this custom resource through the API and the GDC console.VirtualMachineBackupPlanTemplate: Defines the backup repository that a backup plan uses. You can manage this custom resource through the API and the GDC console.VirtualMachineBackupPlan: Defines a scheduled, recurring backup strategy. This custom resource specifies the backup schedule, the scope of VMs to back up, and the retention policy for the backups. You can manage this custom resource only through the API.VirtualMachineBackupRequest: Starts an on-demand backup. You can use this custom resource to create one-off manual backups or to manually initiate a backup defined in aVirtualMachineBackupPlancustom resource. You can manage this custom resource through the API and the GDC console, but you can trigger a backup plan only by using the API.VirtualMachineRestoreRequest: Restores a VM from a backup. You can manage this custom resource through the API and the GDC console.
User-managed and controller-managed VM backup resources
When you set up VM backups in your project namespace, you create high-level
virtualmachine.gdc.goog/v1 custom resources. The VM backup controller then
automatically creates supporting backup.gdc.goog/v1 and gkebackup.gke.io/v1
custom resources in the same namespace.
The following table describes these user-managed and controller-managed custom resources:
| Resource role | API group and kind | Name in project namespace | How to identify | Purpose and management |
|---|---|---|---|---|
| User-managed VM backup plan and template |
Kinds: |
|
Standard user-managed custom resources in the virtualmachine.gdc.goog/v1 API group |
You create these custom resources to define the backup schedule ( Specify the target backup repository in the |
Controller-managed backing BackupPlan custom resources (for a VM backup plan) |
Kind: |
|
Label: Annotation: |
The VM backup controller creates two backing The controller keeps these backing plans configured with |
Controller-managed backing BackupPlan custom resource (for a template) |
Kind: |
VM_BACKUP_PLAN_TEMPLATE (same name as your VirtualMachineBackupPlanTemplate custom resource) |
Label: virtualmachine.gdc.goog/vmbpt-repository: BACKUP_REPOSITORY_NAME |
The VM backup controller creates this custom resource with deactivated: true and paused: true. GDC uses this custom resource to persist template metadata to the backup repository's object storage for import and disaster recovery. Don't edit or delete this custom resource. |
Controller-managed ProtectedApplication custom resource |
Kind: |
VM_BACKUP_PLAN-VM_OR_DISK_NAME |
Annotation: VMBackupPlan: VM_BACKUP_PLAN |
The VM backup controller creates this custom resource for each protected VM or disk to define which resources each backup includes. Don't edit or delete this custom resource. |
This table includes the following placeholder values:
VM_BACKUP_PLAN: the name of yourVirtualMachineBackupPlancustom resourceVM_BACKUP_PLAN_TEMPLATE: the name of yourVirtualMachineBackupPlanTemplatecustom resourceBACKUP_REPOSITORY_NAME: the name of yourBackupRepositorycustom resourceVM_OR_DISK_NAME: the name of the protected VM or VM disk
Follow these guidelines so that your changes don't conflict with the VM backup controller:
- Edit only user-managed resources: Update only
VirtualMachineBackupPlan(virtualmachine.gdc.goog/v1) custom resources;VirtualMachineBackupPlanTemplatespecifications are immutable after creation. Don't unpause or edit the controller-managed backingBackupPlan.backup.gdc.googcustom resources (VM_BACKUP_PLAN-cbandVM_BACKUP_PLAN-vb, orVM_BACKUP_PLANin the v1 organization architecture). If you unpause a backing plan, the controller either resets it or starts unexpected backups that skip VM preparation and exceedmaxConcurrencylimits. Don't manually create aBackupPlan.backup.gdc.googcustom resource namedVM_BACKUP_PLAN-cborVM_BACKUP_PLAN-vb(orVM_BACKUP_PLANin the v1 organization architecture). Creating a duplicate blocks the VM backup controller with an error similar tobackup plan VM_BACKUP_PLAN-cb does not have annotation VMBackupPlan: VM_BACKUP_PLAN. - Pause schedules safely: To pause scheduled backups during maintenance,
set the
spec.backupSchedule.pausedfield totrueon yourVirtualMachineBackupPlancustom resource instead of deleting the plan. - Run on-demand backups with backup requests: To start an on-demand
backup, don't edit the
cronSchedulefield. Instead, create aVirtualMachineBackupRequestcustom resource (virtualmachine.gdc.goog/v1). - Configure backup repositories: Specify the target backup repository in
the
spec.backupRepositoryfield of aVirtualMachineBackupPlanTemplatecustom resource and reference that template in thespec.virtualMachineBackupPlanTemplatefield of yourVirtualMachineBackupPlancustom resource. Thespec.backupConfig.backupRepositoryfield is for internal use only, and the controller populates it from the template during reconciliation. - Keep controller finalizers and labels: Don't remove controller
finalizers or controller-managed scope labels. Controller finalizers
include
virtualmachine.gdc.goog/vmbp-pa-finalizerandvirtualmachine.gdc.goog/vmbp-finalizeronVirtualMachineBackupPlancustom resources, andvirtualmachine.gdc.goog/vmbpt-finalizeronVirtualMachineBackupPlanTemplatecustom resources. Controller-managed scope labels includebpvms/VM_NAME: IncludedInBackupScope,bpdisks/DISK_NAME: IncludedInBackupScope, andbackupplans/VM_BACKUP_PLAN: IncludedInBackupScope. In these labels,VM_NAMEis the VM name, andDISK_NAMEis the VM disk name. Removing these finalizers or labels can prevent GDC from selecting backup resources or cleanly deleting controller-managedProtectedApplicationand backingBackupPlancustom resources.
Plan backups
You can create a backup plan and perform backup and restore functions using either the API or the GDC console. All backup methods are supported through the API, while on-demand, manual backups are the only backup types the GDC console supports.
Scheduled backups (API only)
This method involves the creation of a VirtualMachineBackupPlan resource,
which references a VirtualMachineBackupPlanTemplate. You can define a
recurring backup schedule, the scope of VMs to include, and a retention policy.
For more details, see Create a scheduled backup plan to back up and restore VMs.
On-demand backups (GDC console and API)
This method uses a VirtualMachineBackupRequest resource that directly references
a VirtualMachineBackupPlanTemplate. You can perform a one-time backup of a
specific VM or VM disk. For more details, see Create a manual backup.
Manual trigger of a defined backup plan (GDC console and API)
This method uses a VirtualMachineBackupRequest resource that references an existing
VirtualMachineBackupPlan. It immediately triggers a backup of all VMs defined
in the scope of the referenced plan. This backup method is useful for taking an
ad hoc backup of a group of VMs that are part of a scheduled plan.
For more information, see Create a manual backup.
Restore backups
You can restore VM workloads or disk snapshots for backups you create manually or as part of the scheduled backup plans:
For scheduled backup plan restoration, see Create a backup restore or Create a fine-grained restore
For VM workloads, the restoration process creates a new VM with the same configuration and disk state as the backup. For more information, see Create a VM from a backup.
For disk snapshots, the restore creates a new disk with the same configuration and disk state as the snapshot. For more information, see Restore from a snapshot.