Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Netapp: toasters

NetApp scripting question

 

 

Netapp toasters RSS feed   Index | Next | Previous | View Threaded


davidkmcw at gmail

Jan 18, 2010, 12:40 PM

Post #1 of 11 (4373 views)
Permalink
NetApp scripting question

I am putting in a new filer to replace three Windows servers and in the
process I will have to create approx 110 shares. I have heard that there is
a way of scripting the process. does anyone have any information that they
could provide for me on this process?

Sláinte,

David

"Build a man a fire he'll be warm for a day, set a man on fire and he'll be
warm for the rest of his life" - Terry Pratchett

Checkout my photos - http://www.panoramio.com/user/1113507


Adam.Fox at netapp

Jan 18, 2010, 1:03 PM

Post #2 of 11 (4269 views)
Permalink
RE: NetApp scripting question [In reply to]

If the shares you want to create are for each user home directory then, yes, there's an automated way to do it in Data ONTAP called the cifs.homedir feature.

Basically you give the controller a set of paths where the homedirs live. The paths should contain directories that match the username of the user. Then, when the feature is activated a share of the name of the user will automatically be made available when that user connects to the storage via CIFS.



So, for example. User 'bob' connects via CIFS, say by using \\netapp <file:///\\netapp> (where netapp is the name of the controller). Along with any other shares manually created there will be an extra share called 'bob' as well and that share will automatically point to a directory called ' bob' in one of the defined paths. Consequently when user 'mary' connects, she will see a share called 'mary', but not a share called 'bob'.



Is that what you are trying to do?



-- Adam Fox

Systems Engineer

adamfox [at] netapp



From: David McWilliams [mailto:davidkmcw [at] gmail]
Sent: Monday, January 18, 2010 3:41 PM
To: NetApp list
Subject: NetApp scripting question



I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?

Sláinte,

David

"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett

Checkout my photos - http://www.panoramio.com/user/1113507


jack1729 at gmail

Jan 18, 2010, 5:45 PM

Post #3 of 11 (4265 views)
Permalink
Re: NetApp scripting question [In reply to]

I think the easiest is to use the CLI to create the share. Get the
syntax and then create a file that has the commands that you want to
use and paste it in the cli...make sure you use spaces where
necessary.

On Mon, Jan 18, 2010 at 3:40 PM, David McWilliams <davidkmcw [at] gmail> wrote:
> I am putting in a new filer to replace three Windows servers and in the
> process I will have to create approx 110 shares. I have heard that there is
> a way of scripting the process. does anyone have any information that they
> could provide for me on this process?
>
> Sláinte,
>
> David
>
> "Build a man a fire he'll be warm for a day, set a man on fire and he'll be
> warm for the rest of his life" - Terry Pratchett
>
> Checkout my photos - http://www.panoramio.com/user/1113507
>


nick at nicholasbernstein

Jan 18, 2010, 8:26 PM

Post #4 of 11 (4263 views)
Permalink
Re: NetApp scripting question [In reply to]

"plink", part of the putty suite allows you to send commands via ssh,
which you can easily wrap in your scripting language of choice, and
can either have it save credentials or use PKI keys.

--
Sent from my mobile device

On Jan 18, 2010, at 5:45 PM, Jack Lyons <jack1729 [at] gmail> wrote:

> I think the easiest is to use the CLI to create the share. Get the
> syntax and then create a file that has the commands that you want to
> use and paste it in the cli...make sure you use spaces where
> necessary.
>
> On Mon, Jan 18, 2010 at 3:40 PM, David McWilliams
> <davidkmcw [at] gmail> wrote:
>> I am putting in a new filer to replace three Windows servers and in
>> the
>> process I will have to create approx 110 shares. I have heard that
>> there is
>> a way of scripting the process. does anyone have any information
>> that they
>> could provide for me on this process?
>>
>> Sláinte,
>>
>> David
>>
>> "Build a man a fire he'll be warm for a day, set a man on fire and
>> he'll be
>> warm for the rest of his life" - Terry Pratchett
>>
>> Checkout my photos - http://www.panoramio.com/user/1113507
>>
>


klises at caminomedical

Jan 18, 2010, 8:48 PM

Post #5 of 11 (4269 views)
Permalink
Re: NetApp scripting question [In reply to]

Do this from the cmd prompt from a windows box: (I assume you have view
admin rights to the shares)

net view \\<server name>

copy the share names to a text file.

then, I use a rsh from an XP or box that has rsh enabled.

