Backup and Restore Virtual Machines running on OpenShift

A guide for performing the backup and restore of the Virtual Machine (VM) running on the OpenShift environment.

Red Hat OpenShift Container Platform (OCP) is the market-leading Kubernetes platform. OpenShift efficiently manages your Kubernetes-based applications deployed on it. With the help of the OpenShift Virtualization operator, users can also run their VMs into a pod and these pods are also managed by OpenShift similar to other pods running Kubernetes-based applications.

Minimum Supported versions to run a VM and perform backup and restore of VM:

  1. Red Hat Openshift Container Platform version 4.11

  2. Red Hat OpenShift Virtualization version 4.11

Install OpenShift Virtualization Operator

  1. Log in to the OpenShift Management Console and go to OperatorHub.

  2. Search the Operator “OpenShift Virtualization”\

3. Click on “Install” and proceed with the installation.\

4. Select the appropriate options and proceed with the installation\

5. Once the installation is complete, the user needs to create HyperConverged using the Local Storage Class Name. HyperConverged creates and maintains the OpenShift Virtualization Deployments.

6. Once the installation is complete, you can check a new option “Virtualization” visible under the Workload section.

Note: You can learn more about OpenShift Virtualization in this video.

Follow the below steps to install and configure the underlying storage required to run virtual machines.

Install and Configure the OpenShift Data Foundation Operator for underlying Storage for VM Deployment

Once the OpenShift Virtualization Operator is installed, it also needs underlying storage for the VM deployments. You will install OpenShift Data Foundation (ODF) (Formerly known as OpenShift Container Storage (OCS)) Operator which will configure the underlying storage for the VMs to use.

Follow the steps below to install and configure the ODF Operator:

  1. Login to OpenShift Management Console and go to the OperatorHub

  2. Search the Operator “OpenShift Data Foundation” operator

3. Select the Operator and provide appropriate input values. Click on Install.

4. After the installation is complete, you have to create a Storage System which would in turn create a Storage Cluster. You have to provide an existing Storage class to provision the new storage for Storage Cluster creation to proceed.

5. Once the Storage System creation is complete, in the background, it will install different storage components such as BackingStore, BucketClass, CephBlockPool, etc.

6. Once all the components are in the Ready state, you can check that the storage class is also created in the backend.

7. Now, you are ready to deploy a virtual machine on OpenShift.

Deploy a Virtual Machine on OpenShift

Since you have installed the OpenShift Virtualization Operator and you might already be aware of how to deploy a VM or you have already deployed a VM.

If not, it's very easy and similar to the Virtual Machine deployment on any other virtualization technology. You can follow this video from the OpenShift team to deploy a VM.

Backup a Virtual Machine Using T4K

After setting up all the prerequisites to deploy Trilio for Kubernetes, you might have already launched T4K Management Console. Follow the UI authentication section to login into the console using OpenShift credentials.

Now, we can proceed to perform a VM backup. Trilio for Kubernetes treats Virtual Machine as any other objects and application running on the OpenShift Container Platform.

Follow these instructions to perform VM backup and restore.

Understanding Virtual Machine Backup Size Discrepancies

Virtual Machine Backups Occupying More Space Than Actual Disk Usage:

This issue occurs in the following scenario:

  • A user creates a Virtual Machine with a disk that has 10GB of used data.

  • The initial backup will be approximately 10GB.

  • The user then deletes 10GB of data.

  • The backup still shows to be around 10GB in size.

Reason:

Deleting files in the Virtual Machine does not mean the file system zeros out all data blocks. Instead, the file system simply adds the data blocks to the free list, leaving the content unchanged. When Trilio performs a backup, it backs up the entire disk image of the Virtual Machine, ignoring only the zero blocks and including every block that contains data. Consequently, even after deleting files, the blocks still hold the data. Thus, Trilio backs up these blocks, even though they are marked as deleted from the file system perspective.

Last updated