Using ESXCLI V2 to Configure Storage Multipathing
A customer recently came to me with the need to use ESXCLI to configure a bunch of storage settings on all of their ESXi hosts. He had been planning on connecting to the local console of each host and then executing the command, but wanted to know if there was a better way. Of course there is! We could use plink to run a script on his workstation that would establish SSH connections to his servers and then execute the ESXCLI commands... or we can do it all through PowerCLI! I actually tackled this same problem 5 years ago using get-esxcli. At that point, I did it with the normal V1 version of the cmdlet, which required carefully spaced lists of parameters, leading to ugly lines like this: $esxcli.storage.core.device.set($thisLUN.CanonicalName,$null,$null,$queueFullSample,$queueFullThreshold,$null) No more! Now, we have access to get-esxcli -v2 , which is much easier to use! Instead of needing to put a bunch of $nulls into the .set() method to space out our values, we can us