06-20-2018 07:11 AM
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
and so on.....
and son on....
06-20-2018 06:47 PM
@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 ....
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-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.