You can use an excel file with all the shares and volumes, or use a script.

rsh to your filer with the output
rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/

I have a script that calls a text file of all the shares with variables,,,
Its not really sexy but gets it done. I can send to you if you wish. I
created one from about 50 shares. It took about 1 minute to do it all...
LOVE MY FILERS!!

You can do the same for qtrees.


David McWilliams wrote:
>
> I am putting in a new filer to replace three Windows servers and in the
> process I will have to create approx 110 shares. I have heard that there
> is
> a way of scripting the process. does anyone have any information that they
> could provide for me on this process?
>
> Sláinte,
>
> David
>
> "Build a man a fire he'll be warm for a day, set a man on fire and he'll
> be
> warm for the rest of his life" - Terry Pratchett
>
> Checkout my photos - http://www.panoramio.com/user/1113507
>
>

--
View this message in context: http://old.nabble.com/NetApp-scripting-question-tp27216749p27220950.html
Sent from the Network Appliance - Toasters mailing list archive at Nabble.com.


tmacmd at gmail

Jan 18, 2010, 9:02 PM

Post #6 of 11 (4274 views)
Permalink
Re: NetApp scripting question [In reply to]

Another tip...or way to do this...

get all your commands in order.
Place them in a text file. Place the text file on your netapp and then:

source /vol/path/to/file

The filer will execute all the commands in the file.
--tmac
Tim McCarthy
Principal Consultant



On Mon, Jan 18, 2010 at 11:48 PM, steve klise <klises [at] caminomedical> wrote:
>
> Do this from the cmd prompt from a windows box:  (I assume you have view
> admin rights to the shares)
>
> net view \\<server name>
>
> copy the share names to a text file.
>
> then, I use a rsh from an XP or box that has rsh enabled.
>
> You can use an excel file with all the shares and volumes, or use a script.
>
> rsh to your filer with the output
> rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/
>
> I have a script that calls a text file of all the shares with variables,,,
> Its not really sexy but gets it done.  I can send to you if you wish.  I
> created one from about 50 shares.  It took about 1 minute to do it all...
> LOVE MY FILERS!!
>
> You can do the same for qtrees.
>
>
> David McWilliams wrote:
>>
>> I am putting in a new filer to replace three Windows servers and in the
>> process I will have to create approx 110 shares. I have heard that there
>> is
>> a way of scripting the process. does anyone have any information that they
>> could provide for me on this process?
>>
>> Sláinte,
>>
>> David
>>
>> "Build a man a fire he'll be warm for a day, set a man on fire and he'll
>> be
>> warm for the rest of his life" - Terry Pratchett
>>
>> Checkout my photos - http://www.panoramio.com/user/1113507
>>
>>
>
> --
> View this message in context: http://old.nabble.com/NetApp-scripting-question-tp27216749p27220950.html
> Sent from the Network Appliance - Toasters mailing list archive at Nabble.com.
>
>
>


nick at nicholasbernstein

Jan 18, 2010, 11:10 PM

Post #7 of 11 (4265 views)
Permalink
Re: NetApp scripting question [In reply to]

On Mon, Jan 18, 2010 at 8:48 PM, steve klise <klises [at] caminomedical>wrote:

>
> --snip--
> rsh to your filer with the output
> rsh <filername> cifs shares -add <name of share>
> /vol/volume_for_your_share/
> --snip--


I would be very, very careful with using rsh. It's very insecure. ssh via
either the standard unix ssh command, or plink, can be used as a drop in
replacement, and is much, much more secure.

ssh authorized_keys (passwordless ssh): http://ww
w.nabble.com/ssh-config-on-DOT-7-t2595957.html<http://www.nabble.com/ssh-config-on-DOT-7-t2595957.html>
ssh inline replacement of rsh on a unix host: http://www.didc.
lbl.gov/DPSS/ssh-info.html <http://www.didc.lbl.gov/DPSS/ssh-info.html>

If you *do* have to use rsh, be sure to use role based access controls to
create a user, and a role w/ minimum number of commands needed.


bacardicoke at gmail

Jan 18, 2010, 11:36 PM

Post #8 of 11 (4271 views)
Permalink
Re: NetApp scripting question [In reply to]

Hey Steve,

On Tue, Jan 19, 2010 at 05:48, steve klise <klises [at] caminomedical> wrote:
>
> net view \\<server name>
>
> ....
>
> rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/
>

