First we need to enable the Nfs/client services on the Server but have to disable the autostart of NFS services across the reboot of VCS nodes.
svccfg -s nfs/server setprop "application/auto_enable= false"
svccfg -s nfs/mapid setprop "application/auto_enable= false"
svccfg -s nfs/nlockmgr setprop "application/auto_enable= false"
svccfg -s nfs/status setprop "application/auto_enable= false"
Below are the resources we need to configure to set up NFS service group. I have listed them in the phase wise.
Phase1
1. NFSRestart
2. Share
Phase2
3. DiskGroup
4. Mount
Phase3
5. IP
6. NIC
Bottom to top approach is best method to create VCS service groups.
#hagrp -add nfssg
#hagrp -modify nfssg SystemList sys1 0 sys2 1
#hagrp -modify nfssg AutoStartList sys1
#hagrp -modify nfssg SystemList sys1 0 sys2 1
#hagrp -modify nfssg AutoStartList sys1
IP Creation
#hares -add mnicb MultiNICB nfssg
#hares -modify mnicb Critical 0
#hares -modify mnicb Device e1000g0
#hares -modify mnicb Enabled 1
#hares add ipmnicb IPMultiNICB nfssg
#hares -modify ipmnicb Critical 0
#hares -modify ipmnicb Address 192.168.1.100
#hares -modify ipmnicb BaseResName mnicb
#hares -modify ipmnicb NetMask 255.255.255.0
#hares -modify ipmnicb Enabled 1
###################
Now we need a mount point to be shared. This mount point will come from a disk group , as we are using VxVM. So make a DiskGroup resource and name it nfsdg. (Don't confuse with name nfssg)
#hares -modify nfsdg Critical 0
#hares -modify nfsdg DiskGroup dg1
#hares -modify nfsdg Enabled 1
#hares -add nfsmount Mount nfssg
#hares -modify nfsmount Critical 0
#hares -modify nfsmount BlockDevice /dev/vx/dg1/dsk/vol1
#hares -modify nfsmount MountPoint /test
#hares -modify nfsmount MountOpt
#hares -modify nfsmount Enabled 1
###################
#hares -add nfsshare Share nfssg
#hares -modify nfsshare Critical 0
#hares -modify nfsshare PathName /test
#hares -modify nfsshare Options %-y
#hares -modify nfsshare Enabled 1
#hares -add nfsrestart NFSRestart nfssg
#hares -modify nfsrestart Critical 0
#hares -modify nfsrestart Enabled 1
As we know NFSRestart is most important , so make it grandfather, I mean keep it at the top of dependency tree : NFSRestart ->Share->Mount->DiskGroup and another one is IP->NIC , thats it. DONE. We will make 2 dependency tree not 1 because making 1 dependency tree will violate the rule of max 5 dependency in a tree.
#hares -link nfsrestart nfsshare
#hares -link nfsshare nfsmount
#hares -link nfsmount nfsdg
#hares -link ipmnicb mnicb
###################DONE ...!!!###################
#haconf -dump -makero
BRING THE SERVICE GROUP ONLINE :-
#hagrp -online nfssg -sys sys1
Clarity of facts :-
1. Here , we are working on NFS server and not on client. We are providing high availability to "nfs share".
2. On client, simply mount it by "mount" command. If you want to provide HA on this mount point as well, simple "Mount" type resource will work , with block device modified as "192.168.1.100:/test" .