After learning about the whole NFS fiasco I decided to create a quick bash script that would be part of my post kickstart process to apply the recommendations from NetApp as well as the fix required by VMware.
mmmmm, BASHy goodness….
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
#!/bin/bash # # cfg-netapp-nfs.sh - written by Andrew Sullivan, 2008-10-20, http://www.get-admin.com # # Report bugs and request improvements at http://get-admin.com/blog/?p=333 # # This script will apply the best practices from NetApp's TR-3428 and the NFS snapshot setting # recommended by VMware in KB article 1005807. # # The script accepts one, optional, parameter: "force". If supplied, it will apply the fix to the # file in /etc/vmware regardless of whether it thinks it should be or not (currently the validation # method is unreliable at best...). # # Examples: # Apply the fixes and tweaks # ./cfg-netapp-nfs.sh # # Force the application of NFS fix # ./cfg-netapp-nfs.sh force # function apply_fix { if [ `grep -c consolidateDeleteNFSLocks /etc/vmware/config` -lt 1 ]; then cp /etc/vmware/config /etc/vmware/config.preNFSfix echo 'prefvmx.consolidateDeleteNFSLocks = "TRUE"' >> /etc/vmware/config echo "Added NFS Consolidate lock setting, please reboot this host." else echo "NFS Consolidate lock setting was already set" fi } # NetApp has some best practice recommendations that need to be applied to the host # to get optimal performance...especially with regard to VMware snapshots. # See TR-3428, http://www.netapp.com/us/library/technical-reports/tr-3428.html # # If you don't have a NetApp, then refer to your provider's documentation for recommended # settings. # increase the number of NFS volumes the system is able to mount to the max. Default is 8. esxcfg-advcfg -s 32 /NFS/MaxVolumes # make sure that NFS locks are not disabled esxcfg-advcfg -s 0 /NFS/LockDisable # this should already be set correctly, but just to make sure esxcfg-advcfg -s 12 /NFS/HeartbeatFrequency # this should also be set correctly already esxcfg-advcfg -s 10 /NFS/HeartbeatMaxFailures # increase the heap size. Default is 9. esxcfg-advcfg -s 30 /Net/TcpIpHeapSize # increase heap max. Default is 30. esxcfg-advcfg -s 120 /Net/TcpIpHeapMax # check to make sure the correct update has been applied. This needs to be more reliable... if [ `esxupdate -l query | grep -c 'ESX350-200808401-BG'` -eq 1 ] || [ `vmware -v | awk -F - '{ print $2 }'` -ge 113339 ] || [ $1 == "force"' ] then apply_fix else echo "Unable to apply NFS consolidate lock setting: update not applied or patch level too low" echo "Would you like to force application of the fix? [y/N]" read -n 1 FORCE case "$FORCE" in [Yy][Ee][Ss]);; *) apply_fix esac fi |
Yeah, I know, this is from like three months ago, but better late than never.