Skip to content
Virtual Storage Zone
Virtual Storage Zone

Primary Navigation Menu

Menu
  • Home
  • About Me
  • Business
  • Infrastructure
  • Podcast

perl

Mapping Cisco SAN Switch Ports to Zone Names

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 zoneRead More →

2014-04-14
By: Mark May
On: April 14, 2014
In: Networking

Quickly finding what port a WWN is associated with on a Cisco SAN

If you are like pretty much everyone I know who lives in the Storage World you seldom know what port on your SAN Fabric a WWN is connected with.  With Cisco you end up using device manager or fabric manager to try and find it – it works but I’m a command line kind of guy… So I end up logging into each switch in my fabric and doing the ole “show flogi database” routine..   If you’ve got a switch or two it’s not that painful, but when you grow beyond that it’s just plain annoying. I’m tired of doing that.  I’m tired of logging in to countless switches until I come across the correct switch.  I finally got annoyed enough to do something about it.  I decided to write a simple Perl script to automate the whole process. Check out the results below:   [box] cincystorage@symcliserver pub $ ./flogi_search.pl 51 192.168.1.50,fc3/21,50:00:09:72:08:3b:81:51 192.168.1.50,fc4/25,20:11:00:11:0a:00:4a:51 192.168.1.50,fc4/26,20:12:00:11:0a:00:4a:51 192.168.1.50,fc4/19,10:00:00:00:c9:88:7b:51 [/box]  Read More →

2013-10-23
By: Mark May
On: October 23, 2013
In: Networking

Reporting Symmetrix Tier Usage by Storage Group

Someone on the Symmetrix Support Forums on the EMC Community Network was asking for a way to report on Tier Usage by Storage Group. That’s pretty simple and easy to see with the following command: [box]symfast -sid xxxx list -demand –association[/box] However that is raw output and even if output is XML it’s just not that easy to parse into Excel.  So I decide to write a quick perl script to parse the output and turn it into a CSV.   It’s fairly simple,  but you do need to edit the script to specify the name of all your tiers. That is done on line 15. [box]my @tiers = (‘R5_SSD’, ‘R5_FC’, ‘R6_SATA’); [/box] Each tier just needs to be added as an element to the array.  Then you just run the perl script passing the SID of the array in question and you’ll get a CSV showing the Storage Group, Demand, Usage, and Growth like this: [box]SG,Read More →

2013-02-22
By: Mark May
On: February 22, 2013
In: Storage

Symmetrix Meta LUN reporting Perl script

This afternoon I was checking out my thin pool statistics when I noticed one of the pools had a significantly higher allocation usage than I was expecting.  I started digging into my documentation (I track every device created in a postgres database for tracking and trending) to see if a whole lot of devices we created over the weekend – and none were.  I started looking for an easy way to find bound luns that are not in a storage group – nothing!  I started to write my own shell script and the next thing you know I ended up with an inventory Perl script which tracks every meta device including lun id, thin pool, storage group, total thin allocation in Gb, and the FA ports they are bound to.   It’s simple enough to get with SMC but that is a lot of clicking.  So here it is! [box] ./inventory.pl lun_id,size,thin_pool,gb_alloc,%_alloc,gb_written,%_written,sg,FAs 11AA,200, 450gb_R5,97,49,95,48,StorageGroup,”FA-7F:0,FA-10F:0,FA-9F:0,FA-8F:0″ 2C2D,75, 2tb_R6,0,0,0,0,,””[/box] TheRead More →

2013-02-19
By: Mark May
On: February 19, 2013
In: Storage

Generating EMCOPY commands for celerra2isilon migration scripts

After seeing my Perl scripts for migrating from EMC Celerra to Isilon a few people have asked me how I moved my actually data from the source Celerra to my target Isilon. The answer is pretty simple: EMCOPY. EMCOPY is basically a fast version of robycopy used for moving data while maintain ACLs and permissions.. It’s CIFS/SMB centric and very easy to use. You run it from a windows machine with access to both shares and it copies data. I wrote a quick script to generate my EMCOPY commands based on my previous ones. Wanted to share that with everyone.     [box]Now it’s time for a short note and small disclaimer. This script works for me in my environment. Do your homework and make this work for you. While I have tried to make this robust and fully functional, it’s important to note “stuff happens”, this is still provides “as is” with no warranty whatsoever. UseRead More →

2013-02-12
By: Mark May
On: February 12, 2013
In: Storage

Migrating from EMC Celerra to Isilon with Perl

I’ve been working on a massive migration from an EMC Celerra to our new shiny Isilon. We’ve got a ton of file systems, CIFS, and NFS shares which I don’t want to re-create manually. “Work Smarter, Not Harder” is what Scrooge McDuck always said, right? So I created a few simple Perl scripts to export information from the Celerra Control Station and created a shell script to run on Isilon to migrate the directories and shares. I’ve only tested with with 6.5 – not sure of the change in syntax in 7.x. This doesn’t actually move the data or the permissions, as that is a whole different project. It simply parses a “nas_fs” query to make directories, create a hard quota to mimic sizes, and then created the NFS and SMB share. It’s a set of three scripts that can be run as needed. [box]Now it’s time for a short note and small disclaimer. This script worksRead More →

2013-02-08
By: Mark May
On: February 8, 2013
In: Storage

Creating Virtually Provisioned Thin Devices using Perl on the EMC VMAX

As a storage administrator one of most boring tasks I have to do is making and allocating new storages to hosts.  To me it’s the equivalent of creating a user.  Easy to do, but very boring.  If you know me at all, which you probably don’t, you know I hate boring.  For a lot of people it’s just a few right clicks in SMC/Unisphere and you’ve got yourself a new LUN.   For me it’s a quick SSH into a server with SYMCLI, a few edits to files, a few commands, and bam. I’d rather spend my time working on future planning, new architecture, or almost anything else. I finally had enough free time to write some Perl code which parses a simple text file to create new Meta devices on an EMC VMAX array. Actually creating a new Meta device is a fairly simple thing: First you create the thin devices, then you combine them all togetherRead More →

2013-01-29
By: Mark May
On: January 29, 2013
In: Storage

Recent Posts

  • Remote Offices shouldn’t be second class citizens
  • vBrownBag tackling VMworld (CTO Advisor #57)
  • Talking Intel Optane with James Myers (CTO Advisor #056)
  • Cloudified Snapshots done two ways
  • What the heck is tail latency anyways?

Copyright 2012-2016 Mark May. All Rights Reserved.