Start a Conversation

Unsolved

This post is more than 5 years old

4623

November 30th, 2010 14:00

Powershell EMC ESX/i/VC FC/iSCSI block pathing check and fix script

This post contains information about a custom script I pieced together in order to correlate pathing information and potentially set preferred paths if requested based on the default owner of a LUN.

One of a VMware admins large challenges when working with block storage has to do with path management.  Certain array vendors have stepped up and created path management and failover software for VMware (PowerPath VE from EMC, and others).  However, there still remains a void where it is difficult to centrally verify that all pathing is set how you expect it to using PPVE or NMP.

The attached script does a few things.  The first thing is that it goes to your CX/NS array grabs the relevant storage port WWNs/IQNs as well as LUN identifiers and names.  From there it grabs relevant ESX/i information for datastores.  It then takes the information collected, outputs it to CSV files, and wraps it together correlating datastore to LUN and LUN to the actual default/current owner SP nicely into a powershell sortable grid.  This information allows you to view all pathing in one place and make reactive changes.  If you are doing FIXED pathing, an option can be set to where it will at the end of the script ask you whether you want to fix oustanding pathing issues to set the preferred to the default owner.  Default owner is important here because current owner is how an ESX/i server sets preferred pathing at the moment which can lead to misconfiguration across a cluster.  Default owner if set in a balanced way from the array can serve to be an authoritative source of information for consistently setting preferred paths across the cluster.

Overall, very helpful script.  It is at the moment vendor specific, but with a little tweaking, can be made to serve many different purposes with or without array side information.

A little cautionary portion, the script is not sanctioned by EMC, so there is no official support.  It does however highlight some methods to help manage pathing if not leveraging technology like PPVE.  It is important to mention also that Round Robin is the best practices method other than PPVE for multipath settings in a VMware environment.  Please see EMC reference documents for the latest details.

Portions of the script were taken from PowerShell scripting sites and brought together, so forgive me for not siting it's been a while since I wrote it =) Email me and I will include references.

Message was edited by: Clinton Kitson new video and updates for checks on the script

2 Attachments

No Responses!
No Events found!

Top