E-Series, SANtricity and Related Plug-ins Articles and Resources

How to Get ARVM Member Volumes



The SANtricity PowerShell toolkit included with the NetApp PowerShell toolkit version 4.1 does not properly find member volumes in an asynchronous mirror group.  Specifically, the Get-NeAsyncMirrorGroupPairs cmdlet is not functioning correctly.  This article provides steps to correct this until the next release of the NetApp PowerShell Toolkit.  


Step 1:

The first step is to find the location of the SANtricity module.  By default, the SANtricity PowerShell toolkit is installed in C:\Program Files (x86)\NetApp\NetApp PowerShell Toolkit\Modules\NetApp.SANtricity.PowerShell.  The name of the file to find is NetApp.SANtricity.Functions.psm1.  If you are not sure where the module is installed or simply want to confirm a default installation, then run the following commands from a PowerShell session.  Make sure PowerShell is launched as an Administrator.


PS> (Get-Module -ListAvailable -Name NetApp.SANtricity.PowerShell).ModuleBase
C:\Program Files (x86)\NetApp\NetApp PowerShell Toolkit\Modules\NetApp.SANtricity.PowerShell


With Windows Explorer, navigate to the directory where the SANtricity PowerShell module is installed.  


Step 2:

The next step is to update the file called NetApp.SANtricity.Functions.psm1.  With your editor of choice, add the following function to the end of NetApp.SANtricity.Functions.psm1.  Start by making a backup copy of this file.  Again, ensure the editor is launched with Administrator privilege.

This function returns asynchronous mirror pair volumes.

An asynchronous mirror pair is an association between two volumes. The volumes are located on
different storage arrays and linked together through an asynchronous mirror group (AMG). An
AMG can have many volumes participating in the same AMG. This cmdlet displays the volumes
in this AMG

.PARAMETER Credential
A Netapp.PowerShell.Credential.NeCredential object. Typically instantiated with Get-NeProxySystemCredential.

The Id of the AMG to query for participating volumes.

function Get-NeAsyncMirrorGroupPairs()
param( [string] $SystemId, [Netapp.PowerShell.Credential.NeCredential] $Credential, [string]$MirrorId)
$module = Get-Module -Name NetApp.SANtricity.PowerShell
$modulePath = $module.ModuleBase
$url = $Credential.Url
$endpoint = "v2/storage-systems/$SystemId/async-mirrors/$MirrorId/pairs"
$user = $Credential.Credential.UserName
$assemblyPath = Join-Path -Path $modulePath -Child "NetApp.SANtricity.PowerShell.dll"
[Reflection.Assembly]::LoadFile($assemblyPath) | Out-Null
$client = New-Object Netapp.Santricity.RestClient.WebService -ArgumentList @(,$url)
$loginResult = $client.Login($user, $([Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR( $cred.Credential.Password ))))
$result = $client.Get($endpoint)

Save the file and exit the editor.


Step 3:

The final step is to reload the module to pick up the changes.  The existing module file is signed by NetApp.  When PowerShell detects the edit, it will not load the module.  In the PowerShell window, change the execution policy to RemoteSigned.  

PS> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Please do not change the execution policy if you do not understand the ramifications of making this change.  The execution policy only needs to be changed until the next release of the NetApp PowerShell Toolkit.  If you work behind a firewall and do not use PowerShell scripts from untrusted sources, then this is a perfectly safe change.


Now you can open a new PowerShell window or new instance of the PowerShell Integrated Scripting Environment.  You can now exercise Get-NeAsyncMirrorGroupPairs by using the pre-defined function instead of the cmdlet bundled in the assembly.

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums