Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
Hi guys,
Just trying to use Get-NcSnapmirror on multiple controllers. i tried
$nc1 = connect-NcController -name xxx ...
$nc2 = connect-NcController -name yyy ...
When i try "Get-NcSnapmirror -Controller $nc2" i get incorrect credentials. and without -Controllers it works but i must use it because i script resync svm-dr so i need to connect to both controllers in the same script.
Thanks
Solved! See The Solution
Hi Daniel_Maryuma,
I was able to replicate the issue, which indeed is due to the stored credentials only being active in memory for a single controller at a time. The solution for this would be to set a credential variable for each controller and specify the credential variable in the connect variable.
See the example below that I tested in our lab system using PSTK 9.8:
PS LAB> $creds_nc1 = Get-Credential -message 'Please provide password for nc1'
PS LAB> $creds_nc2 = Get-Credential -message 'Please provide password for nc2'
PS LAB> $nc1 = Connect-NcController lab-cluster1 -Credential $creds_nc1
PS LAB> $nc2 = Connect-NcController lab-cluster2 -Credential $creds_nc2
PS LAB> get-ncsnapmirror -controller $nc1
SourceLocation DestinationLocation Status MirrorState
-------------- ------------------- ------ -----------
lab-cluster1://labsvm1/labsvm1_vol1_src lab-cluster2://labsvm1/labsvm1_vol1_dest idle snapmirrored
PS LAB> get-ncsnapmirror -controller $nc2
SourceLocation DestinationLocation Status MirrorState
-------------- ------------------- ------ -----------
lab-cluster2://labsvm1/labsvm1_vol1_src lab-cluster1://labsvm1/labsvm1_vol1_dest idle snapmirrored
PS LAB>
Regards,
Team Netapp
What version of PowerShell and the PSTK are you using? I'm not able to replicate the issue on the couple of different machines I tried it on, running PSTK 9.8.0 and PowerShell 5.1.
Hi Daniel_Maryuma,
I was able to replicate the issue, which indeed is due to the stored credentials only being active in memory for a single controller at a time. The solution for this would be to set a credential variable for each controller and specify the credential variable in the connect variable.
See the example below that I tested in our lab system using PSTK 9.8:
PS LAB> $creds_nc1 = Get-Credential -message 'Please provide password for nc1'
PS LAB> $creds_nc2 = Get-Credential -message 'Please provide password for nc2'
PS LAB> $nc1 = Connect-NcController lab-cluster1 -Credential $creds_nc1
PS LAB> $nc2 = Connect-NcController lab-cluster2 -Credential $creds_nc2
PS LAB> get-ncsnapmirror -controller $nc1
SourceLocation DestinationLocation Status MirrorState
-------------- ------------------- ------ -----------
lab-cluster1://labsvm1/labsvm1_vol1_src lab-cluster2://labsvm1/labsvm1_vol1_dest idle snapmirrored
PS LAB> get-ncsnapmirror -controller $nc2
SourceLocation DestinationLocation Status MirrorState
-------------- ------------------- ------ -----------
lab-cluster2://labsvm1/labsvm1_vol1_src lab-cluster1://labsvm1/labsvm1_vol1_dest idle snapmirrored
PS LAB>
Regards,
Team Netapp