Subscribe

PowerShell, Get-NcSnapmirror does not return .SourceCluster or .DestinationCluster

[ Edited ]

Hi,

I'm working on a script where I among other things need to store information about a select few snapmirror relationships in an external file.

 

$relationsships = Get-NcSnapmirror works fine and $relationships | get-member indicates I should be able to see the source and destination clusters by

 

$relationships.SourceCluster and $relationships.DestinationCluster respectively. However, in my lab environment these return nothing.

 

Other pertinent information such as $relationships.SourceLocation and $relationships.SourceVolume (and their destination counterparts) works as expected.

 

If I also get the Vservers such as $svms = Get-NcVserver and do a 

$sourceCluster = $svms.NcController | Where-Object {$_.Vserver -eq $relationships.SourceLocation.split(":")[0]}

 

I get what I need but I'm still a bit puzzled why I can't this information from the Get-NcSnapmirror directly. What am I missing here?

Re: PowerShell, Get-NcSnapmirror does not return .SourceCluster or .DestinationCluster

Hello @ChannelTapeFibre,

 

This appears to be a limitation of ZAPI.  Looking at the docs for the "destination-cluster" and "source-cluster" properties returned by the API they have this description:

 

Specifies the destination cluster name for the SnapMirror relationship. The parameters for the name of the destination Vserver, and the name of the destination volume must also be specified if using this parameter. This parameter is available only on:

  • Data ONTAP 8.1 operating in Cluster-Mode.
  • Data ONTAP 8.2 or later operating in Cluster-Mode if the relationship control plane is 'v1'.

 

Why it has this behavior I have no idea...it does seem counterintuitive. Note that the second bullet says "8.2+ if the control plane is v1", my understanding is that this refers to the source being an 8.1 system (or earlier).  So, if both source and destination are 8.2+, then the v2 control is used and the fields are not populated.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.