Description
MasterSweep is a PowerShell-Python based application that I developed at Accenture for a client in
Hospitality industry. The client runs a
proprietary Property Management System (PMS) application deployed on windows machines. MasterSweep automates
patch deployment
process for this PMS application. This includes downloading and configuring the patches, copying the patches
on the client servers,
installing and monitoring the install, verifying that the install is successful and generating a report for
all the servers with the
patch installation status. For large deployments (> 1000 servers), it also emailed the support team once the
job was finished.
The application expected patch number, list of servers to work on and user choice of options as primary
inputs. The entire process was divided
into 4 variables as follows:
- copy
- install
- verify
- uninstall
The function definitions are relatively straightforward and explain the process well. The order of operations
is hard-coded and is kept as follows:
copy -> uninstall -> install -> verify
- The "copy" function downloads, configures and copies patch on all the windows servers that the
user has specified. It also generates a
report stating whether the copy operation was successful on a particular server.
-
- The "install" function installs the patch in batches of 128 servers and monitors the install. It
also generates a report quoting each server
by name and a simple boolean (true/false) indicating whether the install was successfully triggered on
that server. Note that it does not
say whether the install was successful, only that it was triggered.
-
- The "verify" function checks that the patch install is successful both in the windows registry
and client databases. It then generates a report
with its findings. Additionally, it generates a separate report containing the names of all servers
where the install has failed making it easier
to gather relevent information from the process.
-
- The "uninstall" function uninstalls the specified patch on the specified servers. Like the
install function, it
generates a report stating the status of its triggers. The install and uninstall functions can be
combined with verify function to perform
a specific task on a list of servers and check the result in a convenient way.
Utility and benefits
- Automates the patch deployment process from start to finish.
- Reduces the human effort required in the process from hours of manual work to a couple of minutes.
- Reduces the possibility of human errors.
- Codifies the process and makes sure that the process is followed by the book every time it is run.
- The application is completely configurable and allows the user to start the process from wherever they
want. If they want to copy but not
install yet, it can be done. If they have already copied, they can save time by triggering only install.
- Although each functions stands on its own merit, it can be combined with other functions to create a
more elaborate and meaningful task. For
example:- since in the order-of-operations, the uninstall function is before the
install function but after the copy function, it can be combined with install to quickly re-install a
patch if needed.
- The verify function automates not only a part of the process, but also the post-completion tasks of
analysing process reports by
generating a report that gives a high-level overview of the results in the form of names of servers
where the process has failed.
Upgrades and enhancements
Once the minimum viable version of MasterSweep was launced and was met with a resounding success from every
team member, I added a bunch of
other functions to make it even for intuitive and useful. These ranged from upgrades to the existing
process, enhancements to the MasterSweep's
functionality and also helper functions that make using the MasterSweep more user-friendly. Three of these
functions are described below:
- deploy-fix
- validate
- delete-except
The functions are described as follows:
- The "deploy-fix" function deploys a common fix on each server that fixes a known issue that
causes the patch deployment process to fail.
Merely enabling this function before deployment reduces the patch failures by over 95% (data collected
between Jan 2020 and April 2020).
- The client operates worldwide and different local outlets have different business hours.
The "validate" function checks local time on the client server and skips it from the queue if the
client is at its peak business hours.
The skipped server is then added to the list of failures to maintain consistency in data. This ensures
that the client is not hassled during
their business hours in case of a major failure.
- The "delete-except" function is not visible to the user. It is always enabled and executes every
time the application is run.
This function keeps all the critical files that the application needs to run and deletes everything else
from its parent folder. This ensures
that the application folder is neat and organised and the application is easier to engage.
Results
- Patch deployment errors reduced by over 95% (data collected between Jan 2020 and April 2020)
- Manual effort required in the process reduced from 6 hours (typically) per day to a couple of minutes.
- Number of team members engaged in the process reduced from 3 to 1.
- Human errors nearly eliminated.
- Speed of the procss reduced by 50% from 6 hours to 3 hours.