Monday, May 31, 2010

Usefull Brocade Switch commands

Brocase switches

Some Usefull Brocade Switch commands

 aliadd                     Add a member to a zone alias
alicreate Create a zone alias
alidelete Delete a zone alias
aliremove Remove a member from a zone alias
alishow Print zone alias information

cfgadd Add a member to a configuration
cfgclear Clear all zone configurations
cfgcreate Create a zone configuration
cfgdelete Delete a zone configuration
cfgdisable Disable a zone configuration
cfgenable Enable a zone configuration
cfgremove Remove a member from a configuration
cfgsave Save zone configurations in flash
cfgshow Print zone configuration information
cfgsize Print size details of zone database
cfgtransabort Abort zone configuration transaction
cfgtransshow Print zone configurations in transaction buffer

fabportshow Display contents of a particular port's data
fabricshow Print fabric membership info
fabstateclear Clears the fabric state information
fabstateshow Displays the fabric state information
fabstatsshow Displays the fabric statistics information
fabswitchshow Display fabric switch state information

nsaliasshow Display local Name Server information with Aliases
nsallshow Print global Name Server information
nscamshow Print local Name Server Cache information
nsshow Print local Name Server information information
nszonemember Display the information of all the online devices

switchshow Print switch and port status
switchuptime Displays the amount of time for which the switch is up

portdisable Disable a specified port
portenable Enable a specified port

zoneadd Add a member to a zone
zonecreate Create a zone
zonedelete Delete a zone
zonehelp Print zoning help info
zoneremove Remove a member from a zone
zoneshow Print zone information

how to do zoning

Cookbook to create a zone and add it to a config

01. Create the alias for the Device WWNs

 swd77:admin> alicreate "ET_CM0_CA0_P1", "21:40:00:0b:5d:6a:05:82"
swd77:admin> alicreate "test1_fcd0", "50:01:43:80:03:3a:86:ca"

02. Create a new zone called test1

 swd77:admin> zonecreate "test1", "ET_CM0_CA0_P0;test1_fcd0"

03. Add the zone to SAN0 config

 swd77:admin> cfgadd "SAN0", "test31"

04. Save the zone to flash memeory

 swd77:admin> cfgsave

05. Enable the modified configuration

 swd77:admin> cfgenable SAN0

06. Verify the zone

 swd77:admin> zoneshow
Defined configuration:
cfg: SAN0 aembwpd1; aemtest3
zone: aembwpd1
Aembwpd1_P0; ET_CM0_CA0_P0
zone: test1
ET_CM0_CA0_P0; aemtest3_fcd0
alias: Aembwpd1_P0
50:01:43:80:02:9a:92:f0
alias: ET_CM0_CA0_P0
20:40:00:0b:5d:6a:05:82
alias: ET_CM0_CA0_P1
21:40:00:0b:5d:6a:05:82
alias: test1_fcd0
50:01:43:80:03:3a:86:ca

Effective configuration:
cfg: SAN0
zone: aembwpd1
50:01:43:80:02:9a:92:f0
20:40:00:0b:5d:6a:05:82
zone: test1
20:40:00:0b:5d:6a:05:82
50:01:43:80:03:3a:86:ca

switchshow command

switchshow [-portcount | -iscsi]

swd77:admin> switchshow -portcount
FC ports = 24

swd77:admin> switchshow
switchName: swd77
switchType: 71.2
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 1
switchId: fffc01
switchWwn: 10:00:00:05:1e:9b:db:72
zoning: ON (SAN0)
switchBeacon: OFF

Area Port Media Speed State Proto
=====================================
0 0 id N4 Online F-Port 50:01:43:80:02:9a:92:f0
1 1 id N4 Online F-Port 50:01:43:80:02:9a:92:4c
2 2 id N4 Online F-Port 50:01:43:80:03:3a:86:ca
3 3 id N4 No_Light
4 4 id N4 No_Light
5 5 id N4 No_Light
6 6 id N4 No_Light
7 7 id N4 Online F-Port 20:40:00:0b:5d:6a:05:82
8 8 id N4 No_Light
9 9 id N4 No_Light
10 10 id N4 No_Light
11 11 id N4 No_Light
12 12 id N4 No_Light
13 13 id N4 No_Light
14 14 id N4 No_Light
15 15 id N4 Online F-Port 21:40:00:0b:5d:6a:05:82
16 16 -- N8 No_Module (No POD License) Disabled
17 17 -- N8 No_Module (No POD License) Disabled
18 18 -- N8 No_Module (No POD License) Disabled
19 19 -- N8 No_Module (No POD License) Disabled
20 20 -- N8 No_Module (No POD License) Disabled
21 21 -- N8 No_Module (No POD License) Disabled
22 22 -- N8 No_Module (No POD License) Disabled
23 23 -- N8 No_Module (No POD License) Disabled

