Sunday, April 6, 2014

NetApp - Volume / LUN Provisioning via CLI

The NetApp System Manager has some decent controls to set up a volume - once or twice.  However, if you provision a lot of storage and you want everything to be the same, here are the commands I use.

Typically, I will set this up in notepad and then just paste it into the CLI.  Just replace VOLNAME and AGGRNAME and the sizes.  This will do the following for each volume:


  • Create the volume
  • Turn on dedupe (SIS)
  • Configure dedupe to run automatically when it is needed (20% new data written)
  • Configure auto snapshot removal on
  • Configure auto snapshot removal threshold to 90%
  • Set the snapshot reserve to 20%
  • Turn on and configure volume autosize maximum and internal
  • Hide the snapshot directory
  • Turn off unnecessary access time updates for LUNs.
    • If you are using NFS or CIFS in a user/file share environment, you may want to leave this option off (i.e., leave access time updates on)
  • Turn on reallocation based on the default schedule/interval

vol create VOLNAME -s none AGGRNAME 500g
sis on /vol/VOLNAME
sis config -s auto /vol/VOLNAME
snap autodelete VOLNAME on
snap autodelete VOLNAME target_free_space 10
snap reserve VOLNAME 20
vol autosize VOLNAME -m 750g -i 50g on
vol options VOLNAME nosnapdir true
vol options VOLNAME no_atime_update on
reallocate start -p /vol/VOLNAME

If you work in a NAS environment, export the path:

exportfs -io sec=sys,rw=NFS_SUBNET/24,root=NFS_SUBNET/24,nosuid /vol/VOLNAME
exportfs -w /etc/exports

If you want to add this volume to all VMware hosts, in PowerCLI:


connect-viserver VCENTER
Get-VMHost | New-Datastore -Nfs -Name VOLNAME -Path "/vol/VOLNAME" -NfsHost FILERIP

If you work in a block environment, create the lun.  This is for a Windows boot lun:

lun create -s 80g -t windows_2008 -o noreserve /vol/VOLNAME/INITIATOR_boot_lun

If you need to provision the block initiators, this will set it up with ALUA / MPIO and map it to the boot lun ID:

igroup create -f -t windows INITIATOR
igroup add INITIATOR 20:00:00:25:A0:00:00:0A
igroup add INITIATOR 20:00:00:25:B0:00:00:0B
igroup set INITIATOR alua yes

lun map /vol/VOLNAME/INITIATOR_boot_lun INITIATOR 0


No comments:

Post a Comment

Featured Post

Remove 3D Objects and other annoying folders on Windows 10

 Microsoft just keeps adding more crap to clutter up the navigation in Windows 10.  Seriously, who needs a 3D Objects folder?  The tiny perc...