start portlet menu bar

HCLSoftware: Fueling the Digital+ Economy

Display portlet menu
end portlet menu bar
Close
Select Page

In this Blog, we would go through a UseCase to demonstrate a Customer wanting to Track his Application Deployment through Service Now uses HWA to accomplish the same while also orchestrating the entire flow of Application Deployment and Service Now Ticketing Orchestration through HWA :

Requirement:

  • An Application Team wants to use Containerized deployment of its Application packaged as jar files into an Application Server from time to time.
  • The Application would be deployed along with a Database which could either be one of Mongo DB or Postgre-SQL DB instance to be deployed as a Container along with the Application.
  • The Application would be deployed along with an Application Server which would be one of Apache or Nginx also to be deployed as a Container.
  • The Entire Deployment would be tracked through HWA in real-time and updated on Service Now.
  • The Request on Service Now would be closed once Deployment is complete.
  • All Requests targeted for Automation would be Marked as “Automation=YES” in the Automation Field.
  • A Request on Service Now would appear in the below way :

HWA-SNOW IntegrationFig1

Solution Conceptualization in HWA:

  • A RESTFUL GET job would pick the latest Request from the Queue of Server Build team and would get a JSON response of the request in an Output File.
  • A Set of Extract Jobs would extract the Application Jar Path, the Application Jar File Name, the Application, DBName, and Ticket Number from the request.
  • A Set of Store Jobs would set HWA Variables for each of the Parameters such as Application Jar Path, the Application Jar File Name, the Application, DBName, and Ticket Number and would assign parameters extracted into corresponding variables using jobprop utility of HWA.
  • An Application YAML file creation job would create a YAML file in the jar file location utilizing the parameters for jar file path and jar file name.
  • An Application Deployment Job would deploy an Application Container taking the Application jar Filename as input.
  • The Output Condition on the Store Job for DB would either pass the conditions: Mongo or Postgre depending on the DB HWA variable.
  • The Output Condition on the Store Job for Application Server would either pass the conditions: Nginx or Apache depending on the APPLSERVERNAME HWA variable.
  • If the Output Condition on DB Job is Mongo, a Mongo DB Container is provisioned on the Application Server through a Mongo DB deploy Job.
  • If the Output Condition passed on the DB Job is Postgre, a Postgre DB container is provisioned on the Application Server through a Postgre DB deploy Job.
  • If the Output Condition passed on the Application Server Store Job is Apache, an Apache Container is provisioned on App Server through a Apache WebServer deploy job.
  • If the Output Condition passed on the Application Server Store Job is Nginx, and Nginx container is provisioned on the App Server through an Nginx WebServer deploy job.
  • The Application provisioning if completed Successfully along with the DB Provisioning and WebServer Provisioning would satisfy a JOIN Condition which would then trigger a Request Update RESTFUL Put Job to update the Ticket with the Comments that the “Application Deployment along with DB Container and WebServer Deployment was Successful”.
  • A Request Closure Job would then close the Ticket once the Ticket Update Job is Successful through RESTFUL Delete Call to Service Now taking the Request Number as Input.
  • In the case, if Application Deployment Fails or DB Deployment Fails or WebServer Deployment Fails, then a JOIN Condition is satisfied which would update the request through a RESTFUL update job with the Comments that the “Application Deployment Failed”. So, that the Application team could review and troubleshooting.

Implementation:

For the above Usecase, we are making use of a Service Now Instance on SaaS with Administrator Role and having the below experience and View built in the table for Request Management :

HWA-SNOW IntegrationFig2

HWA-SNOW IntegrationFig3

SERVICENOW_GET_REQUESTS_CONTBUILD Job:

This is a RESTFUL GET job which makes a call to the URL https://dev114719.service-now.com/api/now/table/x_650167_requests_requests and query by descending order and Assignment Group Name server_build_team and Automation Flag marked as “YES” and picks the latest Request in the queue and stores the JSON response retrieved from the request in the output file /tmp/requestsserverbuildoutput.

HWA-SNOW IntegrationFig4

EXTRACT_REQUEST_APPLSERVER_CONTBUILD Job:

This is a Unix Job which would extract the Application Server to be deployed as part of the Deployment from the output file /tmp/requestsserverbuildoutput and display it in the joblog output.

