Skip to main content
NetApp Solutions

Deploy Red Hat OpenShift Virtualization with FSxN on ROSA

Contributors banum-netapp

Overview

This section provides details for setting up FSx for NetApp ONTAP as the default Storage Class for the ROSA cluster, and then create a Virtual Machine that will leverage FSx ONTAP storage for its volumes.
We will also look into connecting to the Virtual Machine using the guest credentials, and restarting the VM. And finally, we will perform a live migration of the Virtual Machine from the current node to a new node. We will examine the contents of the disk storage after a VM restart and the live migration .

Initial Setup

This section shows how to set up the default storage class to be trident-csi and the default VolumeSnapshotClass to be the FSx Volume Snapshot class. Then it shows how to create a VM from a template and then connect and login to it using the guest credentials.

Ensure default Storage Class is set to trident-csi
OCP-v default storage Class

Ensure default VolumeSnapShotClasses is set as shown
OCP-v default VolumeSnapshot Class

If the defaults are not set, you can set it up either from the console or from command line

$ oc patch storageclass trident-csi -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
$ oc patch VolumeSnapshotClasses fsx-snapclass -p '{"metadata": {"annotations": {"snapshot.storage.kubernetes.io/is-default-class": "true"}}}'

Create a VM from the template

Use the web console to create a VM from a template.
From the RedHat OpenShiftService on AWS console, create a virtual machine. There are templates available on the cluster that can be used to create the VM.
In the screenshot below, we choose fedora VM from this list. Give the VM a name,and then click on Customize Virtual Machine. Select the Disks tab and click on Add disks.
Change the name of the disk preferably to something meaningful, ensure that trident-csi is selected for storage class. Click on Save. Click on Create VirtualMachine

After a few minutes, the VM is in the running state
OCP-v Create VM from template

OCP-v template sources available

OCP-v Customize VM

OCP-v Disks tab

OCP-v Add disk

OCP-v VM running

Review all the objects created for the VM

The storage disks.
OCP-v Storage Disks

The file systems of the VM will show the Partitions, File system type and the Mount points.
OCP-v FileSystems

2 PVCs are created for the VM, one from the boot disk and one for the hot plug disk.
OCP-v VM PVCs

The PVC for the boot disk shows that the Access mode is ReadWriteMany, and the Storage Class is trident-csi.
OCP-v VM boot disk PVC

Similarly, the PVC for the hot-plug disk shows that the Access mode is ReadWriteMany, and the Storage Class is trident-csi.
OCP-v VM hotplug disk PVC

In the screenshot below we can see that the pod for the VM has a Status of Running.
OCP-v VM running

Here we can see the two Volumes associated with the VM pod and the 2 PVCs associated with them.
OCP-v VM PVCs and PVs

Connect to the VM

Click on ‘Open web console’ button, and login using Guest Credentials
OCP-v VM connect

OCP-v login

Issue the following commands

$ df (to display information about the disk space usage on a file system).
$ dd if=/dev/urandom of=random.dat bs=1M count=10240 (to create a file called random.dat in the home dir and fill it with random data).

The disk is filled with 11 GB of data.
OCP-v VM fill the disk

Use vi to create a sample text file that we will use to test.
OCP-v create a file