Sie sind auf Seite 1von 3

Author: Joe Martin

Email: joemar@cisco.com
Company: Cisco Systems, Inc.
Version: v0.5.05
Date: 3/31/2014
Disclaimer: Code provided as-is. No warranty implied or included. This code is
for example use only and not for production
Overview:
This script will generate the Aliases, Zones and Zone Sets for either
Brocade or Cisco MDS/Nexus.
The script builds Single Initiator/Single Target Zones as this
is the standard recommended and supported by most array
manufactures.
It uses a pre-defined CSV file of SAN target information along with
information gathered by UCSM.
It allows you to save the configuration files to your drive or to write
directly to your equipment with SSH.
It will generate the information for all Service Profiles with vHBAs or
selected ones.
Prerequisites for this script are:
PowerShell must be enabled on your client computer.
Example: set-executionpolicy unrestricted -force
You must be running PowerShell version 3 or above.
You must download and install Cisco PowerTool for PowerShell from:
http://www.cisco.com
A CCO Login is required.
You must download plink.exe and place in the correct folder.
You can download plink.exe here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/downlo
ad.html
plink.exe license can be found here:"
http://www.chiark.greenend.org.uk/~sgtatham/putty/licenc
e.html"
It is assumed plink.exe will be located in the same folder as
the script and CSV targets file
But you can change this in the script.
Search for: $PlinkAndPath
and edit to match the location of your choice.
You must be network connected and have reachability via SSH TCP Port 22
to your SAN Fabric Switches/Directors.
You must be network connected and have reachability via SSL TCP Port
443 to your Cisco UCS Domain.
You must have a login into your UCSM domain with appropriate rights.
You must have a login into your SAN Fabric Switches/Directors with
appropriate rights.
You must have this script and the required WWPN targets CSV file in the
same folder.
If outputting configurations to a file they will also be saved in the
same folder as this script and WWPN targets CSV file.
The script supports Service Profiles with vHBAs for:
Two vHBAs: A & B Fabric.
One vHBA: A Fabric.
One vHBA: B Fabric.
It does NOT support having some Service Profiles with only an A
fabric vHBA and some with only a B fabric vHBA or where some
have two vHBAs and others only have one.
Scalability and Performance:
The scripts tested limits are building Single Initiator/Single Target
Zones is 160 Service Profiles against a 32 Port SAN Array (16 A and 16
B controller ports). This is 2560 Aliases, Zones and Zone Set members
per fabric.
This is not a maximum, but a maximum tested.
It takes only a few seconds to build configurations written to file.
It took ~1 second to build each zone when pushing to an MDS switch and
~4 seconds to build each zone when pushing to a Brocade switch.
For 2560 zones it took 21 minutes to the MDS and 114 minutes to
the brocade for each fabric so be patient when writing to your
equipment.
How it works:
The script logs into a UCSM Domain and collects information about the
VSANS in use, The Service Profiles and their attached vHBA WWPNs.
The script then reads the WWPN CSV file which contains the name of
the zoneset to be used in the fabric along with the names and WWPNs of
the Array targets.
The script then builds aliases, zones and zonesets based on the
commands for either Cisco or Brocade.
Finally the script outputs the configurations to either file or will
SSH directly into your SAN fabric and writes the configuration to your
fabric.
Using the script:
New-UcsFcZoning.ps1
This script can be run without any command line parameters. Use
r will be prompted for all parameters and options required.
New-UcsFcZoning.ps1 -req "y" -ucs "1.2.3.4" -ucred -serviceprofile "one,
two, etc" -manufacture "Cisco" -wwpn "WWPN xxxx.csv" -output "Equipment" -fabri
ca "2.3.4.5" -acred -fabricb "3.4.5.6" -bcred
-req -- Acknowledge that required prerequisites have been met --
Valid options are: Y or N
-ucs -- UCS Manager IP or Host Name -- Example: 1.2.3.4 or myucs
or myucs.domain.local
-ucred -- UCS Manager Credential Switch -- Adding this switch wi
ll immediately prompt you for your UCSM username and password
-serviceprofile -- Service Profile name or names to create zones
for -- Valid options are: SingleName or NameOne,NameTwo,ETC or All
-manufacture -- SAN fabric manufacture -- Valid options are: Cis
co or Brocade
-wwpn -- WWPN targets CSV file -- Example: WWPN xxxxxx.csv (File
name must start with: WWPN)
-output -- Destination of configuration -- Valid options are: Fi
le or Equipment
-fabrica -- SAN Fabric A IP or Host Name -- Example: 2.3.4.5 or
mysana or mysana.domain.local
-acred -- SAN Fabric A Credential Switch -- Adding this switch w
ill immediately prompt you for your SAN Fabric A username and password
-fabricb -- SAN Fabric B IP or Host Name -- Example: 3.4.5.6 or
mysanb or mysana.domain.local
-bcred -- SAN Fabric B Credential Switch -- Adding this switch w
ill immediately prompt you for your SAN Fabric B username and password
All parameters are optional and any skipped will be prompted for during
execution
The only prompts that will always be presented to the user will be for U
ser Names and Passwords
New-UcsFcZoning.ps1 -req "y" -ucs "1.2.3.4" -ucred -serviceprofile "All"
-manufacture "Brocade" -wwpn "WWPN xxxx.csv" -output "File"
-req -- Acknowledge that required prerequisites have been met --
Valid options are: Y or N
-ucs -- UCS Manager IP or Host Name -- Example: 1.2.3.4 or myucs
or myucs.domain.local
-ucred -- UCS Manager Credential Switch -- Adding this switch wi
ll immediately prompt you for your UCSM username and password
-serviceprofile -- Service Profile name or names to create zones
for -- Valid options are: SingleName or NameOne,NameTwo,ETC or All
-manufacture -- SAN fabric manufacture -- Valid options are: Cis
co or Brocade
-wwpn -- WWPN targets CSV file -- Example: WWPN xxxxxx.csv (File
name must start with: WWPN)
-output -- Destination of configuration -- Valid options are: Fi
le or Equipment
All parameters are optional and any skipped will be prompted for during
execution
The only prompts that will always be presented to the user will be for U
ser Names and Passwords
Why did I write this script:
In working with my customers I found that it took a LONG time for
the SAN teams to provision LUNs for servers. One of the items that
took the longest to accomplish was Zoning in the SAN fabrics. For one customer
they told me it took 3 weeks to just zone the A fabric for a deployment of 125
servers. I have also run into issues where teams are very competent at LAN and
Servers but do not understand SAN's very well and they make many mistakes during

turn up and expansion. Some of these mistakes are service impacting to the
organization. My goal was to provide a UCS integration tool to quickly and
accurately provision their SAN fabric zones and it's been tested in many custome
r
locations with 100% success and great appreciation by the teams.
For additional help:
get-help New-UcsFcZoning.ps1
get-help New-UcsFcZoning.ps1 -detailed
get-help New-UcsFcZoning.ps1 -examples
get-help New-UcsFcZoning.ps1 -online
get-help New-UcsFcZoning.ps1 -full

Das könnte Ihnen auch gefallen