Microsoft Virtualization Discussions

Snapmirror break script

SAULBADGUY

Hello all -

We are working on using Snapmirror to facilitate a multi-site windows failover cluster. We are running in to one small issue though - when we invoke the snapmirror break command, it asks us to confirm that we "really" want to do this. This sort of takes the "automatic" part out of it...

Here is the script:

#import netapp module

Import-Module dataONTAP;

[string]$sqlInstance = 'SQLCluster'

#connect to the controller managing the volumes for this SQL instance.

Connect-NaController Filer01 #| Out-Null

$mirrors = Get-NaSnapmirror

foreach($mirror in $mirrors)

{

    if($mirror.source -match "Filer02:")

    {

            write-host $mirror.Source $mirror.destination

            Invoke-NaSnapmirrorBreak $mirror.Destination Y #$mirror.Source     --confirm switch? 

    }    

}

"Are you sure you want to start SnapMirror break to filer02:volume01?"

[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):

1 REPLY 1

JGPSHNTAP

So, I see why are you doing it with a for loop.. Is that b/c you want to see your write-host?

did you try -confirm:$False

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public