<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Powershell SnapMirror in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130624#M23642</link>
    <description>&lt;P&gt;There are quite some powershell commands for snapmirror written in WFA.&lt;/P&gt;&lt;P&gt;Try to use these commands by changing a little.&lt;/P&gt;&lt;P&gt;I have copied some of the powershell commands below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Remove SnapMirror&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Source Cluster")]&lt;BR /&gt;[string]$SourceCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster")]&lt;BR /&gt;[string]$DestinationCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Storage Virtual Machine")]&lt;BR /&gt;[string]$SourceVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Storage Virtual Machine")]&lt;BR /&gt;[string]$DestinationVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Volume")]&lt;BR /&gt;[string]$SourceVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Volume")]&lt;BR /&gt;[string]$DestinationVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster IP Address")]&lt;BR /&gt;[string]$DestinationClusterIP&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# connect to controller&lt;BR /&gt;Connect-WfaCluster $DestinationClusterIP&lt;/P&gt;&lt;P&gt;$vsm = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction Stop&lt;/P&gt;&lt;P&gt;if($vsm -and $vsm.Status -eq "transferring")&lt;BR /&gt;{&lt;BR /&gt;throw "Cannot remove relationship as it is currently transferring."&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Removing SnapMirror relationship between " + $SourceCluster + ":"+ $SourceVserver + "/"+ $SourceVolume + "and" + $DestinationCluster + ":"+ $DestinationVserver + "/"+ $DestinationVolume )&lt;BR /&gt;Remove-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -Confirm:$false -ErrorAction Stop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;2. Wait for SnapMirror initialization or resync&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Source Cluster")]&lt;BR /&gt;[string]$SourceCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster")]&lt;BR /&gt;[string]$DestinationCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Storage Virtual Machine")]&lt;BR /&gt;[string]$SourceVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Storage Virtual Machine")]&lt;BR /&gt;[string]$DestinationVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Volume")]&lt;BR /&gt;[string]$SourceVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Volume")]&lt;BR /&gt;[string]$DestinationVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Cluster IP")]&lt;BR /&gt;[string]$ClusterIP,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$false, HelpMessage="Approximate transfer size in MB. Used to calculate the percentage progress for SnapMirror relationships on Clustered ONTAP 8.2 or later.")]&lt;BR /&gt;[long]$TransferSize&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;function Wait-For-Initialization-V1&lt;BR /&gt;{&lt;BR /&gt;# Use query template so ONTAP will not have to return all the jobs, but only the relevant ones (unfortunately its not currently possible to filter by matching JobDescription)&lt;BR /&gt;$query = Get-NcJob -Template&lt;BR /&gt;$query.JobType = "Transfer-Initialize"&lt;BR /&gt;&lt;BR /&gt;# Get the latest job which initializes the vsm relationship&lt;BR /&gt;$job = Get-NcJob -Query $query | where {$_.JobDescription -eq "snapmirror initialize of destination " + $DestinationCluster + "://" + $DestinationVserver + "/" + $DestinationVolume } | Sort-Object -Descending -Property JobId | Select-Object -First 1&lt;BR /&gt;&lt;BR /&gt;if(!$job)&lt;BR /&gt;{&lt;BR /&gt;# No job was found, it could be that the job was purged or that no job was created&lt;BR /&gt;# because the vsm relationship is already in 'snapmirrored' state.&lt;BR /&gt;# Checking that the vsm relationship is in 'snapmirrored' state&lt;BR /&gt;$vsm = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction SilentlyContinue&lt;BR /&gt;&lt;BR /&gt;if(!$vsm)&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Cannot find the SnapMirror relationship. Failing the command.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "Cannot find the SnapMirror relationship"&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;if($vsm.MirrorState -ne "snapmirrored")&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;# Job is not found and relationship is not in 'snapmirrored' state..&lt;BR /&gt;# verify that the paramters passed to this command are matching the parameters&lt;BR /&gt;# supplied to the Create VSM command. if yes, then the initialization failed.&lt;BR /&gt;# if not, it means this command was executed with wrong parameter values and&lt;BR /&gt;# should be executed with the correct ones.&lt;BR /&gt;&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization job was not found and relationship is not in 'snapmirrored' state.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "SnapMirror initialization job was not found and relationship is not in 'snapmirrored' state."&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror relationship is already initialized.")&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note "SnapMirror initialization completed successfully."&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;if($job.JobState -eq "success")&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;&lt;BR /&gt;# Volume move already completed - mark it 100% completed&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;}&lt;BR /&gt;elseif($job.JobState -eq "running")&lt;BR /&gt;{&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 0 -Note $job.JobProgress&lt;BR /&gt;Get-WFALogger -Info -message $("Initialization job stauts - " + $job.JobProgress)&lt;BR /&gt;}&lt;BR /&gt;elseif($job.JobState -eq "failure" -and $job.JobCompletion.Contains("already initialized"))&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror relationship is already initialized.")&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;# Volume move already completed - mark it 100% completed&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization failed.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Wait for either SnapMirror initialize or resync to complete.&lt;BR /&gt;function Wait-For-Initialization-V2($relationship)&lt;BR /&gt;{&lt;BR /&gt;if ($relationship.IsHealthy -eq "true") {&lt;BR /&gt;if($relationship.MirrorState -eq "snapmirrored" -and $relationship.RelationshipStatus -eq 'idle' )&lt;BR /&gt;{&lt;BR /&gt;$bytesTransferredMessage = "Transferred " + $relationship.LastTransferSize + " bytes."&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync completed successfully. $bytesTransferredMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $bytesTransferredMessage&lt;BR /&gt;}&lt;BR /&gt;elseif (($relationship.MirrorState -eq 'uninitialized' -or $relationship.MirrorState -eq 'snapmirrored') -and&lt;BR /&gt;( $relationship.RelationshipStatus -eq 'transferring' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'quiescing' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'queued' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'preparing' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'finalizing'&lt;BR /&gt;))&lt;BR /&gt;{&lt;BR /&gt;$percentComplete = if ($TransferSize -and $relationship.RelationshipProgress -and $TransferSize -ne 0) {($relationship.RelationshipProgress*100)/($TransferSize*1024*1024)} else {0}&lt;BR /&gt;#&lt;BR /&gt;# Used size is only an approximation and sometimes we may have stale&lt;BR /&gt;# used size. So guard against the percentage going above 100.&lt;BR /&gt;#&lt;BR /&gt;if ($percentComplete -gt 99) {&lt;BR /&gt;$percentComplete = 99&lt;BR /&gt;}&lt;BR /&gt;$progressMessage = "Transferred " + $relationship.RelationshipProgress + " bytes so far."&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync in progress. $progressMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage $percentComplete -Note $progressMessage&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;$relationshipStateMessage = "Relationship state is '" + $relationship.MirrorState + "' (" + $relationship.RelationshipStatus + "). " + $relationship.LastTransferError&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync failed. $relationshipStateMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $relationshipStateMessage&lt;BR /&gt;throw "Failed to initialize or resync SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume + ". " + $relationshipStateMessage&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;$ErrorMessage = "SnapMirror is not healthy"&lt;BR /&gt;Get-WFALogger -Info -message $("$ErrorMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $ErrorMessage&lt;BR /&gt;throw "Failed to initialize or resync SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume + ". " + $ErrorMessage&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Handling SnapMirror initialization or resync for relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume )&lt;/P&gt;&lt;P&gt;# connect to controller&lt;BR /&gt;Connect-WfaCluster $ClusterIP&lt;BR /&gt;&lt;BR /&gt;# Retrieve the relationship to check if it is 8.1-style or 8.2-style&lt;BR /&gt;# relationship. This is indicated by the relationship control plane.&lt;BR /&gt;# For 8.1-style relationships (control plane V1), there is a job in ONTAP&lt;BR /&gt;# whose status we can check. For 8.2-style relationship (control plane V2),&lt;BR /&gt;# there is no job. We just wait for the relationship state to&lt;BR /&gt;# become 'snapmirrored'.&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;# Temporary workaround to handle an issue in snapmirror-get-iter API for SnapMirror relationships of infinite volume.&lt;BR /&gt;# Instead of sending all keys of a SnapMirror relationship (destination-cluster, destination-vserver, destination-volume, source-cluster, source-vserver, source-volume),&lt;BR /&gt;# one of the keys destination-volume will not be sent&lt;/P&gt;&lt;P&gt;$TargetVolume = Get-NcVol -Vserver $DestinationVserver -Name $DestinationVolume&lt;/P&gt;&lt;P&gt;if (!$TargetVolume)&lt;BR /&gt;{&lt;BR /&gt;throw "There is no destination volume with name " + $TargetVolume&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if($TargetVolume.IsInfiniteVolume)&lt;BR /&gt;{&lt;BR /&gt;$relationship = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -ErrorAction SilentlyContinue&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;$relationship = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction SilentlyContinue&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if(!$relationship)&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Cannot find the SnapMirror relationship. Failing the command.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "Failure"&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;#&lt;BR /&gt;# 8.1 cluster does not have RelationshipControlPlane field.&lt;BR /&gt;# If 8.1 cluster is upgraded to 8.2, RelationshipControlPlane for an&lt;BR /&gt;# existing relationships is V1 until the relationship is upgraded to&lt;BR /&gt;# SN-style relationship.&lt;BR /&gt;#&lt;BR /&gt;if(!$relationship.RelationshipControlPlane -or&lt;BR /&gt;$relationship.RelationshipControlPlane -eq "v1")&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Detected 8.1-style relationship. Relationship control plane: " + $relationship.RelationshipControlPlane)&lt;BR /&gt;Wait-For-Initialization-V1&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Detected 8.2-style relationship. Relationship control plane: " + $relationship.RelationshipControlPlane)&lt;BR /&gt;Wait-For-Initialization-V2 -relationship $relationship&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2017 11:22:06 GMT</pubDate>
    <dc:creator>abhit</dc:creator>
    <dc:date>2017-04-28T11:22:06Z</dc:date>
    <item>
      <title>Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130372#M23565</link>
      <description>&lt;P&gt;Hi, I have done a snapmirror between clusters, and feel fairly comfortable with the process, what i was wanting to know was how do i find out the status of a snapmirror in progress, how much data has been moved and how long the process has been running. I know via command line how to do it, but could anyone show me how to do it in powershell.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are currently on a fas8020 running 8.3.1. Any help most appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 15:10:07 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130372#M23565</guid>
      <dc:creator>fmg_netapp1</dc:creator>
      <dc:date>2025-06-04T15:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130373#M23566</link>
      <description>&lt;P&gt;Have you looked at the Get-NcSnapMirror cmdlet? &amp;nbsp;I believe that if you speciffy only one relationship it will return all of the attributes for that relationship. &amp;nbsp;I do not have a working lab to test that, but it should be quick to check. &amp;nbsp;The Get-NcSnapMirrorHistory may also have the information that you are looking for, but I am not sure if it will return it for a running update.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 16:28:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130373#M23566</guid>
      <dc:creator>geringer</dc:creator>
      <dc:date>2017-04-21T16:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130432#M23590</link>
      <description>&lt;P&gt;Hi Geringer, though the command is useful it doesnt provide the detail that i need. I can see how this command can be used to monitor mirror history of comms. I will definately be using this in the future in my toolkit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 20:35:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130432#M23590</guid>
      <dc:creator>fmg_netapp1</dc:creator>
      <dc:date>2017-04-24T20:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130438#M23593</link>
      <description>&lt;P&gt;I think something like this will work to return the amount of data transferred and time elapsed. &amp;nbsp;I don't have any active snapmirror relationships to test with, so I can't say for sure...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Get-NcSnapmirror -Query @{ RelationshipStatus = "transferring" } | Select-Object SourceLocation,DestinationLocation, `
    @{'N'='GB Transferred'; 'E'={ [Math]::Round($snapmirror.TotalTransferBytes / 1gb, 2) } }, `
    @{'N'='Min Elapsed'; 'E'={ [Math]::Round((New-TimeSpan -Seconds $snapmirror.TotalTransferTimeSecs).Minutes, 2) } }&lt;/PRE&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 21:18:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130438#M23593</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2017-04-24T21:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130446#M23598</link>
      <description>&lt;P&gt;Hi, Thanks for shwoing me this, it seems as if this could be it. I will set up some data to transfer and then gt back to you with some results. Many thanks again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 08:33:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130446#M23598</guid>
      <dc:creator>fmg_netapp1</dc:creator>
      <dc:date>2017-04-25T08:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130521#M23613</link>
      <description>&lt;P&gt;Hi, Just set another snapmirror to go now, and i can see the results via ssh.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the command above, in "&amp;nbsp;GB Transferred Min Elapsed" i just aget a 0 all the way down. There are names in "SourceLocation" and &amp;nbsp;"DestinationLocation" but nothing in the last column, also the snapmirror that i have set of cannot be seen anywhere in this command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what more to add really &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 14:17:20 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130521#M23613</guid>
      <dc:creator>fmg_netapp1</dc:creator>
      <dc:date>2017-04-26T14:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130624#M23642</link>
      <description>&lt;P&gt;There are quite some powershell commands for snapmirror written in WFA.&lt;/P&gt;&lt;P&gt;Try to use these commands by changing a little.&lt;/P&gt;&lt;P&gt;I have copied some of the powershell commands below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Remove SnapMirror&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Source Cluster")]&lt;BR /&gt;[string]$SourceCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster")]&lt;BR /&gt;[string]$DestinationCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Storage Virtual Machine")]&lt;BR /&gt;[string]$SourceVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Storage Virtual Machine")]&lt;BR /&gt;[string]$DestinationVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Volume")]&lt;BR /&gt;[string]$SourceVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Volume")]&lt;BR /&gt;[string]$DestinationVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster IP Address")]&lt;BR /&gt;[string]$DestinationClusterIP&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# connect to controller&lt;BR /&gt;Connect-WfaCluster $DestinationClusterIP&lt;/P&gt;&lt;P&gt;$vsm = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction Stop&lt;/P&gt;&lt;P&gt;if($vsm -and $vsm.Status -eq "transferring")&lt;BR /&gt;{&lt;BR /&gt;throw "Cannot remove relationship as it is currently transferring."&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Removing SnapMirror relationship between " + $SourceCluster + ":"+ $SourceVserver + "/"+ $SourceVolume + "and" + $DestinationCluster + ":"+ $DestinationVserver + "/"+ $DestinationVolume )&lt;BR /&gt;Remove-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -Confirm:$false -ErrorAction Stop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;2. Wait for SnapMirror initialization or resync&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Source Cluster")]&lt;BR /&gt;[string]$SourceCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Cluster")]&lt;BR /&gt;[string]$DestinationCluster,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Storage Virtual Machine")]&lt;BR /&gt;[string]$SourceVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Storage Virtual Machine")]&lt;BR /&gt;[string]$DestinationVserver,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Source Volume")]&lt;BR /&gt;[string]$SourceVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Destination Volume")]&lt;BR /&gt;[string]$DestinationVolume,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Cluster IP")]&lt;BR /&gt;[string]$ClusterIP,&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$false, HelpMessage="Approximate transfer size in MB. Used to calculate the percentage progress for SnapMirror relationships on Clustered ONTAP 8.2 or later.")]&lt;BR /&gt;[long]$TransferSize&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;function Wait-For-Initialization-V1&lt;BR /&gt;{&lt;BR /&gt;# Use query template so ONTAP will not have to return all the jobs, but only the relevant ones (unfortunately its not currently possible to filter by matching JobDescription)&lt;BR /&gt;$query = Get-NcJob -Template&lt;BR /&gt;$query.JobType = "Transfer-Initialize"&lt;BR /&gt;&lt;BR /&gt;# Get the latest job which initializes the vsm relationship&lt;BR /&gt;$job = Get-NcJob -Query $query | where {$_.JobDescription -eq "snapmirror initialize of destination " + $DestinationCluster + "://" + $DestinationVserver + "/" + $DestinationVolume } | Sort-Object -Descending -Property JobId | Select-Object -First 1&lt;BR /&gt;&lt;BR /&gt;if(!$job)&lt;BR /&gt;{&lt;BR /&gt;# No job was found, it could be that the job was purged or that no job was created&lt;BR /&gt;# because the vsm relationship is already in 'snapmirrored' state.&lt;BR /&gt;# Checking that the vsm relationship is in 'snapmirrored' state&lt;BR /&gt;$vsm = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction SilentlyContinue&lt;BR /&gt;&lt;BR /&gt;if(!$vsm)&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Cannot find the SnapMirror relationship. Failing the command.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "Cannot find the SnapMirror relationship"&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;if($vsm.MirrorState -ne "snapmirrored")&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;# Job is not found and relationship is not in 'snapmirrored' state..&lt;BR /&gt;# verify that the paramters passed to this command are matching the parameters&lt;BR /&gt;# supplied to the Create VSM command. if yes, then the initialization failed.&lt;BR /&gt;# if not, it means this command was executed with wrong parameter values and&lt;BR /&gt;# should be executed with the correct ones.&lt;BR /&gt;&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization job was not found and relationship is not in 'snapmirrored' state.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "SnapMirror initialization job was not found and relationship is not in 'snapmirrored' state."&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror relationship is already initialized.")&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note "SnapMirror initialization completed successfully."&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;if($job.JobState -eq "success")&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;&lt;BR /&gt;# Volume move already completed - mark it 100% completed&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;}&lt;BR /&gt;elseif($job.JobState -eq "running")&lt;BR /&gt;{&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 0 -Note $job.JobProgress&lt;BR /&gt;Get-WFALogger -Info -message $("Initialization job stauts - " + $job.JobProgress)&lt;BR /&gt;}&lt;BR /&gt;elseif($job.JobState -eq "failure" -and $job.JobCompletion.Contains("already initialized"))&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror relationship is already initialized.")&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization completed successfully.")&lt;BR /&gt;# Volume move already completed - mark it 100% completed&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization failed.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $job.JobProgress&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Wait for either SnapMirror initialize or resync to complete.&lt;BR /&gt;function Wait-For-Initialization-V2($relationship)&lt;BR /&gt;{&lt;BR /&gt;if ($relationship.IsHealthy -eq "true") {&lt;BR /&gt;if($relationship.MirrorState -eq "snapmirrored" -and $relationship.RelationshipStatus -eq 'idle' )&lt;BR /&gt;{&lt;BR /&gt;$bytesTransferredMessage = "Transferred " + $relationship.LastTransferSize + " bytes."&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync completed successfully. $bytesTransferredMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 1 -ProgressPercentage 100 -Note $bytesTransferredMessage&lt;BR /&gt;}&lt;BR /&gt;elseif (($relationship.MirrorState -eq 'uninitialized' -or $relationship.MirrorState -eq 'snapmirrored') -and&lt;BR /&gt;( $relationship.RelationshipStatus -eq 'transferring' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'quiescing' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'queued' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'preparing' -or&lt;BR /&gt;$relationship.RelationshipStatus -eq 'finalizing'&lt;BR /&gt;))&lt;BR /&gt;{&lt;BR /&gt;$percentComplete = if ($TransferSize -and $relationship.RelationshipProgress -and $TransferSize -ne 0) {($relationship.RelationshipProgress*100)/($TransferSize*1024*1024)} else {0}&lt;BR /&gt;#&lt;BR /&gt;# Used size is only an approximation and sometimes we may have stale&lt;BR /&gt;# used size. So guard against the percentage going above 100.&lt;BR /&gt;#&lt;BR /&gt;if ($percentComplete -gt 99) {&lt;BR /&gt;$percentComplete = 99&lt;BR /&gt;}&lt;BR /&gt;$progressMessage = "Transferred " + $relationship.RelationshipProgress + " bytes so far."&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync in progress. $progressMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage $percentComplete -Note $progressMessage&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;$relationshipStateMessage = "Relationship state is '" + $relationship.MirrorState + "' (" + $relationship.RelationshipStatus + "). " + $relationship.LastTransferError&lt;BR /&gt;Get-WFALogger -Info -message $("SnapMirror initialization or resync failed. $relationshipStateMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $relationshipStateMessage&lt;BR /&gt;throw "Failed to initialize or resync SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume + ". " + $relationshipStateMessage&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;$ErrorMessage = "SnapMirror is not healthy"&lt;BR /&gt;Get-WFALogger -Info -message $("$ErrorMessage")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note $ErrorMessage&lt;BR /&gt;throw "Failed to initialize or resync SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume + ". " + $ErrorMessage&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Handling SnapMirror initialization or resync for relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume )&lt;/P&gt;&lt;P&gt;# connect to controller&lt;BR /&gt;Connect-WfaCluster $ClusterIP&lt;BR /&gt;&lt;BR /&gt;# Retrieve the relationship to check if it is 8.1-style or 8.2-style&lt;BR /&gt;# relationship. This is indicated by the relationship control plane.&lt;BR /&gt;# For 8.1-style relationships (control plane V1), there is a job in ONTAP&lt;BR /&gt;# whose status we can check. For 8.2-style relationship (control plane V2),&lt;BR /&gt;# there is no job. We just wait for the relationship state to&lt;BR /&gt;# become 'snapmirrored'.&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;# Temporary workaround to handle an issue in snapmirror-get-iter API for SnapMirror relationships of infinite volume.&lt;BR /&gt;# Instead of sending all keys of a SnapMirror relationship (destination-cluster, destination-vserver, destination-volume, source-cluster, source-vserver, source-volume),&lt;BR /&gt;# one of the keys destination-volume will not be sent&lt;/P&gt;&lt;P&gt;$TargetVolume = Get-NcVol -Vserver $DestinationVserver -Name $DestinationVolume&lt;/P&gt;&lt;P&gt;if (!$TargetVolume)&lt;BR /&gt;{&lt;BR /&gt;throw "There is no destination volume with name " + $TargetVolume&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if($TargetVolume.IsInfiniteVolume)&lt;BR /&gt;{&lt;BR /&gt;$relationship = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -ErrorAction SilentlyContinue&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;$relationship = Get-NcSnapmirror -SourceCluster $SourceCluster -DestinationCluster $DestinationCluster -SourceVserver $SourceVserver -DestinationVserver $DestinationVserver -SourceVolume $SourceVolume -DestinationVolume $DestinationVolume -ErrorAction SilentlyContinue&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if(!$relationship)&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Cannot find the SnapMirror relationship. Failing the command.")&lt;BR /&gt;Set-WfaCommandProgress -Total 1 -Current 0 -ProgressPercentage 100 -Note "Failure"&lt;BR /&gt;throw "Failed to initialize SnapMirror relationship between " + $SourceCluster + "://"+ $SourceVserver + "/"+ $SourceVolume + " and " + $DestinationCluster + "://"+ $DestinationVserver + "/"+ $DestinationVolume&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;#&lt;BR /&gt;# 8.1 cluster does not have RelationshipControlPlane field.&lt;BR /&gt;# If 8.1 cluster is upgraded to 8.2, RelationshipControlPlane for an&lt;BR /&gt;# existing relationships is V1 until the relationship is upgraded to&lt;BR /&gt;# SN-style relationship.&lt;BR /&gt;#&lt;BR /&gt;if(!$relationship.RelationshipControlPlane -or&lt;BR /&gt;$relationship.RelationshipControlPlane -eq "v1")&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Detected 8.1-style relationship. Relationship control plane: " + $relationship.RelationshipControlPlane)&lt;BR /&gt;Wait-For-Initialization-V1&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Get-WFALogger -Info -message $("Detected 8.2-style relationship. Relationship control plane: " + $relationship.RelationshipControlPlane)&lt;BR /&gt;Wait-For-Initialization-V2 -relationship $relationship&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:22:06 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130624#M23642</guid>
      <dc:creator>abhit</dc:creator>
      <dc:date>2017-04-28T11:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell SnapMirror</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130625#M23643</link>
      <description>&lt;P&gt;You may want to look into the featured post for snapmirror auditlog parser:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/PowerShell-SnapMirror-Audit-Log-Parser-for-CDOT/m-p/130304#M5358" target="_blank"&gt;https://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/PowerShell-SnapMirror-Audit-Log-Parser-for-CDOT/m-p/130304#M5358&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does a lot more than what you posted, but you can either take from that script what you need, or you'll find that it is even better than what you wanted :).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Xander&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:31:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Powershell-SnapMirror/m-p/130625#M23643</guid>
      <dc:creator>xandervanegmond</dc:creator>
      <dc:date>2017-04-28T11:31:35Z</dc:date>
    </item>
  </channel>
</rss>

