Renaming NetApp SnapMirror Destinations

We have a collection of NetApp devices hosting a large number of volumes, and utilise SnapMirrors extensively for backup and DR, as well as moving information between departments

As the storage has grown, and different people have added new volumes, new SnapMirrors have been created, with a wide variety of naming formats to match the mood of the creator on that particular day. This makes managing volumes, when you are not exactly sure what they do, a little challenging.

A standard for the naming of these volumes was decided on, and all new SnapMirror destinations must be in the format of the original volume name with _SnapMirror appended to the end. This is similar to what the OnCommand System centre uses, just without the date.

Whilst this was all good for new volumes, the 200 existing volumes and mirrors would likely not be changed for a long time. So, I set about looking for a way to update all of our SnapMirror destinations. With there being a lot of volumes, scripting was the only way to be looking at this.

So, here is a module containing two functions. The first, Get-NonStandardSnapMirrorNames looks through all of the specified NetApp Filers for SnapMirrors do not fall into the format specified. The second function, Repair-NonStandardSnapMirrorNames, runs through a procedure which can correct them.

I have been good and even included PowerShell help inside the function, so once you have imported the module you can run Get-Help with the relevant function in order to find out the exact syntax.

If you use this and have some suggestions on how it could be improved then please let me know. I am relatively new to NetApp storage devices and still working out some of the peculiarities. There are probably a number of ways that this could be improved, but it worked well for me in the environment that I have,

You will need to have the DataOnTap PowerShell kit available from NetApp to use this script, as everything is performed using the PowerShell commands rather than using any SSH sessions.

So, here it is. Copy into your favourite editor, save, import to PowerShell and off you go.

Be the first to like.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.