To delete an alias

 Switch1:admin> alidelete "test1_fcd0"

To Delete a Zone

 Switch1:admin> zonedelete "test01"

To remove test4 zone from configuration SAN1

 Switch2:admin> cfgremove "SAN1", "test4"

map/unmap dev using cli on dmx

You need to install SYMCLI of course to have the base CLI functionality
installed. You can aqquire this software from powerlink.emc.com which
is the support site for EMC.

The software is free of course, you would need to supply the license for
BASE/Server Config in order to be able to re-map EMC hypers to and from
director ports.

Once you have the CLI installed (and added the licenses), you need to
establish a connection with the array. Typically this is done with
devices called "gatekeepers" 3MB or smaller 2-way mirror LUNs which are
used by SYMCLI to talk to the array via SCSI.

If you do not have these available to you, but have some EMC LUNs mapped
to the host, you may still be able to talk to the array without
gatekeepers as a default the CLI will attempt to communicate through a
regular EMC hyper when it fails to locate a gatekeeper.

Once you have verified you can speak with your EMC array you can perform
mapping/unmapping commands for your hypers.

Here is a very small example:

1.) Identify the devices you want to map

#symdev list | grep "???:?"
014F Not Visible ???:? 16A:C5 BCV N/Asst'd
RW 4096
0150 Not Visible ???:? 01B:C5 BCV N/Asst'd
RW 4096

2.) Provided you know which FA, and port you want to map to you would
look at how the LUNs have been mapped to the director port, and use the
next available address in the list.

*FLAGS: (-FA)Director (-p 0) port (-addr) list assigned LUN
addresses (-avail) provide me the next available address

# symcfg list -FA 16C -p 0 -addr -avail


Symmetrix ID: 000187940703 (Local)

Director Device Name Attr
Address
---------------------- ----------------------------- ----
--------------
Ident Symbolic Port Sym Physical VBUS TID
LUN
------ -------- ---- ---- ----------------------- ---- ---
---

FA-16C 16C 0 0000 Not Visible VCM 0 00
000
0001 Not Visible 0 00
001

**************OUTPUT
SNIPPED**********************************
019C Not Visible
0 00 07A
019D Not Visible 0 00
07B
019E Not Visible 0 00
07C
019F Not Visible 0 00
07D
01A0 Not Visible 0 00
07E
01A1 Not Visible 0 00
07F
01A2 Not Visible 0 00
080
- AVAILABLE 0 00
081 *
037F Not Visible 0 00
364
0380 Not Visible 0 00
365
0381 Not Visible 0 00
366
0382 Not Visible 0 00
367
- AVAILABLE 0 00
368 *
038B Not Visible 0 00
370
038C Not Visible 0 00
371
- AVAILABLE 0 00
372 *

3.) So we know the next available LUN is LUN 80 on Director 16C, port
0. LUN addressing can be done using base 10, base 8, and base 16
numbering depending on the director ports specific flag settings. We
perform mapping using a flat file which defines the entries for the LUNs
on the director port:

#echo "map dev 014F to dir 16C:0 target=0, lun=81;" >
map.test.cmd
#echo "map dev 0150 to dir 16C:0 target=0, lun=82;" >>
map.test.cmd
#more map.test.cmd
map dev 014F to dir 16C:0 target=0, lun=81;
map dev 0150 to dir 16C:0 target=0, lun=82;

4.) we have our flat file, so we can issue a configuration change to the
array:

*FLAGS (-file) use the map file I specified (commit) commit the
change

#symconfigure -file map.test.cmd commit


