Microsoft Virtualization Discussions

Global replication throttle cmdlet

JGPSHNTAP
4,365 Views

I've been looking through the cmdlets for a global replication throttle option and i've come up empty.  As we all know, there is no throttling schedule 'yet' on Ontap, so the idea I had was to just loop the controllers through a powershell script to turn replication on and off on a set schedule.

I saw that you can do it per line with Invoke-NaSnapmirrorThrottle.  That's not what we are looking for.

Thanks

4 REPLIES 4

nick_barton
4,365 Views

Josh,

You can accomplish what you are trying to do with the Set-NaOption replication.throttle.enable on. You can also use Get-NaOption to do a check in your script to see if it is on or off. Alternatively you can always use the Invoke-Nassh to pass cli commands directly to the NetApp when you can't find a commandlet to do the job, i.e. (assuming you have already established a controller connection if not you can put controller name and credentials into the invoke command) Invoke-Nassh "options replication.throttle.enable on/off".

I encourage everyone if/when they have to time to just import the module via interactive powershell and issue a Get-Command | Select-String Na just to have a look at all the DataOnTAP commandlets available. From there you can issue a Get-Help commandlet command for more information.

Hope this helps. Good luck. 

-Nick Barton

cknight
4,365 Views

Thanks, Nick.  I would only add that you can also use Get-NaHelp and Get-NcHelp to get a little more insight on the Data ONTAP cmdlets available, organized by API, API category, etc.

JGPSHNTAP
4,365 Views

Thx guys.  I ran show-nahelp and search on the cmdlets titles only for replication.   I shoulda dug deeper for the options.  I will play with the cmdlet tomorrow for sure. 

I plan on looping controllers through a scheduled task to turn it on and off. I will repost.

Thx

JGPSHNTAP
4,365 Views

OK, so here is the finished code.  I wanted to be able to have one script and pass multiple arguments into it so we can schedule a task.

To launch scheduled task "powershell.exe script.ps1 input1 input1   Or within powershell   .\script.ps1 input1 input2

It's simple, but hopefully this will help someone else as well

[Code]

Param(

   $input1,

   $input2

)

## Import DataonTap

Import-Module Dataontap

$hostfile = $input1

gc $hostfile | % {

    $C = Connect-NaController $_ #

    Set-NaOption replication.throttle.enable $input2

}

[/code]

Public