Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In the context of NAS-ECO, here is what you can configure in Trident 24.10:
- LimitVolumeSize: limits the max size of a PVC (ie qtree)
- LimitVolumePoolSize: limits the max size of the FlexVol hosting the qtrees
- DenyNewVolumePools: avoids the creation of a new FlexVol when the current one is full
- QtreesPerFlexvol: defines the max number of Qtrees you want to have per FlexVol (default: 200, min: 50, max: 300)
- In ONTAP, you can:
- Limit the max number of FlexVol per SVM
- Limit the logical capacity assigned to a SVM (9.13+, no MCC)
- You can also pre-provision FlexVol that Trident will pick up (or create a dummy PVC, which triggers the creation of a FlexVol, delete the PVC, & patch the TBC with denyNewVolumePools)
- The difficult part is to find the correct configuration of the FlexVol when doing it manually
- Example or pre-provisioned FlexVol:
- My Trident Backend:
- cat << EOF | kubectl apply -f -
- apiVersion: trident.netapp.io/v1
- kind: TridentBackendConfig
- metadata:
- name: backend-nas-eco2
- namespace: trident
- spec:
- version: 1
- backendName: nas-eco2
- storageDriverName: ontap-nas-economy
- managementLIF: 192.168.0.133
- storagePrefix: eco2_
- autoExportCIDRs:
- - 192.168.0.0/24
- autoExportPolicy: true
- denyNewVolumePools: "true"
- limitVolumeSize: 15Gi
- limitVolumePoolSize: 20Gi
- qtreesPerFlexvol: '50'
- defaults:
- nameTemplate: "{{ .config.StoragePrefix }}_{{ .volume.Namespace }}_{{ .volume.RequestName }}"
- credentials:
- name: secret-nas-svm-creds
- EOF
- The API Calls to create the corresponding volume:
- curl -X POST -ku admin:Netapp1! -H "accept: application/json" -H "Content-Type: application/json" -d '{
- "name": "eco2_empty",
- "svm": {"name": "nassvm"}
- }' https://cluster1.demo.netapp.com/api/protocols/nfs/export-policies
- curl -X POST -ku admin:Netapp1! -H "accept: application/json" -H "Content-Type: application/json" -d '{
- "aggregates": [{"name": "aggr1"}],
- "comment": "",
- "guarantee":{"type":"none"},
- "name": "trident_qtree_pool_eco2_demo",
- "nas":{
- "export_policy":{"name":"eco2_empty"},
- "security_style":"unix",
- "unix_permissions":711
- },
- "size": "1073741824",
- "snapshot_policy":{"name":"none"},
- "space":{"snapshot":{"reserve_percent":0}},
- "state":"online",
- "style": "flexvol",
- "svm": {"name":"nassvm"},
- "tiering":{"policy":"none"}
- }' https://cluster1.demo.netapp.com/api/storage/volumes
- GETVOL=$(curl -X GET -ku admin:Netapp1! https://cluster1.demo.netapp.com/api/storage/volumes?fields=nas.path&name=trident_qtree_pool_eco2_demo&state=online&style=flexvol&svm.name=nassvm -H "accept: application/json")
- VOLID=$(echo $GETVOL | jq -r .records[0].uuid)
- curl -X POST -ku admin:Netapp1! -H "accept: application/json" -H "Content-Type: application/json" -d '{
- "qtree":{"name":""},
- "space":{"hard_limit":-1},
- "svm":{"name":"nassvm"},
- "type":"tree",
- "volume":{"name":"trident_qtree_pool_eco2_demo"}
- }' https://cluster1.demo.netapp.com/api/storage/quota/rules
- curl -X PATCH -ku admin:Netapp1! -H "accept: application/json" -H "Content-Type: application/json" -d '{
- "quota":{"enabled": "true"}
- }' https://cluster1.demo.netapp.com/api/storage/volumes/$VOLID
- curl -X PATCH -ku admin:Netapp1! -H "accept: application/json" -H "Content-Type: application/json" -d '{
- "snapshot_directory_access_enabled": "false"
- }' https://cluster1.demo.netapp.com/api/storage/volumes/$VOLID
- In order to retrieve the list of API calls for a specific TBC, you need to enable debug mode for Trident, which will log all the API calls.
- From there, you need to retrieve all the POST/PATCH calls…
- hth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement