cancel
Showing results for 
Search instead for 
Did you mean: 

how to use a network share folder (CIFS) on a service group?

Yet
Level 5
Partner Accredited

Hi,

I have below environment,

node 1 & node 2

SFW HA 6.0.1, Windows 2008 R2

node 3 with shared folder (\\node3\folder) use as Vault Store

EV service group

 

i need \\node3\folder to be part of EV service group and failed over between nodes as part of EV cluster. it should only be mounted on active node and not on the passive node. can i do this? if so, how?

normal way i can mount a share via CLI like "c:\ net use Z: \\node3\folder", is there a resource where i can only specify this syntax so it will be part of the service group and the failover process?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

mikebounds
Level 6
Partner Accredited

A trigger script is not a resource it is a script that is run for specific events, so you could use:

preonline trigger: Mount share, just before EV service group is onlined

postonline trigger: Mount share, just after EV service group completes its online

To implement the trigger you need to copy the trigger from %VCS_HOME%\bin\sample_triggers to %VCS_HOME%\bin\triggers.  These triggers are written in perl

All triggers apart from preonline are automatically enabled once you put there in the triggers directory, so if you use preonline you need to set "PreOnline" = 1 for the EV service group.   If you use postonline, the postonline script will run for all service groups so if you have other service groups you will need an "if" statement so the script only mounts the share for the EV service group.

Example if you use postonline, then your code (perl) will be something like:

$group = $ARGV[1];
if ($group eq "EV") {
   VCSAG_SYSTEM("net use Z: \\node3\folder");
}
 
If you use preonline then you don't need "if ($group eq "EV")" unless you have another service group that needs a different preonline.
 
If you don't want Z: to be ever mounted on both nodes, then you will need a postoffline trigger which unmounts Z:
I use wordpad to open triggers as they have UNIX line ends so don't open in notepad.
For more information on triggers, see "VCS event triggers" section in the VCS admin guide.
 
If it doesn't matter if Z: is mounted on both nodes, you could just have Z: permenantly mounted on both nodes and not use VCS to mount it.
 
Mike

View solution in original post

4 REPLIES 4

mikebounds
Level 6
Partner Accredited

If node3 is part of the cluster and you want to share \folder using VCS, then the resource type you need to use is "FileShare" - see the VCS bundled agent guide http://sort-cdn.symantec.com/public/documents/sfha/6.0.1/windows/productguides/pdf/VCS_BundledAgents...- here it gives an example:

 

FileShare FileShare_SG-FileShare (
PathName = "\\ToShare"
ShareName = ToShare
LanmanResName = FileShare_SG-Lanman
MaxUsers = 100
MountResName = FileShare_SG-MountV
UserPermissions = { "VCSNET\\Administrator" = READ_ACCESS }
ShareSubdirectories = 1
HideChildShares = 1
AccessBasedEnumeration = 1
)
 
If you want this to be on the same node as EV service group is running on, then put this resource in same service group and then you can put the shared folder in the same mount as EV or you can create a new MountV resource if the volume is different from EV and a new diskgroup if this is different from EV.
 
 
But after reading through your post again, I think you mean node3 is NOT part of the cluster and you want to mount shared CIFS folder from cluster running on nodes 1 and 2.  You can do the equivalent in UNIX by mounting an NFS share using the Mount agent - i.e the Mount agent in VCS for UNIX, supports NFS, but the Windows Mount (or MountV) resource does not support CIFS.  
I can only see a NetApp SnapDrive agent which seems to allow you to mount a CIFS share that is provided by Netapp filer over iSCSI or the FC protocol, but I don't think there is a agent for mounting a CIFS share proving by a Windows server over IP.
 
You could mount the share in a preonline or postonline trigger by implementing one of these triggers and adding "net use Z: \\node3\folder" to one of these trigger scripts.
 
Mike
 
 

 

Yet
Level 5
Partner Accredited

Thanks Mike for the post.

You're right on the 2nd part, node 3 is not part of the cluster nodes. It can share the folder as nfs for unix but the cluster nodes are Windows so CIFS is in use.

If that is not possible, I might go with the trigger script. How can i include that on the service group? what resource i can use? can you pls tell me more about that a sit seems to be my only hope.

mikebounds
Level 6
Partner Accredited

A trigger script is not a resource it is a script that is run for specific events, so you could use:

preonline trigger: Mount share, just before EV service group is onlined

postonline trigger: Mount share, just after EV service group completes its online

To implement the trigger you need to copy the trigger from %VCS_HOME%\bin\sample_triggers to %VCS_HOME%\bin\triggers.  These triggers are written in perl

All triggers apart from preonline are automatically enabled once you put there in the triggers directory, so if you use preonline you need to set "PreOnline" = 1 for the EV service group.   If you use postonline, the postonline script will run for all service groups so if you have other service groups you will need an "if" statement so the script only mounts the share for the EV service group.

Example if you use postonline, then your code (perl) will be something like:

$group = $ARGV[1];
if ($group eq "EV") {
   VCSAG_SYSTEM("net use Z: \\node3\folder");
}
 
If you use preonline then you don't need "if ($group eq "EV")" unless you have another service group that needs a different preonline.
 
If you don't want Z: to be ever mounted on both nodes, then you will need a postoffline trigger which unmounts Z:
I use wordpad to open triggers as they have UNIX line ends so don't open in notepad.
For more information on triggers, see "VCS event triggers" section in the VCS admin guide.
 
If it doesn't matter if Z: is mounted on both nodes, you could just have Z: permenantly mounted on both nodes and not use VCS to mount it.
 
Mike

Yet
Level 5
Partner Accredited

Thanks so much for the post Mike.

I think this is the workaround I'm looking for. I'll go through the details of event triggers.