Skip to main content
NetApp Solutions

NetApp ONTAP iSCSI configuration

Contributors kevin-hoke banum-netapp ac-ntap

To enable Trident integration with the NetApp ONTAP storage system, you must create a backend that enables communication with the storage system.

  1. There are sample backend files available in the downloaded installation archive in the sample-input folder hierarchy. For NetApp ONTAP systems serving iSCSI, copy the backend-ontap-san.json file to your working directory and edit the file.

    [netapp-user@rhel7 trident-installer]$ cp sample-input/backends-samples/ontap-san/backend-ontap-san.json ./
    [netapp-user@rhel7 trident-installer]$ vi backend-ontap-san.json
  2. Edit the managementLIF, dataLIF, svm, username, and password values in this file.

      "version": 1,
      "storageDriverName": "ontap-san",
      "managementLIF": "",
      "dataLIF": "",
      "svm": "trident_svm",
      "username": "admin",
      "password": "password"
  3. 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-san.json
    |          NAME          | STORAGE DRIVER |                 UUID                 | STATE  | VOLUMES |
    | ontapsan_10.61.181.241 | ontap-san      | 6788533c-7fea-4a35-b797-fb9bb3322b91 | online |       0 |
  4. 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
  5. 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.

    kind: StorageClass
      name: basic-csi
      backendType: "ontap-san"
    Note There is an optional field called fsType that is defined in this file. In iSCSI backends, this value can be set to a specific Linux filesystem type (XFS, ext4, etc) or can be deleted to allow OpenShift to decide what filesystem to use.
  6. Run the oc command to create the storage class.

    [netapp-user@rhel7 trident-installer]$ oc create -f storage-class-basic.yaml created
  7. 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
  8. 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
      name: basic
        - ReadWriteOnce
          storage: 1Gi
      storageClassName: basic-csi
  9. 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-7ceac1ba-0189-43c7-8f98-094719f7956c   1Gi        RWO            basic-csi      3s