Brocade Fiber Channel Switch - CLI Zoning
Man, I hate Java. Absolutely hate it. Especially when you’re trying to connect to an old, outdated, and non-updated device like a Brocade 300 FC switch.
Sure, I could dig up whatever outdated Java install the switch is calling for, install it, troubleshoot for an hour why Firefox still won’t load the GUI, start drinking heavily, give up on life, and become a hermit. But that seems a little extreme just because of a switch. So instead, I’ll zone my switch through the CLI, which I haven’t done in YEARS. So lets get started!
In this case, I’m connecting three new ESXi hosts to an existing pair of FC switches, with a SAN and several hosts already setup. Start by connecting the hosts to your FC switch. In my case I have dual-port FC cards in the hosts and two FC switches, so I’m going to connect one port from each host to one switch. Make note of where you plug your hosts into, and where the SAN is connected. In my case it looks something like this:
In this case, our FC switches are not stacked/connected to ensure separate pathing, so we’ll need to configure each switch separately.
Once the new hosts are connected to the FC switches, SSH into the first switch as an admin user and run cfgshow to display the current zoning configuration.
brcdsw01:admin> cfgshow
Defined configuration:
cfg: Production
ESXi01_Zone; ESXi02_Zone;ESXi03_Zone; ESXi04_Zone
zone: ESXi01_Zone
SAN_0A; SAN_1A; ESXi01
zone: ESXi02_Zone
SAN_0A; SAN_1A; ESXi02
zone: ESXi03_Zone
SAN_0A;SAN_1A; ESXi03
zone: ESXi04_Zone
SAN_0A; SAN_1A; ESXi04
alias: SAN_0A
50:00:00:00:00:00:00:30; 50:00:00:00:00:00:00:30
alias: SAN_1A
50:00:00:00:00:00:00:38; 50:00:00:00:00:00:00:38
alias: ESXi01 10:00:00:00:00:00:00:d5; 20:00:00:00:00:00:00:d5
alias: ESXi02 10:00:00:00:00:00:00:5d; 20:00:00:00:00:00:00:5d
alias: ESXi03 10:00:00:00:00:00:00:00; 20:00:00:00:00:00:00:93
alias: ESXi04 10:00:00:00:00:00:00:46; 20:00:00:00:00:00:00:46
Effective configuration:
cfg: Production
zone: ESXi01_Zone
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
10:00:00:00:00:00:00:d5
20:00:00:00:00:00:00:d5
zone: ESXi02_Zone
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
10:00:00:00:00:00:00:5d
20:00:00:00:00:00:00:5d
zone: ESXi03_Zone
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
10:00:00:00:00:00:00:93
20:00:00:00:00:00:00:93
zone: ESXi04_Zone
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
10:00:00:00:00:00:00:46
20:00:00:00:00:00:00:46
Without going into too much detail, the above output tells us the current switch config has a Configuration Group called “Production”. That Group has four Zones: ESXi01_Zone; ESXi02_Zone;ESXi03_Zone; ESXi04_Zone. Each one of those Zones contains three aliases: one entry for the hosts and two entries for the SAN (Redundant SAN controllers, side A and side B). Each Alis has the discovered WWPNs for each attached system. To configure the switches for our new hosts, we’ll be working backwards, creating an alias for each hosts, then putting those aliases into zones, then updating and enabling our Configuration Group.
Run the command switchshow to see the port state and WWPN discovered on each port.
brcdsw01:admin> switchshow
switchName: brcdsw01
switchType: 71.2
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 20
switchId: fffc14
switchWwn: 10:00:00:05:33:2d:57:b4
zoning: ON (Production)
switchBeacon: OFF
HIF Mode: OFF
Index Port Address Media Speed State Proto
==================================================
0 0 140000 id N8 Online FC F-Port 50:00:00:00:00:00:00:30
1 1 140100 id N8 Online FC F-Port 50:00:00:00:00:00:00:38
2 2 140200 id N8 No_Light FC
3 3 140300 id N8 No_Light FC
4 4 140400 id N8 Online FC F-Port 21:00:00:00:00:00:00:4c
5 5 140500 id N8 Online FC F-Port 21:00:00:00:00:00:00:54
6 6 140600 id N8 Online FC F-Port 21:00:00:00:00:00:00:60
***Additional port config removed***
Ports 0 and 1 are the connections to the SAN, and ports 4, 5, & 6 connect to each of the new hosts.
Lets create the new aliases for each of the three new hosts:
brcdsw01:admin> alicreate "LabHost01", "21:00:00:00:00:00:00:4c"
brcdsw01:admin> alicreate "LabHost02", "21:00:00:00:00:00:00:54"
brcdsw01:admin> alicreate "LabHost03", "21:00:00:00:00:00:00:60"
We can rerun the cfgshow command to verify our aliases have been created:
brcdsw01:admin> cfgshow
Defined configuration:
*****************************************
alias: LabHost01
21:00:00:00:00:00:00:4c
alias: LabHost02
21:00:00:00:00:00:00:54
alias: LabHost03
21:00:00:00:00:00:00:60
Now we’ll need to create three new zones containing one host alias, and the two SAN aliases, again using cfgshow to verify our new Zones:
brcdsw01:admin> zonecreate "LabHost01_Zone", "LabHost01; SAN_0A; SAN_1A"
brcdsw01:admin> zonecreate "LabHost02_Zone", "LabHost02; SAN_0A; SAN_1A"
brcdsw01:admin> zonecreate "LabHost03_Zone", "LabHost03; SAN_0A; SAN_1A"
brcdsw01:admin> cfgshow
Defined configuration:
*****************************************
zone: LabHost01_Zone
LabHost01; SAN_0A; SAN_1A
zone: LabHost02_Zone
LabHost02; SAN_0A; SAN_1A
zone: LabHost03_Zone
LabHost03; SAN_0A; SAN_1A
***********************************************
alias: LabHost01
21:00:00:00:00:00:00:4c
alias: LabHost02
21:00:00:00:00:00:00:54
alias: LabHost02
21:00:00:00:00:00:00:60
Now we need to add the new zones to existing Configuration Group:
If you’re setting the zoning up from scratch, use the command cfgcreate.
brcdsw01:admin> cfgadd "Production", "LabHost01_Zone"
brcdsw01:admin> cfgadd "Production", "LabHost02_Zone"
brcdsw01:admin> cfgadd "Production", "LabHost03_Zone"
brcdsw01:admin> cfgshow
Defined configuration:
cfg: Production
ESXi01_Zone; ESXi02_Zone; ESXi03_Zone; ESXi04_Zone; LabHost01_Zone; LabHost02Zone; LabHost03Zone
If you don’t already have a Configuration Group, use the command:
cfgcreate “CONFIG_NAME”, “ZONE_NAME”
Now that we have updated out configuration, we finally need to save and commit the changes for them to become active. Use the commands cfgsave and cfgenable to save and commit the changes we have just made:
brcdsw01:admin> cfgsave
WARNING!!!
The changes you are attempting to save will render the
Effective configuration and the Defined configuration
inconsistent. The inconsistency will result in different
Effective Zoning configurations for switches in the fabric if
a zone merge or HA failover happens. To avoid inconsistency
it is recommended to commit the configurations using the
'cfgenable' command.
Do you want to proceed with saving the Defined
zoning configuration only? (yes, y, no, n): [no] yes
Updating flash ...
brcdsw01:admin> cfgenable "Production"
You are about to enable a new zoning configuration.
This action will replace the old zoning configuration with the
current configuration selected. If the update includes changes
to one or more traffic isolation zones, the update may result in
localized disruption to traffic on ports associated with
the traffic isolation zone changes
Do you want to enable 'Production' configuration (yes, y, no, n): [no] yes
zone config "Production" is in effect
Updating flash ...
If we take a look at cfgshow one last time, we’ll see the Effective Configuration now has our new zones:
brcdsw01:admin> cfgshow
****************************
Effective configuration:
cfg: Production
**************************
zone: LabHost01_Zone
21:00:00:00:00:00:00:4c
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
zone: LabHost02_Zone
21:00:00:00:00:00:00:54
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
zone: LabHost02_Zone
21:00:00:00:00:00:00:60
50:00:00:00:00:00:00:30
50:00:00:00:00:00:00:38
Now rinse and repeat for your second FC switch if necessary.
Once both switches are zoned, you can now configure your SAN to allow LUN access to your new hosts.