This morning I found myself needing to know what server was attached to each and every port on a large Cisco SAN Fabric. This can be quite the effort if you don’t have excellent documentation. You can query the fabric login (flogi) database, but that will map a fiber channel port to a wwn. That’s a start, but unless you have a map of wwn to server, it’s largely ineffective at proving human consumable information.
mds9513# show flogi database
--------------------------------------------------------------------------------
INTERFACE VSAN FCID PORT NAME NODE NAME
--------------------------------------------------------------------------------
fc1/1 301 0x8a00b0 50:00:09:72:08:3a:81:a7 50:00:09:72:06:3a:80:02
fc1/2 301 0x8a00cb 50:00:14:31:90:6a:79:12 50:00:14:40:45:32:6a:75
fc1/3 301 0x8a00ca 50:00:14:31:90:6a:54:12 50:00:14:40:45:32:6a:54
fc1/6 301 0x8a00cd 50:00:14:31:80:6a:54:02 50:00:14:40:45:22:6a:54
fc1/12 501 0xa50001 50:00:09:72:08:3a:61:e4 50:00:09:72:06:3a:82:00
If you want to see which zones map to the wwpn, you can use the “show zone member <wwn>” command to see a list of all zones associated with the specified wwn:
mds9513# show zone member pwwn 10:00:00:00:c7:ca:3b:b8
pwwn 10:00:00:00:c7:ca:3b:b8 vsan 95
zone VMAX_TESTSERVER_HBA0_7b0
zone VMAX_TESTSERVER_HBA0_8b0
If you have a standard zone name convention, you can extract the name of the server. This works great if you only need to know about a single wwn, but what if you need to map an entire switch? As you can imagine, it’s going to take a lot of someone’s time. I’m a huge fan of a lesson learned from Scrooge McDuck.
So I wrote a quick Perl script to automate this whole process and return a nice CSV file for my use. This has saved me a ton of work. You could actually expand it to parse the zone name, but that will be specific to your environment.
testserver$ ./map_flogi.pl 192.168.1.101
192.168.1.101,fc1/1,21:04:0b:00:00:c3:0f:00,VMAX_TESTSERVER4_8f0
192.168.1.101,fc1/2,21:04:0b:00:00:c3:bb:bc,VMAX_TESTSERVER8_7f0
192.168.1.101,fc1/3,21:04:0b:00:00:c3:ab:34,VMAX_TESTSERVER3_6f0
192.168.1.101,fc1/4,21:04:0b:00:00:c3:2c:ad,VMAX_TESTSERVER9_9f0
I’m actually using this information to generate information for created device aliases, port descriptions, and the like. In order to effectively do this, you will need to setup an SSH key on your Cisco switch to allow you to login without a password. Google has plenty of information on that.
[box type=”download”] Cisco SAN Flogi Mapper[/box]
Comments are closed, but trackbacks and pingbacks are open.