SAN Aliases for WWNs from Zonesets: Voting

howto Add comments

I had a problem:

1) the switch I’m looking at has no aliases/nicknames for WWNs
2) the zonesets include names, but no ordering
3) produce tuples of {WWN, alias} with no dupe WWNs or aliases with most likely pairs

The input looks like:

Active Zoneset:
  Zone: FAB12SW33_ORAC4_HBA0_0899_FA_4CA
    ZoneMember: 10:00:00:00:C9:7D:B5:04
    ZoneMember: 50:06:04:8A:D5:31:AC:23
  Zone: FAB12SW33_ORAC4_HBA1_0899_FA_4CA
    ZoneMember: 50:06:04:8A:D5:31:AC:23
    ZoneMember: 10:00:00:00:C9:7D:B5:05
  Zone: FAB12SW33_ORAC4_HBA1_0899_FA_13DB
    ZoneMember: 10:00:00:00:C9:7D:B5:05
    ZoneMember: 50:06:04:8A:D5:31:AC:27
  Zone: FAB12SW33_ORAC4_HBA1_0899_FA_14DB
    ZoneMember: 10:00:00:00:C9:7D:B5:05
    ZoneMember: 50:06:04:8A:D5:31:AC:27
    ZoneMember: 10:00:00:00:C9:7D:B5:04

The intended output would be like:

10:00:00:00:C9:7D:B5:04, ORAC4_HBA0
10:00:00:00:C9:7D:B5:05, ORAC4_HBA1
50:06:04:8A:D5:31:AC:23, 0899_FA_4CA
50:06:04:8A:D5:31:AC:27, 0899_FA_13DB

You can see how the Zone has to be chopped up, and the ZoneMember items are not ordered… but because you can see slight correlation between groups with more of a WWN and its Alias, I chose a voting algorithm:

1) the first pass simply cleans things up, chops out the Active Zoneset
2) second pass tries to order the Zone name, normalize the format
3) third pass breaks apart the Zone name and produces a weighted-vote:

3a) the weight of a set is 100, so if there are three WWNs, each gets 33; two WWNs, 50 each
3b) each aliases gets a weighted vote from each WWN
3c) vote/ballot totals are tallied in a { WWN, alias } == total_votes format
4) fourth pass orders the tuples by highest votes first
5) fifth pass removes dupes and outputs the tuples with the highest vite where the WWN and alias have not been seem before

The result, unfortunately, was only 500 aliases, and took 4 hours of work; it’s completed in awk. I’m sure someone will do this in perl, or Java, but awk was my portable tool. I should be able to throw zonesets form all fabrics at this same tool from i10k switches in the future.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in