Manage virtual machine backups

This document guides you through managing Virtual Machine (VM) backups and VM disk snapshots in Google Distributed Cloud (GDC) air-gapped, and details how to view and delete them.

This document helps developers in platform administrator or application operator groups who optimize storage usage while complying with data retention policies. For more information, see Audiences for GDC air-gapped documentation.

Before you begin

Before you perform VM backup and restore operations, you must request the necessary IAM roles.

Request IAM permissions

To manage VMs and VM disk backups, ask your Project IAM Admin to grant you the following roles:

  • Project VirtualMachine Admin (project-vm-admin): Manages VMs in the project namespace.
  • Backup Creator (backup-creator): Creates manual backups and restores.
  • Project Viewer (project-viewer): Has read-only access to all resources within project namespaces.

Follow the steps to verify your access.

Manage VM backups

The following section describes the technical steps to list and delete your VM backups.

List VM backups

View a list of VM backups using the GDC console or kubectl.

Console

  1. Sign into the GDC console.
  2. In the navigation menu, click Backup for Virtual Machines.
  3. Select a project.
  4. Click the Backups tab.
  5. Click a backup in the list to view its details.

kubectl

View a VM backup by listing the backups and viewing their details.

  1. List the existing backups:

    kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n PROJECT_NAME
    

    Replace PROJECT_NAME with the name of the project.

  2. In the list, find the backup that you want to view.

  3. View the backup details:

    kubectl describe virtualmachinebackup.virtualmachine.gdc.goog VM_BACKUP_NAME -n PROJECT_NAME
    

    Replace the following:

    • VM_BACKUP_NAME: the name of the backup.
    • PROJECT_NAME: the name of the project.

Delete a VM backup

Delete VM backups by using the GDC console or kubectl.

Console

  1. Sign in to the GDC console.
  2. In the navigation menu, click Backup for Virtual Machines.
  3. Select a project.
  4. Click the Backups tab.
  5. In the list of backups, find the backup to delete and click Delete Backup.
  6. In the Backup name field, enter the name of the backup to delete.
  7. Click Delete Backup.

kubectl

Delete a VM backup using kubectl.

  1. List the existing VM backups:

    kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n PROJECT_NAME
    

    Replace PROJECT_NAME with the name of the project.

  2. In the list, find the backup that you want to delete.

  3. Issue a VirtualMachineDeleteBackupRequest to delete the backup:

    apiVersion: virtualmachine.gdc.goog/v1
    kind: VirtualMachineDeleteBackupRequest
    metadata:
      name: DELETE_BACKUP_REQUEST_NAME
      namespace: PROJECT_NAME
    spec:
      virtualMachineBackupRef:
        name: VM_BACKUP_NAME
    

    Replace the following:

    • DELETE_BACKUP_REQUEST_NAME: the name to give the VirtualMachineDeleteBackupRequest that is being initiated.
    • VM_BACKUP_NAME: the name of the backup to delete.
    • PROJECT_NAME: the name of the project.

Manage VM disk backups

The following section describes the technical steps to list and delete your VM disk backups.

View snapshots

View snapshots and their details using the Google Cloud console or kubectl.

Console

  1. Sign in to the GDC console.
  2. In the navigation menu, click Virtual Machines > Snapshots.
  3. Select a project.
  4. In the list of snapshots, click the snapshot name to view its details.

kubectl

View a snapshot by listing the snapshots and viewing their details.

  1. List the existing snapshots:

    kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n PROJECT_NAME
    

    Replace PROJECT_NAME with the name of the project.

  2. In the list, find the snapshot that you want to view.

  3. View the snapshot details:

    kubectl describe virtualmachinebackup.virtualmachine.gdc.goog VM_BACKUP_NAME -n PROJECT_NAME
    

    Replace the following:

    • VM_BACKUP_NAME: the name of the snapshot.
    • PROJECT_NAME: the name of the project.

Delete a snapshot

Delete snapshots using the Google Cloud console or kubectl. Disks created from snapshots are not affected when you delete the underlying snapshot.

Console

  1. Sign in to the GDC console.
  2. In the navigation menu, click Virtual Machines > Snapshots.
  3. Select a project.
  4. In the list of snapshots, find the snapshot to delete and click Delete.
  5. Click Confirm.

kubectl

Delete a snapshot using kubectl.

  1. List the existing snapshots:

    kubectl get virtualmachinebackups.virtualmachine.gdc.goog -n PROJECT_NAME
    

    Replace PROJECT_NAME with the name of the project.

  2. In the list, find the snapshot that you want to delete.

  3. Issue a VirtualMachineDeleteBackupRequest to delete the snapshot:

    apiVersion: virtualmachine.gdc.goog/v1
    kind: VirtualMachineDeleteBackupRequest
    metadata:
      name: DELETE_BACKUP_REQUEST_NAME
      namespace: PROJECT_NAME
    spec:
      virtualMachineBackupRef:
        name: VM_BACKUP_NAME
    

    Replace the following:

    • DELETE_BACKUP_REQUEST_NAME: the name to give the delete backup request that is being initiated.
    • VM_BACKUP_NAME: the name of the snapshot to delete.
    • PROJECT_NAME: the name of the project.

What's next