Tech ONTAP Blogs

Enhanced Virtual Machine Protection in NetApp Backup and Recovery for Kubernetes

PatricU
NetApp
37 Views

 

In today's fast-paced digital landscape, data protection is paramount for enterprises leveraging Kubernetes to manage their containerized applications and virtual machines. NetApp Backup and Recovery for Kubernetes stands out as a robust solution, offering enterprise-grade data protection for both containerized applications and virtual machines on Kubernetes platforms, including Red Hat OpenShift and OpenShift Virtualization.

 

As organizations increasingly adopt Kubernetes for its scalability and flexibility, the need to safeguard data across diverse environments becomes critical. NetApp's solution not only ensures the security and integrity of containerized applications but also extends comprehensive protection to virtual machines, which are integral to many enterprise workflows.

 

This blog post aims to guide you through the process of integrating OpenShift Virtualization-based virtual machines as dedicated applications within NetApp Backup and Recovery for Kubernetes. We will explore the prerequisites, step-by-step procedures, and best practices to ensure your virtual machines are securely backed up and easily recoverable.

 

Whether you are a seasoned Kubernetes administrator or new to the platform, understanding how to effectively protect your virtual machines can significantly enhance your data management strategy. By the end of this guide, you will be equipped with the knowledge to dynamically and statically create VM-based applications, assign protection policies, and restore individual virtual machines with ease.

 

Join us as we delve into the intricacies of NetApp Backup and Recovery for Kubernetes, ensuring your virtual machines are not just running smoothly but are also safeguarded against data loss and downtime. Let's get started on fortifying your Kubernetes environment with NetApp's cutting-edge backup and recovery capabilities.

Scenario and prerequisites

In this blog post, we’ll show you how to add and protect OpenShift Virtualization based virtual machines as dedicated virtual machine applications to NetApp Backup and Recovery for Kubernetes. The OpenShift cluster pu-ocp1 that hosts the virtual machines is already connected to the NetApp Console and NetApp Trident is already installed and configured, and the local Trident Protect version was already upgraded to its latest version directly from the Console (supported from Trident Protect 26.05 onwards):

Screenshot 2026-05-15 at 12.39.49.pngScreenshot 2026-05-15 at 12.40.21.pngScreenshot 2026-05-15 at 12.41.04.png

Alternatively, we can do an upgrade on the command line:

$ helm upgrade trident-protect https://netapp.github.io/trident-protect-helm-chart/charts/trident-protect-console-100.2605.1-console.tgz --namespace trident-protect --wait --timeout=5m --atomic
Flag --atomic has been deprecated, use --rollback-on-failure instead
Release "trident-protect" has been upgraded. Happy Helming!
NAME: trident-protect
LAST DEPLOYED: Fri May 15 12:47:12 2026
NAMESPACE: trident-protect
STATUS: deployed
REVISION: 2
DESCRIPTION: Upgrade complete
TEST SUITE: None
$ helm list -A
NAME           	NAMESPACE      	REVISION	UPDATED                              	STATUS  	CHART                                     	APP VERSION
trident-protect	trident-protect	2       	2026-05-15 12:47:12.326168 +0200 CEST	deployed	trident-protect-console-100.2605.1-console	26.05.1-console

We have already deployed three virtual machines in two different namespaces on the pu-ocp1 cluster:

$ kubectl get vm -A
NAMESPACE   NAME       AGE     STATUS    READY
app-ns      app-vm-1   122m    Running   True
app-ns      app-vm2    44m     Running   True
pu-vm1      pu-vm1     7m22s   Running   True

Add virtual machine-based applications

The virtual machines on the OpenShift cluster are already listed in the Virtual machines tab of Backup and Recovery’s Inventory, together with the namespaces they’re configured in, the cluster, and their status.

Screenshot 2026-05-15 at 15.26.54.png

The VMs are not yet assigned to an application and hence are still in the Unprotected state, not being protected by a protection policy yet.

