I have to change storage settings all the time and I have gotten extremely tired of this and since I don’t know PowerCLI yet why not do shell scripts? These do have lines that assume you are using UCS and I haven’t put any logic in them to actually find out if you are or aren’t. These are based off of the array vendor’s best practice guides that I was given.
What I do is upload these scripts to a datastore and use clusterssh to execute them on all of the ESXi hosts. Reboot for all settings to take effect.
Copy the scripts below and paste it into notepad and save it as a .sh file or download them at the bottom.
XtremeIO 5.0 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all Xtreme LUNs" for i in `esxcli storage nmp device list | grep XtremIO|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp device set -d $i -P VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all Xtreme LUNs" for i in `esxcli storage nmp device list | grep XtremIO|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 Globally" vim-cmd hostsvc/advopt/update Disk.SchedNumReqOutstanding long 256 # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -c tpgs_off -e "XtremIO Active/Active" -M XtremApp -P VMW_PSP_RR -O iops=1 -s VMW_SATP_DEFAULT_AA -t vendor -V XtremIO echo "Setting DiskMaxIOSize to 4096 bytes" ##Set DiskMaxIOSize to 4096bytes. Default is 32797.## esxcfg-advcfg -s 4096 /Disk/DiskMaxIOSize echo "Increasing the fnic driver queue depth to 128" ##Increase queue depth on UCS fnic adapter to 128. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set -m fnic -p fnic_max_qdepth=128 echo "Enabling VAAI but it should be on already" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking echo "Setting the MaxHWTransferSize to 16MB" ##Set MaxHWTransferSize to 16MB (Default is 4MB)## esxcli system settings advanced set --int-value 16384 --option /DataMover/MaxHWTransferSize |
XtremeIO 5.5 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all devices beginning with naa.514f0" for i in `esxcli storage nmp device list | grep XtremIO|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp device set -d $i -P VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all devices beginning with naa.514f0" for i in `esxcli storage nmp device list | grep XtremIO|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 on each LUN beginning with naa.514f0" for i in `esxcli storage nmp device list | grep XtremIO|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage core device set -d $i -O 256 echo "Configured $i" done echo "Setting Round Robin as the default path selection" # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -c tpgs_off -e "XtremIO Active/Active" -M XtremApp -P VMW_PSP_RR -O iops=1 -s VMW_SATP_DEFAULT_AA -t vendor -V XtremIO echo "Setting DiskMaxIOSize to 4096bytes" ##Set DiskMaxIOSize to 4096bytes. Default is 32797.## esxcfg-advcfg -s 4096 /Disk/DiskMaxIOSize echo "Increasing the queue depth on the fnic driver to 128" ##Increase queue depth on UCS fnic adapter to 128. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set -m fnic -p fnic_max_qdepth=128 echo "Enabling VAAI but it should be on already" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking echo "Setting MaxHWTransferSize to 16MB" ##Set MaxHWTransferSize to 16MB (Default is 4MB)## esxcli system settings advanced set --int-value 16384 --option /DataMover/MaxHWTransferSize |
If you want to download them then you can download the vSphere 5.5 version here and the vSphere 5.0 version here
Time for the Pure versions
Pure Storage 5.0 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all Pure LUNs" for i in `esxcli storage nmp device list | grep PURE|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp device set -d $i --psp=VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all Pure LUNs" for i in `esxcli storage nmp device list | grep PURE|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 on each Pure LUN" vim-cmd hostsvc/advopt/update Disk.SchedNumReqOutstanding long 256 done echo "Creating a SATP rule for future LUNs" # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -c tpgs_on -e "Pure Storage" -M Pure -P VMW_PSP_RR -O iops=1 -s VMW_SATP_ALUA -t vendor -V Pure echo "Setting the fnic queue depth back to default" ##Decrease fnic queue depth to default. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set –m fnic -p fnic_max_qdepth=32 echo "Enabling VAAI just in case it's not already on" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking echo "Setting MaxHWTransferSize to 16MB" ##Set MaxHWTransferSize to 16MB (Default is 4MB)## esxcli system settings advanced set --int-value 16384 --option /DataMover/MaxHWTransferSize echo "Setting DiskMaxIOSize to Default" ##Set DiskMaxIOSize to 4096bytes. Default is 32797.## esxcfg-advcfg -s 32797 /Disk/DiskMaxIOSize |
Pure Storage 5.5 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all Pure LUNs" for i in `esxcli storage nmp device list | grep PURE|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp device set -d $i --psp=VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all Pure LUNs" for i in `esxcli storage nmp device list | grep PURE|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 on each Pure LUN" for i in `esxcli storage nmp device list | grep PURE|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage core device set -d $i -O 256 echo "Configured $i" done echo "Creating a SATP rule for future LUNs" # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -c tpgs_on -e "Pure Storage" -M Pure -P VMW_PSP_RR -O iops=1 -s VMW_SATP_ALUA -t vendor -V Pure echo "Setting the fnic queue depth back to default" ##Increase queue depth on UCS fnic adapter to 128. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set –m fnic -p fnic_max_qdepth=32 echo "Enabling VAAI just in case it's not already on" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking echo "Setting MaxHWTransferSize to 16MB" ##Set MaxHWTransferSize to 16MB (Default is 4MB)## esxcli system settings advanced set --int-value 16384 --option /DataMover/MaxHWTransferSize echo "Setting DiskMaxIOSize to Default" ##Set DiskMaxIOSize to 4096bytes. Default is 32797.## esxcfg-advcfg -s 32797 /Disk/DiskMaxIOSize |
If you want to download them then you can download the vSphere 5.5 version here and the vSphere 5.0 version here
3PAR 5.0 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all 3PAR LUNs" for i in `esxcli storage nmp device list | grep -i 3PAR|awk '{print $8}'|sed 's/(//g'|sed's/)//g'` do esxcli storage nmp device set -d $i --psp=VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all 3PAR LUNs" for i in `esxcli storage nmp device list | grep -i 3PAR|awk '{print $8}'|sed 's/(//g'|sed's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 on each 3PAR LUN" vim-cmd hostsvc/advopt/update Disk.SchedNumReqOutstanding long 256 echo "Creating a SATP rule for future LUNs" # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_on" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule" echo "Setting the fnic queue depth back to default" ##Increase queue depth on UCS fnic adapter to 128. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set –m fnic -p fnic_max_qdepth= echo "Enabling VAAI just in case it's not already on" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking ‡echo "Setting MaxHWTransferSize to 16MB ##Set MaxHWTransferSize to 16MB (Default is 4MB)## esxcli system settings advanced set --int-value 16‡384 --option /DataMover/MaxHWTransferSie echo "Setting DiskMaxIOSize back to Default" ##Set DiskMaxIOSize back to default of 32797.# esxcfg-advcfg -s 32797 /Disk/DiskMaxIOSize |
3PAR 5.5 Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#!/bin/sh echo "Setting Round-Robin Multipathing for all 3PAR LUNs" for i in `esxcli storage nmp device list | grep -i 3PAR|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp device set -d $i --psp=VMW_PSP_RR echo "Configured $i" done echo "Setting NMP path switching to 1 IO for all 3PAR LUNs" for i in `esxcli storage nmp device list | grep -i 3PAR|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage nmp psp roundrobin deviceconfig set -t iops -I 1 -d $i echo "Configured $i" done echo "Setting Disk Scheduling Requsts to 256 on each 3PAR LUN" for i in `esxcli storage nmp device list | grep -i 3PAR|awk '{print $8}'|sed 's/(//g'|sed 's/)//g'` do esxcli storage core device set -d $i -O 255 echo "Configured $i" done echo "Creating a SATP rule for future LUNs" # Set Round Robin as default path selection so new devices will use RR esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_on" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule" echo "Setting the fnic queue depth back to default" ##Increase queue depth on UCS fnic adapter to 128. Must have minimum driver version of 1.5.0.45.## esxcli system module parameters set –m fnic -p fnic_max_qdepth= echo "Enabling VAAI just in case it's not already on" ##Enable VAAI (should be on by default in vSphere 5.x)## esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedMove esxcli system settings advanced set --int-value 1 -o /DataMover/HardwareAcceleratedInit esxcli system settings advanced set --int-value 1 -o /VMFS3/HardwareAcceleratedLocking echo "Setting Queue Parameters" esxcfg-advcfg -s 32 /Disk/QFullSampleSize esxcfg-advcfg -s 4 /Disk/QFullThreshold esxcfg-advcfg -s 64 /Disk/SchedQuantum echo "Setting DiskMaxIOSize" esxcfg-advcfg -s 16384 /Disk/DiskMaxIOSize echo "Setting MaxHWTransferSize to 16MB" ##Set MaxHWTransferSize to 16MB (Default‡ is 4MB)# esxcli system settings advanced set --int-value 16384 --option /DataMover/MaxHWTransferSize |
If you want to download them then you can download the vSphere 5.5 version here and the vSphere 5.0 version here
I do not assume any liability or responsibility for any damage or awesomeness that this may provide to your environment