Trident - Create backend

by
Jeremy Canfield |
Updated: February 22 2023
| Trident articles
This assumes you have installed the tridentctl command line tool.
The tridentctl create backend command can be used to create a backend. Typically, this command uses a JSON file that contains key value pairs. For example, let's say example.json contains the following to create a backend for a NetApp FSx ONTAP file system running on Amazon Web Services (AWS).
{
"version": 1,
"storageDriverName": "ontap-nas-economy",
"backendName": "my_backend",
"managementLIF": "svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com",
"dataLIF": "svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com",
"svm": "my_svm",
"storagePrefix": "k8s",
"username": "vsadmin",
"password": "itsasecret"
}
Here is how you can create the backend, using the example.json file.
tridentctl create backend --filename example.json
You may want to include the --debug flag so that you can see the request and response data.
tridentctl create backend --filename example.json --debug
Which should return something like this.
Operating mode = tunnel, Trident pod = trident-csi-5fb5bb4886-gxh4s, Namespace = trident, CLI = oc
Invoking tunneled command: oc exec trident-csi-5fb5bb4886-gxh4s -n trident -c trident-main -- tridentctl --debug create backend
Operating mode = direct, Server = 127.0.0.1:8000, Autosuport server = 127.0.0.1:8003
Trident URL: http://127.0.0.1:8000/trident/v1
--------------------------------------------------------------------------------
Request Method: POST
Request URL: http://127.0.0.1:8000/trident/v1/backend
Request headers: map[Content-Type:[application/json]]
Request body: {"backendName":"my_backend","dataLIF":"svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com","managementLIF":"svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com","password":"itsasecret","storageDriverName":"ontap-nas-economy","storagePrefix":"k8s","svm":"my_svm","username":"vsadmin","version":1}
................................................................................
Response status: 201 Created
Response headers: map[Content-Length:[44] Content-Type:[application/json; charset=UTF-8] Date:[Wed, 22 Feb 2023 05:56:52 GMT]]
Response body: {"backend":"my_backend"}
================================================================================
Trident URL: http://127.0.0.1:8000/trident/v1
--------------------------------------------------------------------------------
Request Method: GET
Request URL: http://127.0.0.1:8000/trident/v1/backend/my_backend
Request headers: map[Content-Type:[application/json]]
Request body:
................................................................................
Response status: 200 OK
Response headers: map[Content-Type:[application/json; charset=UTF-8] Date:[Wed, 22 Feb 2023 05:56:52 GMT]]
Response body: {"backend":{"name":"my_backend","backendUUID":"387bbd10-fe4b-4abc-7398-aba25fb123cf","protocol":"file","config":{"version":1,"storageDriverName":"ontap-nas-economy","backendName":"my_backend","debug":false,"debugTraceFlags":null,"disableDelete":false,"storagePrefix":"k8s","serialNumbers":null,"limitVolumeSize":"","credentials":{"name":"REDACTED","type":"REDACTED"},"managementLIF":"svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com","dataLIF":"svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com","igroupName":"","svm":"my_svm","username":"REDACTED","password":"REDACTED","aggregate":"","usageHeartbeat":"","qtreePruneFlexvolsPeriod":"","qtreeQuotaResizePeriod":"","qtreesPerFlexvol":"","lunsPerFlexvol":"","emptyFlexvolDeferredDeletePeriod":"","nfsMountOptions":"","limitAggregateUsage":"","autoExportPolicy":false,"autoExportCIDRs":["0.0.0.0/0","::/0"],"labels":null,"region":"","zone":"","supportedTopologies":null,"defaults":{"spaceAllocation":"true","spaceReserve":"none","snapshotPolicy":"none","snapshotReserve":"","snapshotDir":"false","unixPermissions":"---rwxrwxrwx","exportPolicy":"default","securityStyle":"unix","splitOnClone":"false","fileSystemType":"ext4","encryption":"false","mirroring":"false","tieringPolicy":"","qosPolicy":"","adaptiveQosPolicy":"","size":"1G"},"storage":null,"useCHAP":false,"useREST":false,"chapUsername":"REDACTED","chapInitiatorSecret":"REDACTED","chapTargetUsername":"REDACTED","chapTargetInitiatorSecret":"REDACTED","clientPrivateKey":"REDACTED","clientCertificate":"","trustedCACertificate":"","replicationPolicy":"","replicationSchedule":""},"storage":{"aggr1":{"name":"aggr1","storageClasses":[],"storageAttributes":{"backendType":{"offer":["ontap-nas-economy"]},"clones":{"offer":false},"encryption":{"offer":true},"labels":{"offer":{}},"media":{"offer":["ssd"]},"provisioningType":{"offer":["thick","thin"]},"replication":{"offer":false},"snapshots":{"offer":false}},"supportedTopologies":null}},"state":"online","online":true,"volumes":[],"configRef":""}}
================================================================================
+--------+-------------------+--------------------------------------+--------+---------+
| NAME | STORAGE DRIVER | UUID | STATE | VOLUMES |
+--------+-------------------+--------------------------------------+--------+---------+
| my_svm | ontap-nas-economy | 387aab10-fe4b-4123-b398-aba25f1238cf | online | 0 |
+--------+-------------------+--------------------------------------+--------+---------+
Did you find this article helpful?
If so, consider buying me a coffee over at