ONTAP Discussions

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

Northman
1,547 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
1,517 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
1,518 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
1,480 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
1,474 Views

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

Northman
89 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