We can define VM-based application in Backup and Recovery in two ways – using label selectors for a dynamic application definition, and the static way by selecting the discovered virtual machines directly.

We’ll demonstrate both ways using the Console UI in the next two sections.

 

Statically create and protect VM applications

The procedure to create a VM-based application is basically the same as to create a namespace-based application in Backup and Recovery. When you create an application, you make Backup and Recovery aware of the running application/VM on the Kubernetes cluster.

To create a VM-based app in Backup and Recovery, select Inventory. In the Applications tab, select Create application.

Screenshot 2026-05-15 at 15.29.46.png

Enter a name for the VM-based application, choose a Kubernetes cluster from the list, and under Filters, choose Virtual machine.

Screenshot 2026-05-15 at 15.30.52.png

Find the virtual machines you want to add to the VM-based application by choosing one or more namespaces. Select the VMs you want to protect from the list of virtual machines and check if the list of VMs on the right is correct.

In our example, we choose the VM app-vm-1 in the namespace app-ns and the VM pu-vm1 in the namespace pu-vm1 to create the VM-based application pu-vm-app1.

Screenshot 2026-05-15 at 15.31.56.png

We’ll assign a protection policy later, so just select Create in the next screen.

Screenshot 2026-05-15 at 15.32.37.png

Our newly created application is now listed in the list of applications in the Inventory. To protect it, select Protect in the associated Actions menu.

Screenshot 2026-05-15 at 15.46.52.png

Now we assign one of the already existing protection policies or create a new one and click Done.

Spoiler
Note that we use a snapshot-only protection policy our example, but of course all of Backup and Recovery’s protection policies could be used.

Screenshot 2026-05-15 at 15.47.13.png

This will immediately start the first protection run for both VMs.

After the protection run completes, our two protected VMs will be listed with their application membership and protection status in the Virtual machines tab of the Inventory.

Screenshot 2026-05-15 at 16.00.56.png

Create and protect dynamic VM applications

By using label selector when adding VM-based applications, the virtual machine application definition will become dynamic. Any virtual machine that later matches the label selector is included automatically and protected. In this section you’ll learn how to do this.

For a start, we label the VM app-vm-1 in the app-ns namespace with protected=true.

$ kubectl get vms -A --show-labels
NAMESPACE   NAME       AGE    STATUS    READY   LABELS
app-ns      app-vm-1   7d2h   Running   True    protect=true
app-ns      app-vm2    7d1h   Running   True    <none>
pu-vm1      pu-vm1     7d     Running   True    <none>

We start the application creation the Backup and Recovery Inventory in the usual way. From the list of namespaces with VMs on the cluster, we select All namespaces:

Screenshot 2026-05-20 at 18.05.49.png

Spoiler
Note that the “Select All Namespaces” option only considers existing namespaces containing virtual machines at the time of the app creation. Any labeled VMs in non-VM namespaces or in namespaces created after the application creation will not be dynamically added to the application definition!

After adding the protect=true label selector, we see that the VM app-vm-1 was auto-selected by label:

Screenshot 2026-05-20 at 18.06.11.png

In the next steps, we assign a protection policy to the VM application and create it. In our example we use a snapshot-only protection policy, but of course all of Backup and Recovery’s protection policies could be used.

Screenshot 2026-05-20 at 18.06.39.pngScreenshot 2026-05-20 at 18.06.44.png

Once the initial protection run finishes, the VM app-vm-1 is shown as Protected and part of the application pu-vms in the Virtual machines tab of the Inventory:

Screenshot 2026-05-20 at 18.10.12.png

To test the dynamic application definition, let’s now label the VM pu-vm1 in the pu-vm1 namespace.

