Recently I needed to setup a NFS server but needed it to specifically be on a specific vmkernel adapter.
I found this KB https://kb.vmware.com/s/article/50112854 however there were some things missing so I decided to write this walkthrough incase it helps any one else.
First thing , remove all NFS mounted datastores if you haven't already.
I ran through this on 7.0.2 however is probably the same for other versions.
Step 1:
This is going to be on a DVS, so we want to go ahead and create a port group to silo off our NFS traffic.
To make life easy, we will just call it NFS
Static binding and elastic port allocation were the defaults so I let these there. If you are VLAN'ing your traffic modify this info here, and complete the wizard.
Next put your host into Maintenance Mode
We are going to add a New TCP/IP stack to the host. First check that you have not already created one in the UI by opening a browser to the ESXi host, navigate to networking > TCP/IP Stacks
SSH into your ESXi host and run the following command to add a new netstack called nfs
localcli network ip netstack add --netstack=nfs
Run the next command to verify the new netstack exists and reboot (it does not show up in the UI untill a reboot has been done)
esxcli network ip netstack get --netstack=nfs
After the reboot you can check the UI and verify you now see the new TCP/IP stack
The next set of commands will stop and start services (if not already stopped) and bind NFS traffic to our newly created TCP\IP stack 'nfs'. reboot after running
/etc/init.d/nfsgssd stop
vmkload_mod -u nfs41client
vmkload_mod -u nfsclient
vmkload_mod -u sunrpc
localcli system module parameters set -m sunrpc -p netstackName=nfs
localcli system module load -m sunrpc
localcli system module load -m nfsclient
localcli system module load -m nfs41client
/etc/init.d/nfsgssd start
Once the host comes back up you can now use vCenter to add in a new vmkernel adapter
Choose VMkernel NEtwork Adapter
Select the DVS port group we created at the begining
Now change the drop down to the new stack we just created
Complete the setup
Once it is created you can now mount your NFS share with the vmkernel IP you specified and have the NFS traffic go through that vmk.
Comments
Post a Comment