EXTRACT_REQUEST_DB_CONTBUILD Job:

This is a Unix Job which would extract the DB Name to be deployed as part of the Deployment from the output file /tmp/requestsserverbuildoutput and display it in the joblog output.

EXTRACT_REQUEST_TKTNO_CONTBUILD Job:

This is a Unix Job which would extract the Ticket Number of the Request

from the output file /tmp/requestsserverbuildoutput and display it in the joblog output.

EXTRACT_REQUEST_APPLNAME_CONTBUILD Job:

This is a Unix Job which would extract the Application Jar File Name from the Output File /tmp/requestsserverbuildoutput and display it in the joblog output.

EXTRACT_REQUEST_APPLPATH_CONTBUILD Job:

This is a Unix Job which would extract the Application Jar Path from the Output File /tmp/requestsserverbuildoutput and display it in the joblog output.

HWA-SNOW IntegrationFig5

STORE_APPLSERVERNAME_CONTBUILD Job:

This is an executable job type which parses the EXTRACT_REQUEST_APPLSERVER_CONTBUILD Joblog output and uses the jobprop utility to set a HWA variable for Application Server Name .There are also two Output conditions which are passed through the Job called “APACHE” which is passed when the Joblog contains the String  “Apache” and the condition “NGINX” which is passed when the Joblog contains the String “nginx”.

HWA-SNOW IntegrationFig6

HWA-SNOW IntegrationFig7

STORE_DB_CONTBUILD Job:

This is an executable job type which parses the EXTRACT_REQUEST_DB_CONTBUILD job’s Joblog output and uses the jobprop utility to set a HWA variable for DBName .There are also two Output conditions which are passed through the Job called “MONGO” which is passed when the Joblog contains the String  “Mongo” and the condition “POSTGRE” which is passed when the Joblog contains the String “Postgre”.

HWA-SNOW IntegrationFig8

HWA-SNOW IntegrationFig9

STORE_APPLNAME_CONTBUILD Job:

This is an executable job type which parses the EXTRACT_REQUEST_APPLNAME_CONTBUILD Job’s Joblog output and uses the jobprop utility to set a HWA variable for APPLNAME extracting the jar filename in the Variable.

HWA-SNOW IntegrationFig10

STORE_APPLPATH_CONTBUILD Job:

This is an executable job type which parses the EXTRACT_REQUEST_APPLPATH_CONTBUILD Job’s Joblog output and uses the jobprop utility to set a HWA variable for APPLPATH extracting the Path to the jar file to be deployed.

HWA-SNOW IntegrationFig11

STORE_TKTNO_CONTBUILD Job:

This is an executable job type which parses the EXTRACT_REQUEST_TKTNO_CONTBUILD Joblog output and and uses the jobprop utility to set a HWA variable for Ticket No/Request No in a variable named TKTNO:

HWA-SNOW IntegrationFig12

VT_UPDATE_SNOW_CONT_USECASE Job:

This is a Variable table update Job which would update the variable table SNOW_CONT_USECASE set at the Jobstream Level  with the HWA Variables : APPLPATH set to ${job:EXTRACT_REQUEST_APPLPATH_CONTBUILD.stdlist} , APPLNAME set to ${job:EXTRACT_REQUEST_APPLNAME_CONTBUILD.stdlist} , TKTNO set to ${job:EXTRACT_REQUEST_TKTNO_CONTBUILD.stdlist} so that the Application Jar Path , Application Jar File Name and Ticket Number is extracted readily .

HWA-SNOW IntegrationFig13

DEPLOY_APPL_YAML Job:

This is a Unix job which would take APPLPATH and APPLNAME as input and build a yaml file/Docker File for the Java Application to be deployed.

HWA-SNOW IntegrationFig14

DEPLOY_APPL_DOCKER Job:

This is a Unix job which would deploy the jar Application taking the Application Name(jar file name) as input and deploying a Dockerized Instance of the Application through the Docker File built in the previous step.

HWA-SNOW IntegrationFig15

DEPLOY_MONGODB_DOCKER Job:

This job would run when the condition MONGO is passed from the   STORE_DB_CONTBUILD Job,this deploys a Mongo DB Containerized Instance through docker run command:

HWA-SNOW IntegrationFig16

DEPLOY_POSTGRESQLDB_DOCKER Job:

This Job would run when the condition POSTGRE is passed from the
STORE_DB_CONTBUILD Job , this deploys a Containerized Instance of Postgre SQL DB through a Docker run command :

HWA-SNOW IntegrationFig17

DEPLOY_NGINX_DOCKER Job:

This Job would run when the condition NGINX is passed from the
STORE_APPLSERVERNAME_CONTBUILD Job, this deploys a Containerized Instance of an Nginx through a Docker run command:

HWA-SNOW IntegrationFig18

DEPLOY_APACHE_DOCKER JOB:

This Job would run when the condition APACHE is passed from the STORE_APPLSERVERNAME_CONTBUILD Job , this deploys a Containerized Instance of an Apache through a Docker run command:

HWA-SNOW IntegrationFig19

DBDEPLOY Join Condition:

This is satisfied when one of the DB Deployment Jobs: Mongo DB or PostgreSQL DB finishes Successfully:

HWA-SNOW IntegrationFig20

APPLDEPLOYFAILED Join Condition:

This is satisfied when one of the AppServer deployment Jobs: Apache Deploy Job or Nginx Deploy Job or MongoDB Deploy Job or Postgre SQL Job or Application Deploy Docker Job finishes in Abend:

HWA-SNOW IntegrationFig21

APPSERVER Join Condition:

This is satisfied when one of the AppServer deployment Jobs: Apache Deploy Job or Nginx Deploy Job finishes Successfully:

HWA-SNOW IntegrationFig22

SNOW_UPDATE_TICKET_CONTBUILD Job:

This is RESTFUL Job which would post the Update to the Request/Ticket taking the Variable TKTNO as input making a call to the REST URL https://dev114719.service-now.com/api/now/table/x_650167_requests_requests/^TKTNO^ which would post the message “Application , DB and Middleware Deployment Successful” into comments section of the Ticket/Request .This job would run only when the DEPLOY_APPL_DOCKER Job finishes Successfully , DBDEPLOY Join Condition , APPSERVER Join Condition are satisfied:

HWA-SNOW IntegrationFig23

HWA-SNOW Integration

Fig24

SNOW_CONTBUILD_TICKET_CLOSE Job:

This is a RESTFUL Delete job which would take the TKTNO as input and do a RESTFUL Delete against the Request No/Ticket No in question:

HWA-SNOW IntegrationFig25

SNOW_UPDATE_TICKET_NEGCOND_CONTBUILD Job:

The Job SNOW_UPDATE_TICKET_NEGCOND_CONTBUILD runs when the APPLDEPLOYFAILED Join Condition is satisfied (one of the AppServer deployment Jobs : Apache Deploy Job or Nginx Deploy Job or MongoDB Deploy Job or Postgre SQL Job or Application Deploy Docker Job finishes in Abend) . This is a RESTFUL PUT Job which would post the comment: “Application Deployment Failed” in the comments section of the Request/Ticket :

HWA-SNOW IntegrationFig26

HWA-SNOW IntegrationFig27

A Snapshot of the complete Jobstream when executed attached below:

HWA-SNOW IntegrationFig28

HWA-SNOW IntegrationFig29

Conclusions from the UseCase:

  • Application Deployment of an Application packaged as a jar file with an Application DB and Application Server can be completely Automated through HWA while also tracked over Service Now for record keeping purposes by using HWA leveraging REST APIs of ServiceNow and acting as a Meta Orchestrator for a Containerized Deployment of the Application End to End.
  • The UseCase can be also in a similar way be extended for a VM Provisioning UseCase as well

 

Comment wrap

Start a Conversation with Us

We’re here to help you find the right solutions and support you in achieving your business goals.

  |  February 10, 2023
Banking Case Study: New Client Adoption and Reverse Check: HWA+DRYiCE-iControl
We look at a banking case study wherein we are going through the “New Client Adoption and Reverse Check” business process.
  |  September 28, 2022
See your scheduling metrics on Prometheus and Grafana
HCL Workload Automation has exposed its metrics for the main components, the back-end which reports metrics around job execution.
  |  September 26, 2022
Easy Websphere's Liberty Management for the Workload Automation Administrator
Learn about how HWA main components are deployed on WebSphere liberty, that was designed to be highly efficient and optimized for modern cloud technologies.