NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Discussions

Snapmirror using powershell with a input-file (ONTAP 9)

Northman
3,449 Views

Is this possible with ONTAP 9? I know it is certainly possible with for example Windows scripting. I would appreciate a clue to where to look to get information how to set this up. We need to setup hundreds of volumes with Snapmirror and this would save us a lot of typing . Alternatively, we will copy and paste ONTAP commands.

1 ACCEPTED SOLUTION

ansley_tj
3,419 Views

Yes, you can use the powershell foreach loop to iterate through a comma delimited file and assign the line items to variables and send those to the powershell netapp tools commands. snapmirror commands to be run on the appropriate endpoints (usually the DR destination) for each relationship.

 

 

foreach ($<item> in $<collection>) {<statement list>}

 

Thanks
Tony Ansley
I am a NetApp employee.

View solution in original post

4 REPLIES 4

ansley_tj
3,420 Views

Yes, you can use the powershell foreach loop to iterate through a comma delimited file and assign the line items to variables and send those to the powershell netapp tools commands. snapmirror commands to be run on the appropriate endpoints (usually the DR destination) for each relationship.

 

 

foreach ($<item> in $<collection>) {<statement list>}

 

Thanks
Tony Ansley
I am a NetApp employee.

Northman
3,382 Views

Thanks, I have found some scripts I can use, just need some more details for the best command to use. Do you know if I have to pre-create all volumes on the destination vserver with sizes as ? When running the command New-NcSnapmirror. Or is there another command that is like the ONTAP command, snapmirror initialize? This command does everything for you.

Northman
3,376 Views

Actually, there seems to have been a cmdlet calle "Initialize-NcSnapMirror", but it is not in the latest module.

Northman
1,991 Views

Does anyone have a script that works for ONTAP 9.14+ ? I have spent a lot of time trying to setup snapmirror between two SVMs in two different clusters with  "NewNcSnapmirror" command and a Excel input file. Maybe it is simply not possible and I have to use a .csv file??  I am using the Excel module ImportExcel (7.8.5)

Public