$ kubectl -n pu-vm1 label vm pu-vm1 protect=true
virtualmachine.kubevirt.io/pu-vm1 labeled
$ kubectl get vm -A --show-labels
NAMESPACE   NAME       AGE    STATUS    READY   LABELS
app-ns      app-vm-1   7d2h   Running   True    protect=true
app-ns      app-vm2    7d1h   Running   True    <none>
pu-vm1      pu-vm1     7d     Running   True    protect=true

Checking the definition of the VM app pu-vms by selecting Edit in the Actions menu of the VM app in the Applications tab, we confirm that the newly labeled VM pu-vm1 is now part of the VM application.

Screenshot 2026-05-20 at 18.28.12.png

For the changes to be reflected in the Virtual machines tab of the Inventory, we need to wait for the next scheduled protection run to finish. Then we see the VM pu-vm1 listed as protected and member of the pu-vms application.

Screenshot 2026-05-20 at 19.05.26.png

Unprotect a virtual machine by removing the label

When working with dynamically create VM applications, we can also dynamically stop VMs from being protected by removing the label. For a quick test, let’s remove the protect=true label from the VM pu-vm1:

$ kubectl -n pu-vm1 label vm pu-vm1 protect-
virtualmachine.kubevirt.io/pu-vm1 unlabeled
$ kubectl get vm -A --show-labels
NAMESPACE   NAME       AGE     STATUS    READY   LABELS
app-ns      app-vm-1   7d23h   Running   True    protect=true
app-ns      app-vm2    7d22h   Running   True    <none>
pu-vm1      pu-vm1     7d22h   Running   True    <none>

The application definition was immediately refreshed in Backup and Recovery:

Screenshot 2026-05-21 at 15.44.56.png

Spoiler

Note that the Inventory tab will still show the VM with the removed label as protected and member of the VM application until the last recovery point containing backups of the VM is expired.

Single VM restore

A great advantage of Backup and Recovery having dedicated VM application is the ability to easily restore a single or only selected virtual machines from an application containing multiple VMs.

We start with two VMs being protected as part of the VM application vm-app-ns:

Screenshot 2026-05-19 at 14.55.02.png

 Now we want to only restore the VM app-vm2 from the app-ns namespace. To restore only this VM, start the restore operation as usual from the Applications tab in the Inventory and select View and restore from the vm-app-ns application’s Actions menu. From the list of available restore points, select the one you to start the restore from.

Screenshot 2026-05-19 at 14.56.20.png

Select the cluster to restore to, the destination namespace, and the name of the destination application:

Screenshot 2026-05-19 at 14.57.52.png

In the next screen, after selecting Selective restores, choose the VM to restore from the list of available VMs in the restore point:

Screenshot 2026-05-19 at 14.59.01.png

Then select the destination storage settings and other restore details if needed and click Restore.

Screenshot 2026-05-19 at 14.59.21.png

This will start the single-VM restore of the VM app-vm2.

Conclusion and call to action

As Kubernetes continues to redefine how enterprises manage containerized applications and virtual machines, ensuring robust data protection becomes a cornerstone of operational success. NetApp Backup and Recovery for Kubernetes empowers organizations to seamlessly integrate OpenShift Virtualization-based virtual machines as dedicated applications, offering unparalleled flexibility and reliability in safeguarding critical workloads.

 

Through this guide, you’ve learned how to dynamically and statically define VM-based applications, assign protection policies, and even restore individual virtual machines with ease. These capabilities not only enhance your data protection strategy but also ensure minimal downtime and maximum operational efficiency.

 

We invite you to explore NetApp Backup and Recovery for Kubernetes and take your data protection strategy to the next level. Whether you’re managing containerized applications or virtual machines, NetApp’s solution is here to ensure your workloads are always secure and recoverable.

 

Ready to fortify your Kubernetes environment? Dive into NetApp’s Backup and Recovery solution today and prepare for the next release to unlock CLI capabilities! Login to NetApp Console, navigate to Protection --> Backup and Recovery and sign up for a free trial, discover your K8s clusters and bring their protection to the next !

Public