Turn on suggestions
![]() Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
|
06-20-2018 07:11 AM
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
06-20-2018 07:31 AM
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....
06-20-2018 06:47 PM
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..
06-21-2018 12:19 AM
--->>>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.
06-21-2018 01:31 PM
I place everything into a spreadsheet then run a custom built macro.
06-26-2018 07:05 AM
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
06-26-2018 08:10 AM
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.
06-27-2018 03:18 PM
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