I am trying to figure out using powershell how I can script out a way to on the fly change the throttling of snapmirror relationships on our filers. The issue we are having is that some transfers that normally finish overnight are beginning to run into the daytime and use all the available bandwidth, so if I could just set up a scheduled task to throttle this during certain hours of the day, That would be ideal.
I was considering using the Set-NaSnapmirrorSchedule.
I am curious if I were to run something like Set-NaSnapmirrorSchedule -MaxTransferRate 256, would this change the throttling on the fly for an active transfer? And if so, would this be the only option that was changed or would it mess up the entire schedule for the active schedule since I didn't specify the -Hours, -DaysOfWeek, etc.? The only thing I want to change is the transfer rate.
This command doesn't change the setting in the snapmirror.conf file, it just changes the throttling for the active running snapmirror job. That way I can set the max transfer rate to unlimited and just run a scheduled task that will run this powershell script to throttle during business hours for any jobs that spill over into the day.
When the next snapmirror job kicks off, it will default back to whatever is set in the snapmirror.conf file.
You can run Set-NaCredential prior to running that command to store your ssh credentials so that aren't prompted for them every time you want to run the script.
There may be some confusion about my previous post, but I did set it up with a scheduled task.(actually 2 scheduled tasks, 1 to turn on throttling, 1 to turn it off) I've set up a scheduled task using a service account to run the one line above at 7:00 AM, and then it runs the same command again at 6:00 PM to turn off throttling (same command except instead of "128", plug in "0" to remove all throttling.)
That's a neat way to store the creds, but using netapps set-nacredential cmdlet was very easy. It saves the creds for that particular filer in an encrypted file so that you never have to enter them again (unless you change the password for that account.)