Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
Hi there!
Has anyone experience with creation of Snapmirror Relationsships in bulk, i talk about more than 50....
I think about to create a txt oder csv file where SourceVOL and DestVOL is entered and the cmdlet reads each row/column and create the relationship beetween the 2 Controllers.
Any ideas or sample script are welcome.
Thx
taner
Solved! See The Solution
Hi Taner,
DataOntap Toolkit has a cmdlet called Invoke-NaSnapmirrorInitialize which helps in creation of snapmirror relationship between source controller volume and destination controller volume.
To Get detailed information about the cmdlet you can run
Get-Help Invoke-NaSnapmirrorInitialize -Detailed
In order to scriptize the snapmirror relationship you can try something like below, create a csv file with entries as below specifying the destination/source volume and controller name.
DestinationController | DestinationVolumeName | SourceController | SourceVolumeName |
benson | benvol1 | dunn | dunvol1 |
benson | benvol2 | dunn | dunvol2 |
benson | benvol3 | dunn | dunvol3 |
benson | benvol4 | dunn | dunvol4 |
benson | benvol5 | dunn | dunvol5 |
benson | benvol6 | dunn | dunvol6 |
benson | benvol7 | dunn | dunvol7 |
benson | benvol8 | dunn | dunvol8 |
benson | benvol9 | dunn | dunvol9 |
benson | benvol10 | dunn | dunvol10 |
benson | benvol11 | dunn | dunvol11 |
benson | benvol12 | dunn | dunvol12 |
benson | benvol13 | dunn | dunvol13 |
Then through your powershell prompt, import the csv and feed it to Invoke-NaSnapmirrorInitialize to iterate though the csv and create snapmirror relationships for each destination and source volume
PS C:\> $snapinfo = Import-Csv C:\Users\vinith\Desktop\snapinfo.csv
PS C:\> $snapinfo | ForEach-Object {Invoke-NaSnapmirrorInitialize '$_.destinationcontroller:$_.destinationvolumename' '$_.sourcecontroller:$_.sourcevolumename' }
Hi Taner,
DataOntap Toolkit has a cmdlet called Invoke-NaSnapmirrorInitialize which helps in creation of snapmirror relationship between source controller volume and destination controller volume.
To Get detailed information about the cmdlet you can run
Get-Help Invoke-NaSnapmirrorInitialize -Detailed
In order to scriptize the snapmirror relationship you can try something like below, create a csv file with entries as below specifying the destination/source volume and controller name.
DestinationController | DestinationVolumeName | SourceController | SourceVolumeName |
benson | benvol1 | dunn | dunvol1 |
benson | benvol2 | dunn | dunvol2 |
benson | benvol3 | dunn | dunvol3 |
benson | benvol4 | dunn | dunvol4 |
benson | benvol5 | dunn | dunvol5 |
benson | benvol6 | dunn | dunvol6 |
benson | benvol7 | dunn | dunvol7 |
benson | benvol8 | dunn | dunvol8 |
benson | benvol9 | dunn | dunvol9 |
benson | benvol10 | dunn | dunvol10 |
benson | benvol11 | dunn | dunvol11 |
benson | benvol12 | dunn | dunvol12 |
benson | benvol13 | dunn | dunvol13 |
Then through your powershell prompt, import the csv and feed it to Invoke-NaSnapmirrorInitialize to iterate though the csv and create snapmirror relationships for each destination and source volume
PS C:\> $snapinfo = Import-Csv C:\Users\vinith\Desktop\snapinfo.csv
PS C:\> $snapinfo | ForEach-Object {Invoke-NaSnapmirrorInitialize '$_.destinationcontroller:$_.destinationvolumename' '$_.sourcecontroller:$_.sourcevolumename' }
HI Vinith!
Perfect and thank you ! thats what i Need!
br taner
Hi Vinith,
I am very new to Power Shell scripting aand would like to know in your example do the destination volume have to exist for this to work ?
If they do, what would the script look like to create the new destination volumes ?
Regards,
Richard