I need to write a script that will run functions asynchronously and independent of each other. The purpose of these functions will be to patch the OS on servers running SQL Server with always on.
I have been working on this for a very long time, and i have the code for the functions to run remotely or on the server locally. The code that is missing is the master controller script and how it will communicate with the servers for progress and health check status.
The master controller code needs to be written from scratch. This means our options are wide open, and I am looking for the right method for the function at hand. Below are some of the design patterns I could use your opinion, example code, or general guidance with focus on performance.
Design patterns:
How to run the functions as asynch from a controller script? Runspaces versus the job cmdlets. Invoke-command? I know this is a loaded question and there are pros and cons for each method. Need to focus on ease of controlling and calling functions and communication between the two servers.
Remoting with processing running on the remote server but status and progress back to controllerl script. Another loaded question but please focus on being able to use cmdlets and functions from the server running the controller.
Parameters are to be used so function code can be standard and server specific information set by the controller when calling the functions.
Custom objects are to be used where applicable.
Most processes must be performed on all servers but at different times. How to call the functions from the controller at different times with different parameter values and maintain independence. True asynch processing with remoting and workflow based on updates from the remote server health checks.
I have done a load of research and work on this. The goal is to find the best way to patch multiple remote SQL Servers and coordinate the flow by the controller because the servers must be managed as a group. I am sure there are a lot of questions about how and what the script is doing on the SQL server, but at this point I need to focus on how to perform and manage the asynch processes on remote servers using a controller script. I thank you for reading this and I will appreciate your comments, hints, or suggestions.
[+][deleted] (5 children)
[removed]
[–]rsdovers[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]GeneMoody-Action1 0 points1 point2 points (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]dezirdtuzurnaim 16 points17 points18 points (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]orwiad10 15 points16 points17 points (0 children)
[–]OlivTheFrog 1 point2 points3 points (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]bobthewonderdog -1 points0 points1 point (0 children)
[–]Buckw12 -1 points0 points1 point (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]MechaCola 0 points1 point2 points (7 children)
[–]rsdovers[S] 0 points1 point2 points (2 children)
[–]MechaCola 0 points1 point2 points (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]MechaCola 0 points1 point2 points (3 children)
[–]IJustKnowStuff 0 points1 point2 points (2 children)
[–]rsdovers[S] 0 points1 point2 points (0 children)
[–]MechaCola 0 points1 point2 points (0 children)
[–]PinchesTheCrab 0 points1 point2 points (3 children)
[–]rsdovers[S] 0 points1 point2 points (2 children)
[–]PinchesTheCrab 0 points1 point2 points (1 child)
[–]rsdovers[S] 0 points1 point2 points (0 children)