Execute a symconfigure operation (y/[n]) ? y

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change
session...............Established.
Processing symmetrix 000187940703
Performing Access checks..................................Allowed.
Locking devices...........................................Locked.
Submitting configuration changes..........................Submitted.
Validating configuration changes..........................Validated.
Initiating PREPARE of configuration changes...............Queued.
PREPARE requesting required resources.....................Obtained.
Step 006 of 017 steps.....................................Executing.
Step 006 of 017 steps.....................................Executing.
Step 015 of 017 steps.....................................Executing.
Local: PREPARE...........................................Done.
Initiating COMMIT of configuration changes................Queued.
COMMIT requesting required resources......................Obtained.
Step 004 of 046 steps.....................................Executing.
Step 017 of 046 steps.....................................Executing.
Step 037 of 046 steps.....................................Executing.
Step 011 of 059 steps.....................................Executing.
Step 011 of 059 steps.....................................Executing.
Step 042 of 059 steps.....................................Executing.
Step 042 of 059 steps.....................................Executing.
Step 049 of 059 steps.....................................Executing.
Step 050 of 059 steps.....................................Executing.
Step 051 of 059 steps.....................................Executing.
Step 056 of 059 steps.....................................Executing.
Local: COMMIT............................................Done.
Terminating the configuration change session..............Done.

The configuration change session has successfully completed.



The file is parsed to verify the format is correct, if its not the
session aborts. Then the symmetrix is locked while the change occurs so
only one change can occur at any given time. The changes are logged in
/var/symapi/log/symapi-.log, and storapid0.log


5.) Now lets verify we have the LUN mapped to the right port:

# symcfg list -FA 16C -p 0 -addr | egrep '014F|0150'
014F Not Visible 0 00
081
0150 Not Visible 0 00
082

6.) Looks good, but we want to remove them now right? Since they
are mapped they are in a state of ready for use. To remove them they
have to be put in a state of not_ready:

# for dev in 014F 0150
> do
> symdev -sid 703 not_ready $dev -noprompt
> done

'Not Ready' Device operation successfully completed for the device.

'Not Ready' Device operation successfully completed for the device.



7.) now we can do a symconfigure session to remove the devices. This
time we will forego the map file and use STDIN instead:

# symconfigure commit << EOF
> unmap dev 014F from dir 16C:0;
> unmap dev 0150 from dir 16C:0;
> EOF

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change
session...............Established.
Processing symmetrix 000187940703
Performing Access checks..................................Allowed.
Locking devices...........................................Locked.
Submitting configuration changes..........................Submitted.
Validating configuration changes..........................Validated.
Initiating PREPARE of configuration changes...............Queued.
PREPARE requesting required resources.....................Obtained.
***SNIPPED***
Local: PREPARE...........................................Done.
Initiating COMMIT of configuration changes................Queued.
COMMIT requesting required resources......................Obtained.
***SNIPPED***
Local: COMMIT............................................Done.
Terminating the configuration change session..............Done.

The configuration change session has successfully completed.


8.) Verify the LUN addresses are available again on the director port:

# ./symcfg list -FA 16C -p 0 -addr -avail | tail -20
019F Not Visible 0 00
07D
01A0 Not Visible 0 00
07E
01A1 Not Visible 0 00
07F
01A2 Not Visible 0 00
080
- AVAILABLE 0 00

LUN Addresses on a FA Port available for mapping

LUN Addresses on a FA Port available for mapping

Before you are ready to map devices to an FA Port via command line (symcli) you will need to determine what LUN (hyper) addresses are available out there for mapping purposes (unused).


symcfg list -sid xxxx -FA dir -P port -available -addresses

Parameters

xxxx is the last 4 digits of the symmetrix serial number
dir is the FA director number eg 4B
port is the FA’s port number ie 0 or 1

This will produce an output that will indicate all available addresses, a range of available addresses with an asterisk (*). Also the LUN (hyper) addresses displayed in this output are hexadecimal values.

For example, in the output below, the available LUN (hyper) addresses are 06 through 24, 29 through 7F and greater than 83.


Symmetrix ID: 000185701867 (Local)
Director Device Name Attr Address
—— ——– —- —- ——– —– — —–
Ident Symbolic Port Sym Physical VBUS TID LUN
—— ——– —- —- ——– —– — —–
FA-4B 04B 0 0000 Not Visible VCM 0 0 000
0901 Not Visible 0 0 001
0902 Not Visible 0 0 002
0903 Not Visible 0 0 003
0904 Not Visible 0 0 004
0905 Not Visible 0 0 005
- AVAILABLE 0 0 006 *
0925 Not Visible 0 0 025
0926 Not Visible 0 0 026
0927 Not Visible 0 0 027
0928 Not Visible 0 0 028
- AVAILABLE 0 0 029 *
0980 Not Visible 0 0 080
0981 Not Visible 0 0 081
0982 Not Visible 0 0 082
0983 Not Visible 0 0 083
- AVAILABLE 0 0 084 *