NetApp ONTAP NFS configuration
To enable Trident integration with the NetApp ONTAP storage system, you must create a backend that enables communication with the storage system.
-
There are sample backend files available in the downloaded installation archive in the
sample-input
folder hierarchy. For NetApp ONTAP systems serving NFS, copy thebackend-ontap-nas.json
file to your working directory and edit the file.[netapp-user@rhel7 trident-installer]$ cp sample-input/backends-samples/ontap-nas/backend-ontap-nas.json ./ [netapp-user@rhel7 trident-installer]$ vi backend-ontap-nas.json
-
Edit the backendName, managementLIF, dataLIF, svm, username, and password values in this file.
{ "version": 1, "storageDriverName": "ontap-nas", "backendName": "ontap-nas+10.61.181.221", "managementLIF": "172.21.224.201", "dataLIF": "10.61.181.221", "svm": "trident_svm", "username": "cluster-admin", "password": "password" }
It is a best practice to define the custom backendName value as a combination of the storageDriverName and the dataLIF that is serving NFS for easy identification. -
With this backend file in place, run the following command to create your first backend.
[netapp-user@rhel7 trident-installer]$ ./tridentctl -n trident create backend -f backend-ontap-nas.json +-------------------------+----------------+--------------------------------------+--------+---------+ | NAME | STORAGE DRIVER | UUID | STATE | VOLUMES | +-------------------------+----------------+--------------------------------------+--------+---------+ | ontap-nas+10.61.181.221 | ontap-nas | be7a619d-c81d-445c-b80c-5c87a73c5b1e | online | 0 | +-------------------------+----------------+--------------------------------------+--------+---------+
-
With the backend created, you must next create a storage class. Just as with the backend, there is a sample storage class file that can be edited for the environment available in the sample-inputs folder. Copy it to the working directory and make necessary edits to reflect the backend created.
[netapp-user@rhel7 trident-installer]$ cp sample-input/storage-class-samples/storage-class-csi.yaml.templ ./storage-class-basic.yaml [netapp-user@rhel7 trident-installer]$ vi storage-class-basic.yaml
-
The only edit that must be made to this file is to define the
backendType
value to the name of the storage driver from the newly created backend. Also note the name-field value, which must be referenced in a later step.apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: basic-csi provisioner: csi.trident.netapp.io parameters: backendType: "ontap-nas"
There is an optional field called fsType
that is defined in this file. This line can be deleted in NFS backends. -
Run the
oc
command to create the storage class.[netapp-user@rhel7 trident-installer]$ oc create -f storage-class-basic.yaml storageclass.storage.k8s.io/basic-csi created
-
With the storage class created, you must then create the first persistent volume claim (PVC). There is a sample
pvc-basic.yaml
file that can be used to perform this action located in sample-inputs as well.[netapp-user@rhel7 trident-installer]$ cp sample-input/pvc-samples/pvc-basic.yaml ./ [netapp-user@rhel7 trident-installer]$ vi pvc-basic.yaml
-
The only edit that must be made to this file is ensuring that the
storageClassName
field matches the one just created. The PVC definition can be further customized as required by the workload to be provisioned.kind: PersistentVolumeClaim apiVersion: v1 metadata: name: basic spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: basic-csi
-
Create the PVC by issuing the
oc
command. Creation can take some time depending on the size of the backing volume being created, so you can watch the process as it completes.[netapp-user@rhel7 trident-installer]$ oc create -f pvc-basic.yaml persistentvolumeclaim/basic created [netapp-user@rhel7 trident-installer]$ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE basic Bound pvc-b4370d37-0fa4-4c17-bd86-94f96c94b42d 1Gi RWO basic-csi 7s