Friday, 26 December 2014

Simulating your Clustered ONTAP Environment: Part 6 - CIFS Shares and More

13) CIFS Shares

Run these commands from the Clustershell ::>

rows 0
set -showseparator "#"
set -showallfields true
cifs share show -share-name !admin$,!c$,!ipc$

Copy and paste into Excel using the ‘Text Import Wizard’ and # as a delimiter. The Clustershell command syntax to be created is ::>

cifs share create -vserver {Vserver} -share-name {Share} -path {Path} -share-properties {Share Properties} -symlink-properties {Symlink Properties} -file-umask {File Mode Creation Mask} -dir-umask {Directory Mode Creation Mask} -comment {Share Comment} -attribute-cache-ttl {File Attribute Cache Lifetime} -offline-files {Offline Files} -vscan-fileop-profile {Vscan File-Operations Profile}

This is generated by the following Excel formula:

=CONCATENATE("cifs share create -vserver ",A3," -share-name ","""",B3,""""," -path ","""",D3,""""," -share-properties ",E3," -symlink-properties ",F3,(IF(G3<>"-",(CONCATENATE(" -file-umask ",G3)),"")),(IF(H3<>"-",(CONCATENATE(" -dir-umask ",H3)),"")),(IF(I3<>"-",(CONCATENATE(" -comment ","""",I3,"""")),"")),(IF(K3<>"-",(CONCATENATE(" -attribute-cache-ttl ","""",K3,"""")),""))," -offline-file ",M3," -vscan-fileop-profile ",N3,"; cifs share access-control delete -vserver ",A3," -share ","""",B3,""""," -user-or-group Everyone")

Note: The above actually produces two commands - the ‘cifs share create’ and a ‘cifs share access-control delete’ for the Everyone group which by default has “Full Control” for every new share.

14) CIFS Shares Access Controls

Run these commands from the Clustershell ::>

rows 0
set -showseparator "#"
set -showallfields true
cifs share access-control show -share !admin$,!c$,!ipc$

Copy and paste into Excel using the ‘Text Import Wizard’ and # as a delimiter. The Clustershell command syntax to be created is ::>

::> cifs share access-control create -vserver {Vserver} -share {Share Name} -user-or-group {User/Group Name} -permission {Access Type}

This is generated by the following Excel formula:

=CONCATENATE("cifs share access-control create -vserver ",A3," -share ","""",B3,""""," -user-or-group ","""",C3,""""," -permission ",D3)

Note: For this to work 100% it assumes all the AD Users/Groups referenced in the cifs share access-control’s, exist in the LAB domain.

XX) And On And On...

Okay, so 6 parts in and we’re still not finished! The 3 step method is pretty repeatable though for whatever configuration needs to be brought across to the environment simulator:

STEP 1) Grab show output with # separator
STEP 2) Paste into excel with # as a separator (or more)
STEP 3) Excel concatenate formula to give the commands to load into the Simulator

Still to be done for a NAS environment simulator (mostly the NFS configuration):

15) Export Policy
16) Export Policy Rules
17) Exports on Volumes
18) Exports on Qtrees
19) UNIX users
20) UNIX groups
21) UNIX-WIN and WIN-UNIX name mappings
22) CIFS Local Groups and Local Users (tricky!)
23) Quotas
...

TO BE CONTINUED... (perhaps)

NOTE: Remember SIMs are highly limited, so don't expect to be able to come even close to simulating a large real-world environment, it just won't happen (things like SnapMirrors will fail simply because too many are running for the Simulator to cope with - due to it's limited platform limits - and volumes will end up in a restricted state...) A very small subset of a large environment is the realistic capability of a Simulator lab.

No comments:

Post a Comment