Difference between revisions of "Useful One-Liners (PowerCLI)"

Jump to navigation Jump to search
→‎Storage: Added "Set LUN Multipathing"
(→‎Storage: Added "List VM RDMs" and "Datastore MultiPathing Policy")
(→‎Storage: Added "Set LUN Multipathing")
Line 125: Line 125:
List all disk multipathing
List all disk multipathing
<source lang="powershell"> Get-VMHost | Get-ScsiLun | Select VMHost,Vendor,Model,LunType,CapacityMB,RuntimeName,MultipathPolicy,CanonicalName | Export-Csv lunpath.csv </source>
<source lang="powershell"> Get-VMHost | Get-ScsiLun | Select VMHost,Vendor,Model,LunType,CapacityMB,RuntimeName,MultipathPolicy,CanonicalName | Export-Csv lunpath.csv </source>
=== Set LUN Multipathing ===
Set all SCSI disks to use round robin multipathing
<source lang="powershell"> Get-VMHost | Get-ScsiLun -LunType disk |  Set-ScsiLun -MultipathPolicy "roundrobin" </source>
The above came from Troy Clavell's post to be found at http://communities.vmware.com/thread/339480
Note that you should also set the IOPS per path to 1 (default is 1000), there is some debate as to whether you should do this or not, HP recommend it for their SAN's, though some worry about the overhead on the ESX caused by switching paths for every IO.  The choice is yours, though for further reading and how to do it...
* http://h20195.www2.hp.com/V2/GetDocument.aspx?docname=4AA1-2185ENW&cc=us&lc=en - HP's best practice
* http://www.yellow-bricks.com/2010/03/30/whats-the-point-of-setting-iops1/


[[Category:PowerCLI]]
[[Category:PowerCLI]]

Navigation menu