How are NFS export-policies evaluated in ONTAP 9?
Applies to
- ONTAP 9
- NFS
Answer
- An export-policy is evaluated when a client attempts to access the NFS namespace and no existing access rule has been cached
- During mount, the root volume export-policy is evaluated before the volume or qtree policy
- The volume policy will be evaluated for all access afterward unless it is a qtree, and qtree-exports are enabled
- Request from NFS client is received
- NBLADE will decode filehandle to find appropriate volume and identify appropriate export-policy-ruleset to evaluate access against.
- NBLADE may reference VLDB during this time
- NBLADE check AccessCache for the client in question, against the ruleset-id associated with the QTREE/Volume export policy.
- If client is not cache, NBLADE sends query to MGWD to evaluate export-policy for this client
- IP export rule
- IP address received is compared as a string match against the ip address in export rule
- No DNS in use
- Hostname Export rule
- MGWD performs forward lookup for all hostname rules.
- MGWD evaluates the received IP against the DNS response as an IP string match
- name-service cache is updated
- MGWD performs forward lookup for all hostname rules.
- Subnet export rule
- IP addresses are compared to subnet rules
- DNS service not in use
- Domain Name export rule
- Requires PTR of the ip to determine hostname and domain
- Access is granted based on the domain retruned in PTR lookup
- Netgroup export rule
- ONTAP will perform a PTR (reverse DNS lookup) of the ip of client to obtain hostname to check in netgroups
- MGWD will check its cache to determine if there is a netgroup.byhost cache entry for the client
- If no cache, mgwd will leverage libc to send requests to NIS/ns-switch netgroup server.
- Priority of NIS servers is based on which ip’s are listed first
- MGWD will update netgroup cache once response is given for all netgroups that a host is a part of.
- MGWD will use this list of netgroups to continue evaluation of export policy rules
- IP export rule
- MGWD will evaluate each rule one by one, in numerical order, until it matches the client to a rule.
- Once a rule is matched, no further evaluation is done for this client.
- If MGWD is not able to resolve the request in a timely manner, ONTAP will respond with a ‘jukebox’ error. NFSv4 ERR Delay.
- This indicates that ONTAP can’t complete the operation within a timely manner, and we are giving up on this call.
- Client will need to resubmit the request if it wishes for it to be performed.
- Clients then will resend the op after X time (5seconds is common)
- This looks like a HANG to clients.
- MOUNT protocol has no error for this and ONTAP will appear to not respond at all.
Additional Information
- NFS Best Practice Guide, TR-4067 Section 4 Export Policies and Rules in Clustered Data ONTAP
- Name Services Best Practice Guide, TR-4668 Section 6 Caching in ONTAP