Deploy Red Hat OpenShift Virtualization with FSxN on ROSA
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 .
Prerequisites
-
IAM user with appropriate permissions to create and access ROSA cluster
-
A HCP ROSA cluster (with at least 3 bare-metal worker nodes)
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
Ensure default VolumeSnapShotClasses is set as shown
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
Review all the objects created for the VM
The storage disks.
The file systems of the VM will show the Partitions, File system type and the Mount points.
2 PVCs are created for the VM, one from the boot disk and one for the hot plug disk.
The PVC for the boot disk shows that the Access mode is ReadWriteMany, and the Storage Class is trident-csi.
Similarly, the PVC for the hot-plug disk shows that the Access mode is ReadWriteMany, and the Storage Class is trident-csi.
In the screenshot below we can see that the pod for the VM has a Status of Running.
Here we can see the two Volumes associated with the VM pod and the 2 PVCs associated with them.
Connect to the VM
Click on ‘Open web console’ button, and login using Guest Credentials
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.
Use vi to create a sample text file that we will use to test.