Quick n Dirty Netapp LUN creation script

I am constantly having to pre-create or migrate massive amounts of LUNs in customer environments.  I have many ways to go about it, powershell, ruby, but my awk script is my #1 way to do it

Imagine having to make luns for  dozens of database instances on multiple hosts for dev/prod/qa. Suckage!

They all would follow a certain order and naming convention.  Most of the sizes would be the same.

If I have to do anything once, I’ll probably have to do it again. So, script it! This will work in any shell with awk (osx/linux/solaris/CygWin)


First I make my descriptor file. Typically this is autogenerated as well. If I have X DB instances per host, and they follow the same structure I’ll just loop over the name. This works the same for 1 lun or thousands.

In this case I am making my luns for a windows system on a 7-mode box. I’ll add Cluster Mode shortly!



Next, comes our awk script.


Line 1: Looping over the mounts.txt file
Line 2: Volume creation
Line 3: Turn off auto snapshotting on volume
Line 4: Set volume auto grow to twice the volume size
Line 5: Turn off snap reserve
Line 6: Create LUN in precreated volume
Line 7: Map Lun to igroup

That’s it. Copy and paste in groups into your SSH to your netapp.


Be Sociable, Share!

, ,

Comments are closed.