Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
PowerShell Toolkit 9.12.1 - Issue with Invoke-NcSnapMirrorUpdate (wrong snapmirror updated)
2023-04-19
01:48 AM
1,704 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a PowerShell script that worked with the PSTK version 9.8 but I am unable to get working with 9.12.1. It appears that I am unable to properly call the Invoke-NcSnapMirror* commands.
In the code, I retrieve a list of all snapmirrors on two FAS systems and present the user with a grid to select one to work on.
After selection, I validate the snapmirror select and I am able to call Get-NcSnapMirror using the retrieved selection data to see the status of the snapmirror.
But when I use the same variables to perform any Invoke-NcSnapmirror command, it works on the wrong snapmirror.
I added -ONTAPI to the command and it works correctly.
Here is the relevant code that does not work:
Wr G "3) Get SnapMirror List and select replications to reverse..."; ""
$SML = Get-NcSnapMirror -Controller $apfas -ErrorAction stop| select SourceVserver, DestinationVserver, Status, IsHealthy, TransferSchedule, SourceLocation, DestinationLocation, MirrorState, NcController, Policy, PolicyType, Vserver | sort SourceLocation
$SML += Get-NcSnapMirror -Controller $fpfas -ErrorAction stop| select SourceVserver, DestinationVserver, Status, IsHealthy, TransferSchedule, SourceLocation, DestinationLocation, MirrorState, NcController, Policy, PolicyType, Vserver | sort SourceLocation
$GridArguments = @{
OutputMode = 'Single'
Title = 'Please select a SnapMirror replication to revserse and click OK'
}
$SnapMirror = $SML | Out-GridView @GridArguments
if ( $SnapMirror -ne $null ) {
Wr G "SnapMirror Selected:"
$SnapMirror | Format-List
if ( $SnapMirror.NcController.Name -eq $fpfas.Name) {
$DstCtrl = $fpfas
$SrcCtrl = $apfas
} else {
$DstCtrl = $apfas
$SrcCtrl = $fpfas
}
$DstLoc = $SnapMirror.DestinationLocation
if ( $DstLoc -eq $null ) { Write-Error 'Destination Location Not Found' -ErrorAction Stop}
$Schedule = $SnapMirror.TransferSchedule
#$DstSVM, $DstVol = $DstLoc -Split ":"
$SrcLoc = $SnapMirror.SourceLocation
if ( $SrcLoc -eq $null ) { Write-Error 'Source Location Not Found' -ErrorAction Stop}
#$SrcSVM, $SrcVol = $SrcLoc -split ":"
Wr G "";Wr G "Get Status of SnapMirror Selected:"
Get-NcSnapMirror -Controller $DstCtrl -Destination $DstLoc | Format-List -Property *
Invoke-NcSnapMirrorUpdate -Controller $DstCtrl -Destination $DstLoc -Source $SrcLoc -ErrorAction stop
To make the code work, I simply change the last command by adding "-ONTAPI" to it.
Am I doing something wrong with RESTAPI?
Solved! See The Solution
1 ACCEPTED SOLUTION
Drew_C has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello MRoney,
Thank you for bringing this issue to our attention. We have been able to replicate it on our end and we assure you that we will be addressing it promptly. Rest assured that we will have it fixed in the upcoming release version 9.13.
1 REPLY 1
Drew_C has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello MRoney,
Thank you for bringing this issue to our attention. We have been able to replicate it on our end and we assure you that we will be addressing it promptly. Rest assured that we will have it fixed in the upcoming release version 9.13.
