I needed a simple way to push some base tuning configurations to a large number of hosts in my lab. I also need to do this often for POCs or new deployments.
Make this into a script called tune.sh. Update the naa.999 with the numbers your AFA SAN makes inside your vmware. (naa360 and others are common).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/bin/sh esxcli system module parameters list -m fnic esxcli system module parameters set -p fnic_max_qdepth=256 -m fnic esxcli system settings advanced set --int-value=64 -o /Disk/SchedQuantum esxcli system settings advanced set --int-value=16384 -o /DataMover/MaxHWTransferSize for i in `esxcli storage nmp path list | grep "Device:" | awk '{print $2}' | grep naa.999` ; do esxcli storage nmp psp roundrobin deviceconfig set -I 1 -t iops --device=$i; done for i in `esxcli storage nmp path list | grep "Device:" | awk '{print $2}' | grep naa.999` ; do esxcli storage core device set -O 256 --device=$i; done |
Then just scp them to the hosts. (my hosts have an interface on 192.168.1.17-192.168.1.22)
1 |
for i in `seq 17 22`; do scp tune.sh root@192.168.1.$i:/tmp/ ; done |
Then run it.
1 |
for i in `seq 17 22`; do ssh root@192.168.1.$i /bin/sh /tmp/tune.sh ; done |
Boom! Done! a big swipe at tuning all hosts.
If you aren’t on a computer with a terminal, you can WinSCP the script up and run it manually in putty. Or, just get cygwin. Or, buy a Mac 😉
Other things not to forget:
1 2 3 4 5 6 7 |
#These are vCenter tuning params I use to supercharge VM cloning on AFAs. This is for a 6-8 UCS blade cluster with 768-1TB ram in it. These probably will totally mess up a production cluster. Use at your own risk! config.vpxd.ResourceManager.MaxCostPerEsx41Ds = 512 #Since everything is going to one datastore usually config.vpxd.ResourceManager.MaxCostPerDatastore = 368 #This one helps power on enmasse config.vpxd.ResourceManager.maxCostPerHost = 84 |