For more details, please see ourCookie Policy.


Fibre Channel (SAN)

Reply
New Contributor
Posts: 2
Registered: ‎02-06-2017

Remove hanging zones

Hello All,

 

 I have taken over a very neglected SAN and am working on cleaning it up. There are a few thousand hanging zones that I would like to delete. Is there an automated way to do this? The manual process will take much more time than I'd like to spend.

 

Thank you in advance

External Moderator
Posts: 5,363
Registered: ‎02-23-2004

Re: Remove hanging zones

@JMORRIS999!

 

there is no any automated methode or command, but you need to create a simple script with Notepad++

 

copy the output from cfgshow and create a script like this here, with all alias and zone you want to remove

 

EXAMPLE:

 

alidelete "Netapp07_0C","50:0a:09:83:88:03:e4:ed"
alidelete "Netapp07_1A","50:0a:09:81:88:03:e4:ed"

and so on.....


zonedelete "Netapp1_0B_sql08r2dmz1_hba0","50:0a:09:83:97:39:a8:71;21:00:00:1b:32:1a:f4:4c"
zonedelete "Netapp1_0D_sql08r2dmz1_hba0","50:0a:09:81:97:39:a8:71;21:00:00:1b:32:1a:f4:4c"

and son on....

 

 

TechHelp24
Frequent Contributor
Posts: 84
Registered: ‎04-04-2018

Re: Remove hanging zones

Hello all,

 

@Antonio Bongiorno TechHelp24 Is there any reason to use wwns with delete command ? As i know you should use wwns with alias/zone in case you would liek to remove/add member into it..

Please mark this response as "Accept as Solution" if it answers your question.

Marian Bezeg
External Moderator
Posts: 5,363
Registered: ‎02-23-2004

Re: Remove hanging zones

@Marian Bezeg

 

--->>>Is there any reason ....

 

NO!

 

as in my answer, this is just a "EXAMPLE" and I've my own methods.

 

but if you have another solution you are welcome to post here.

TechHelp24
Contributor
Posts: 45
Registered: ‎03-20-2018

Re: Remove hanging zones

I place everything into a spreadsheet then run a custom built macro.

New Contributor
Posts: 2
Registered: ‎02-06-2017

Re: Remove hanging zones

Thanks for the reply, I assumed there was no easy way to accomplish my task. I have manually deleted over 4000 zones.

 

Good times.

 

 

 

Thanks again

 

Broadcom
Posts: 18
Registered: ‎01-31-2012

Re: Remove hanging zones

I didn't catch this earlier. My suggestion would have been to use pyfos to walk through all the zones, compare the WWN in the NS database & delete those zones without appropriate references to online WWNs. I don't have a specific script to do this but there is a script call device_find.py in pyfos under pyfos/pyfos/utils/misc directory. The script takes a wwn and 1) check to see if it is connected to the local switch, 2) check to see if it shows up on NS, 3) walks through zone database to show if the device shows up in zone(s) and if the zone is in effective configuration. It is not exactly a copy/paste but I think you can borrow some of the logics to walk through the zones & compare WWNs in the NS.

Highlighted
Broadcom
Posts: 18
Registered: ‎01-31-2012

Re: Remove hanging zones

I know that it is bit late for the original request but I just uploaded a script that

 

1) displays zones that doesn't have any online devices as members

2) if given "YES" interactively, zones are deleted & cfg saved.

 

for other folks looking for similar automation use cases. I guess it could be used to see if all are indeed removed for the original request.

 

the script is simple in a sense that it just looks at the current state of things. It doesn't account for devices that might be misbehaving and toggling up and down, for example.

 

Anyhow, please check it out if interested.

 

https://github.com/brocade/pyfos-contrib

 

and checkout

 

ZoningHangingZoneCleanup

 

 

 

 

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.