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.
Last updated
A guide for performing the backup and restore of the Virtual Machine (VM) running on the OpenShift environment.
Last updated
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:
Red Hat Openshift Container Platform version 4.11
Red Hat OpenShift Virtualization version 4.11
Log in to the OpenShift Management Console and go to OperatorHub.
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.
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:
Login to OpenShift Management Console and go to the OperatorHub
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.
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.
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.
By default, Trilio runs custom hooks on each VM selected for backup to initiate freeze/quiesce and unfreeze/unquiesce operations, provided a QemuGuestAgent
is connected. These operations are critical for maintaining data integrity and preventing data corruption during the backup process. This default behavior is recommended to ensure consistent, reliable backups.
However, users have the option to disable these custom hooks if they do not wish to quiesce/unquiesce the VM filesystem during backups. To disable custom hook execution for a specific VM, add the following annotation to the VM resource:
Note: Disabling custom hook execution is generally not recommended, as it may affect data consistency in the Virtual Machine backup.