Tech ONTAP Blogs
Tech ONTAP Blogs
In complex enterprise environments, testing and migration scenarios from virtualized workload on physical hardware are often time-critical and resource-intensive. With Red Hat OpenShift Virtualization, NetApp Trident, and FlexClone technology, virtual machines running in Red Hat OpenShift can be seamlessly migrated to physical servers in seconds - ideal for performance testing, error analysis, or hardware benchmarks. To enable this flexibility, the VMs must have its root and hence its boot LUN on NetApp ONTAP and be connected via the iSCSI protocol.
This blog captures the following details:
Red Hat® OpenShift® provides a unified hybrid cloud foundation for developing and scaling containerized applications. Trusted by thousands of organizations across industries, it powers business-critical workloads—whether modernizing existing applications for the cloud or creating new customer experiences. Backed by Red Hat, a leading contributor to Kubernetes, it combines innovation with proven reliability.
Red Hat® OpenShift® Virtualization, included with Red Hat OpenShift, offers a modern platform for running and deploying both new and existing virtual machine (VM) workloads. It enables organizations to easily migrate and manage traditional VMs on a reliable, consistent, and fully integrated hybrid cloud application platform. By streamlining VM migration, OpenShift Virtualization supports infrastructure modernization while leveraging the speed and simplicity of a cloud-native environment. It protects existing virtualization investments, embraces modern management practices, and serves as the cornerstone of Red Hat’s complete virtualization offering.
NetApp is a global leader in innovative data management and storage solutions. NetApp is committed to helping companies maximize the value of their data – whether in the cloud, on-premises, or in hybrid environments.
With the NetApp ONTAP storage operating system, modern all-flash and hybrid storage systems, and integrated cloud data services, NetApp enables efficient, secure, and scalable data management. NetApp solutions deliver performance, reliability, and seamless integration into multi-cloud strategies.
NetApp helps customers worldwide accelerate their digital transformation – data-driven, innovative, and future-proof.
Trident is an open-source storage orchestrator from NetApp, specifically designed for container platforms such as Kubernetes and OpenShift. Trident integrates seamlessly with OpenShift and enables the automated provisioning and management of persistent storage, whether for containers, databases, or VMs. Trident is a CSI driver which comes at no extra cost and it is fully supported and maintained by NetApp.
All NetApp storage platforms are supported – including ONTAP (AFF, FAS, Select, Cloud Volumes ONTAP), Element OS, StorageGRID, and more. Trident supports both block (iSCSI, FC) and file (NFS, SMB) protocols, meeting the needs of DevOps teams as well as VM administrators who want to run traditional enterprise workloads such as databases and ERP systems on OCP VMs.
To understand and successfully implement the content described in this document, it is assumed that the reader has a solid understanding of the following technologies:
This document expects an understanding of these technologies and therefore does not provide an introductory explanation of them.
In order to follow the corresponding steps, you need:
Databases can be run in VMs in a variety of ways, especially with regard to the storage backend. Two common options are:
For application workload NetApp recommends to run them using “in-guest” NFS mounts. When using "in-guest" NFS mounts, the application and/or database runs in the VM, and one or more NFS volumes (from the NetApp storage system ) are mounted directly within the virtualized guest operating system. The following picture shows a high level architecture for an OpenShift VM, having an iSCSI root LUN for its operating system and two “in-guest” NFS mounts (/data and /log) for application file systems.
NFS "in guest mounts" with NetApp
Let’s look at the “in-guest” NFS mounts from an operating system level. According to NetApps best practice, “in-guest” NFS mounts are mounted over a dedicated storage LAN configured with end-to-end jumbo frames for the ethernet protocol. To check if jumbo frames are configured properly end-to-end, you can use the following command "ping -M do <IP address of NetApp system over which the NFS volumes are exported> -s 8960”
The screenshot shows the configuration of the storage LAN's network interface (eth2), as well as the two “in-guest” NFS mounts, /data and /log.
NFS "in guest mounts"
For different applications and databases running as “in-guest” NFS mounts, NetApp offers best practices documents which cover all aspects of configuring the NetApp storage system, parameterization of the operating system and the respective database to ensure the best possible performance for the application, i.e.:
From NetApp experience "in-guest" NFS mounts offer a lot of advantages compared to traditional file systems for applications which reside on block storage:
When moving applications from virtual machines to physical server (i.e. for performance and/or error analysis) it is very important to use identical kernel parameterization. This ensures that the application runs equally in both environments:
The most reliable way to ensure consistent configuration between an operating system running in a virtual machine and one running on a physical server (for performance tests and error analysis) is to boot the physical server using the same root disk as the virtual machine.
With the combination of Red Hat OpenShift Virtualization, NetApp Trident, NetApp Snapshot and FlexClone technology - which enables the creation of Fiber Channel boot LUNs for physical servers from iSCSI boot LUNs used for virtual machines - a complex migration or troubleshooting scenario becomes a fast, secure, and repeatable process. This saves time, simplifies processes, and increases flexibility in dynamic IT landscapes.
Since, according to these best practices, all application data is stored on NetApp volumes mounted via NFS into the guest operating systems, it is only necessary for operators to create the iSCSI root LUN for VMs via the Container Storage Interface (CSI) using NetApp Trident (which is be described in detail in the subsequent chapters). The volumes for application data - whose configuration is static - are therefore created "traditionally" using the NetApp UI (System Manager), command line interface or automation tools such as Ansible.
This chapter gives an NetApp Trident overview and describes the basic installation and configuration steps, so that NetApp Trident can be used as storage provisioner in Red Hat OpenShift.
There are a number of settings required in order to configure an Red Hat OpenShift cluster for SAP workloads. There is an Ansible role named sap_hypervisor_node_preconfigure which automates the configuration steps. The major things done are:
The role sap_vm_provision should be used to create virtual machines incorporating the settings and tunings prepared by the above sap_hypervisor_node_preconfigure role.
There is a Knowledgebase article describing the usage of those roles in more in-depth detail.
Trident allows the deployment of both file-based and block-based Persistent Volume Claims (PVCs). In this blog, we will only consider the deployment of block-based PVCs as iSCSI LUNs, since only iSCSI LUNs can be mapped to physical servers as FC LUNs and thus booted from them.
Triden can be easily installed in OpenShift as an Operator-based installation which has the following advantages:
The following picture shows high level the process of configuring Trident and the workflow when provisioning storage
Trident high level architecture
The complete documentation for installing and configuring NetApp Trident can be found here:
https://docs.netapp.com/us-en/trident/
In this chapter we therefore only give a brief overview of the necessary installation steps for NetApp Trident in RedHat OCP
After the installation, some additional steps must be performed to enable the automatic provisioning of PVCs in OpenShift:
A complete YAML file which creates a secret, configures an ONTAP backend and creates a default iSCSI storage class is attached in the chapter “Example Configuration Files”
For simplicity, we created a virtual machine from an available CentOS Stream 9 OpenShift virtualization image. The configuration details are shown in the next screenshot.
We added two additional NICs:
After starting the VM, we assigned fixed IP addresses for nic-172 (172.30.20.34) and nic-192 (192.168.20.34) using “nmtui” (Network Manager Text User Interface). An example is shown for nic-192 which has the device name eth2 inside the VM
As a final step we mounted two NFS volumes into the VM. The resulting filesystem structure has already been shown in the section NetApp Reference Architecture for running Applications and Databases inside VMs
The workflow consists of the following steps, which are described in detail in the next chapter:
For creating a FlexClone, we have to identify the PVC name and the corresponding Trident LUN and its Volume (in this case pvc-f60162e2-a98f-4e74-9deb-097ca56127bd).
To identify the PVC, open the corresponding VM in OCP. In our case the VM is named “centos-stream9-test-3”
Virtual machine details Then select “Configuration” and view the “Storage” details
Storage details The root disk is called “dv-centos-stream9-test-3-rootdisk-5r39h6”. Open the PVC details
Identify PVC of root disk
In our case the PVC name is “pvc-f60162e2-a98f-4e74-9deb-097ca56127bd”
Shutdown the VM by pressing the “Stop” icon
Virtual machine power optionsImportant to know: From an NetApp ONTAP point of view, a LUN (independant if it is a iSCSI or FC LUN) is a file which resides inside a volume. This file is then presented as a block device either via iSCSI or FC protocol.
All NetApp Snapshot, SnapRestore and FlexClone operations are always done on Volume level. In NetApp System Manager we therefore have to identify the correct volume which stores the iSCSI LUN.
According to the YAML Trident Secret, Backend und (Default) Storage Class Configuration, the volume name has the prefix “trident_” so the correct volume name is “trident_pvc_f60162e2_a98f_4e74_9deb_097ca56127bd”, because “-” from PVC names are translated into “_” in ONTAP volume names. System Manager shows that a LUN with name “lun0” is stored on the volume “trident_pvc_f60162e2_a98f_4e74_9deb_097ca56127bd”.
iSCSI LUNs in NetApp System Manager
Select the volume from the “Volumes” menu and choose “Clone” from the Kebab menu.
Clone Submenu If no Snapshot exists from the volume, or if you want to create a more up to date Snapshot choose “Add a snapshot”. If already a Snapshot exists, choose an existing Snapshot, provide a name for the clone volume and press "Clone"
Clone details
In our environment we need to rehost the newly cloned volume, because
To achieve this, you must do the following steps:
Network setup
Mount application filesystems
The here presented method shows how to boot a VM running on Red Hat OpenShift Virtualization as a bare metal system. This can be useful to debug and investigate potential issues found on that system. It especially helps clarify the question, whether the issue is related to Red Hat OpenShift Virtualization or not.
---
apiVersion: v1
kind: Secret
metadata:
name: <secret name>
namespace: <trident namespace>
type: Opaque
stringData:
username: <username>
password: <password>
---
apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
name: <backend name>
namespace: <trident namespace>
spec:
version: 1
storageDriverName: ontap-san
managementLIF: <SVM management LIF IP>
svm: "<SVM name>"
backendName: <backend name>
igroupName: <igroup name>
credentials:
name: <secret name>
storagePrefix: trident_
defaults:
snapshotPolicy: default-1weekly
snapshotReserve: '20'
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: trident-iscsi
annotations:
storageclass.kubernetes.io/is-default-class: "true"
storageclass.kubevirt.io/is-default-virt-class: 'true'
provisioner: csi.trident.netapp.io
parameters:
backendType: ontap-san
csi.storage.k8s.io/fstype:: "ext4"
volumeBindingMode: Immediate
allowVolumeExpansion: true
reclaimPolicy: Delete
Holger Zecha (NetApp)
Nils Bauer (NetApp)
Prena Mohta (Red Hat) Doc Writer
Nils Koenig(Red Hat)