Welcome to the Red Hat OpenShift Virtualization Roadshow

This roadshow event is organized to allow you to have a hands-on experience with Red Hat® OpenShift® Virtualization. It explores many common management activities that virtualization administrators often encounter in their day to day workflows.

This roadshow event is organized to allow you to have a hands-on experience with Red Hat® OpenShift® Virtualization. It explores many common management activities that virtualization administrators often encounter in their day to day workflows.

Backup and recovery for virtual machines

12 mins

Data Protection is a major topic of conversation when it comes to any enterprise workload, and there are no shortage of options currently available for backup and recovery of virtual machines with Red Hat OpenShift Virtualization. Many of these solutions function in the same manner at which they protect pods in Red Hat Openshift. They do this by taking a backup of the virtual machine, or a namespace containing multiple virtual machines and store it remotely in an object storage bucket. These backups usually also include the persistent storage volume, alongside the metadata and custom resources that define the virtual machine.

Red Hat Solutions Include:

Ecosystem Partner Solutions Include:

Note: This is not intended to be an exhaustive list of partners offering a supported backup and recovery solution. Please check with your storage or data protection vendor(s) to determine the compatibility of their product with OpenShift Virtualization.

In this portion of the lab, we will use OADP to perform a virtual machine backup and restore.

What will you learn?

  • Concepts around backing up VMs to external sites and restoring them in the event of a disaster.

What do you need before starting?

  • Completed the previous resources in this learning path
     

Review the OADP Operator

  1. Navigate in the left menu to OperatorsInstalled Operators and ensure that All projects is selected. Type OADP in the Name search field and you should be presented with the installed version of the OADP Operator. Click on the operator to see it’s details (Figure 1).

    00 Left Menu
    Figure 1

     

  2. Review the Provided APIs available. In this module, the Backup and Restore functions will be used (Figure 2).

    01 Overview
    Figure 2

     

  3. Use the horizontal scrollbar at the top to navigate to the tab DataProtectionApplication. This object represents the configuration of the deployed OADP instance (Figure 3).

    02 DPA
    Figure 3

     

  4. Click on oadp-dpa to see the details of the DataProtectionApplication and then click on the YAML button at the top to see how it is configured (Figure 4).

    03 OADP YAML
    Figure 4


    Notice that OADP has been configured by adding the kubevirt plugin and it has been configured to use the internal object storage bucket provided by *Red Hat OpenShift Data Foundation.

    Important: For the sake of convenience our lab is setup to perform the backups to a local object bucket, however in a production environment you would want to ensure that backups are directed to an external storage system, or a cloud-based object storage bucket.

Create a virtual machine backup

You now will perform a backup of the VM fedora02 which we created in the previous section. The selection of the objects to be backed up is defined by the labels app and vm.kubevirt.io/name. This includes the VM definition, disks, and additional objects being used by the virtual machine such as config maps and secrets.

  1. Using the horizontal scrollbar, scroll back until you see the Backup tab.

  2. Click on the Backup tab and press the Create Backup button (Figure 5).

    04 Backup Tab
    Figure 5

     

  3. Switch to the YAML view and replace the default content with the following one:

    apiVersion: velero.io/v1
    kind: Backup
    metadata:
      name: backup-fedora02
      labels:
        velero.io/storage-location: default
      namespace: openshift-adp
    spec:
      hooks: {}
      orLabelSelectors:
      - matchLabels:
          app: fedora02
      - matchLabels:
          vm.kubevirt.io/name: fedora02
      includedNamespaces:
      - vmexamples
      storageLocation: oadp-dpa-1
      ttl: 720h0m0s
  4. Click the Create button at the bottom (Figure 6).

    Note that the content of this YAML indicates that any object with the labels app: fedora02 in the namespace vmexamples will be backed up to the location specified in the DataProtectionApplication configuration.

    05 Create Backup YAML
    Figure 6


    If you did not complete the previous storage section, and you do not have the fedora02 VM, change the label selectors in the YAML above to match a virtual machine in your inventory.
     

  5. Wait until the Status column changes to Completed. This indicates that the virtual machine has been successfully backed up (Figure 7).

    06 Backup Completed
    Figure 7

Restore from a backup

  1. Navigate to VirtualizationVirtualMachines, click on the three-dot menu to the right of the fedora02 VM and select Delete from the menu that appears (Figure 8).

    07 Delete VM
    Figure 8

     

  2. When prompted, click the red Delete button to confirm deleting the virtual machine (Figure 9).

    08 Confirm Delete
    Figure 9

     

  3. Go back to OperatorsInstalled Operators and select OADP Operator.

  4. Use the horizontal navigation bar to locate the the Restore tab, click the Restore tab, and then press Create Restore (Figure 10).

    09 Restore Tab
    Figure 10

     

  5. Switch to the YAML view and replace the content with the following one:

    apiVersion: velero.io/v1
    kind: Restore
    metadata:
      name: restore-fedora02
      namespace: openshift-adp
    spec:
      backupName: backup-fedora02
      includedResources: []
      excludedResources:
      - nodes
      - events
      - events.events.k8s.io
      - backups.velero.io
      - restores.velero.io
      restorePVs: true
  6. Press the Create button at the bottom (Figure 11).

    10 Create Restore YAML
    Figure 11

     

  7. Wait until you see that the Status column changes to Completed (Figure 12).

    11 Restore Completed
    Figure 12

     

  8. Navigate back to VirtualizationVirtual Machines and confirm that the fedora02 virtual machine was restored. Make sure you are in the vmexamples namespace (Figure 13).

    12 VM Restored
    Figure 13

     

Summary

Protecting virtual machines is a critical aspect of a virtualization platform. OpenShift Virtualization provides multiple methods that enable native protection, for example using OADP, or allowing storage and backup partners to integrate their offerings. If you have questions about how to protect virtual machines, please don’t hesitate to ask the proctors for the workshop or reach out to your vendor to determine their compatibility with OpenShift Virtualization.

Previous resource
Storage management
Next resource
Network management

This learning path is for operations teams or system administrators

Developers may want to check out Foundations of OpenShift on developers.redhat.com. 

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.