Be aware that you will not be copying any permissions set on the share
level in this way. If you have share-level permissions, you can set
them using the "cifs access" command.

This example hands out Full Control to the domain users group:

plink -ssh root [at] toase 'cifs access myshare "CORP\Domain Users" Full Control'

Good luck with the scripting!

--
Simple guidelines to happiness:
Work like you don't need the money,
Love like your heart has never been broken and
Dance like no one can see you.


netbacker at gmail

Jan 19, 2010, 8:46 AM

Post #9 of 11 (4224 views)
Permalink
Re: NetApp scripting question [In reply to]

On Mon, Jan 18, 2010 at 12:40 PM, David McWilliams <davidkmcw [at] gmail>wrote:

> I am putting in a new filer to replace three Windows servers and in the
> process I will have to create approx 110 shares.
>

May I know why you need to create 110 shares? How are you organizing your
data from the three windows servers? I would look at creating *a share per
volume* and organize the data within Qtrees under each of these volumes and
look at using Microsoft DFS to present the data in a more user friendly way.


-G


kdavis at mathworks

Mar 1, 2010, 7:16 AM

Post #10 of 11 (2697 views)
Permalink
Re: NetApp scripting question [In reply to]

> I am putting in a new filer to replace three Windows servers and in the process I will have to create
> approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any
> information that they could provide for me on this process?

It's easy, but like any scripting task, you just need to know what you want
ahead of time. If these shares are of the most basic sort (share name, path,
everyone/full control access), then all you need to do is dump all the commands
into a file and execute them on the filer or via SSH. If you can handle a
reboot, just append all of the new shares into <root>/etc/cifsconfig_share.cfg.
The syntax is straightforward, and the shares will be created upon next boot. I
suspect the same would happen if you just restarted CIFS, but I haven't tried
it. Take a look at it - it's simple - and you can just as easily set different
access to each share if you have that information too.


*------------------------------------------*-----------------------*
| Kevin Davis (UNIX/Storage Sysadmin) | Natick, Massachusetts |
| 508.647.7660 | 01760-2098 |
| mailto:kevin.davis [at] mathworks *-----------------------*
| http://www.mathworks.com | |
*------------------------------------------*-----------------------*


davidkmcw at gmail

Mar 1, 2010, 10:30 AM

Post #11 of 11 (2697 views)
Permalink
Re: NetApp scripting question [In reply to]

This is what I did and it worked great, all qtrees set up in no time, with
all appropriate perms.

Sláinte,

David

"Build a man a fire he'll be warm for a day, set a man on fire and he'll be
warm for the rest of his life" - Terry Pratchett

Checkout my photos - http://www.panoramio.com/user/1113507


On Mon, Mar 1, 2010 at 1:23 PM, <Marek.Stopka [at] tieto> wrote:

> Or you can put all commandis into a single file and go like
>
> toaster> source /home/createallneededcifs.txt
>
> :-)
>
> I like this one more then directly touching configuration file...
> ________________________________________
> From: owner-toasters [at] mathworks [owner-toasters [at] mathworks] On
> Behalf Of Kevin Davis [kdavis [at] mathworks]
> Sent: Monday, March 01, 2010 5:16 PM
> To: David McWilliams
> Cc: NetApp list
> Subject: Re: NetApp scripting question
>
> > I am putting in a new filer to replace three Windows servers and in the
> process I will have to create
> > approx 110 shares. I have heard that there is a way of scripting the
> process. does anyone have any
> > information that they could provide for me on this process?
>
> It's easy, but like any scripting task, you just need to know what you want
> ahead of time. If these shares are of the most basic sort (share name,
> path,
> everyone/full control access), then all you need to do is dump all the
> commands
> into a file and execute them on the filer or via SSH. If you can handle a
> reboot, just append all of the new shares into
> <root>/etc/cifsconfig_share.cfg.
> The syntax is straightforward, and the shares will be created upon next
> boot. I
> suspect the same would happen if you just restarted CIFS, but I haven't
> tried
> it. Take a look at it - it's simple - and you can just as easily set
> different
> access to each share if you have that information too.
>
>
> *------------------------------------------*-----------------------*
> | Kevin Davis (UNIX/Storage Sysadmin) | Natick, Massachusetts |
> | 508.647.7660 | 01760-2098 |
> | mailto:kevin.davis [at] mathworks *-----------------------*
> | http://www.mathworks.com | |
> *------------------------------------------*-----------------------*
>
>

Netapp toasters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.