WORKLOAD AUTOMATION COMMUNITY
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new

Case Study : HWA-SNOW Integration : Application , DB and AppServer Container Provisioning Orchestration

8/8/2021

0 Comments

 
Picture
​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 alongwith a Database which could either be one of Mongo DB or Postgre-SQL DB instance to be deployed as a Container alongwith the Application.
  • The Application would be deployed alongwith 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 :
Picture
Fig 1

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 File name 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 , an Nginx container is provisioned on the App Server through a Nginx WebServer deploy job.
  • The Application provisioning if completed Successfully alongwith 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 alongwith 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 troubleshoot.
 
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 :

Picture
Fig2
Picture
Fig3

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 .
Picture
Fig4

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.​
Picture
Fig5

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” .
Picture
Fig6
Picture
Fig7

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” .
Picture
Fig8
Picture
Fig9

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.​
Picture
Fig10

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.
​
Picture
Fig11

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 :​
Picture
Fig12

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 .
Picture
Fig13

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 .
Picture
Fig14

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 .​
Picture
Fig15

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 :
Picture
Fig16

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 :​
Picture
FIg17

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 :​
Picture
Fig18

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 :​
Picture
Fig19

DBDEPLOY Join Condition :

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

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 :​
Picture
Fig21

APPSERVER Join Condition :
This is satisfied when one of the AppServer deployment Jobs : Apache Deploy Job or Nginx Deploy Job finishes Successfully :
Picture
Fig 22

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 :​
Picture
Fig23
Picture
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 :
Picture
Fig25

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 :
Picture
Fig26
Picture
Fig27

A Snapshot of the complete Jobstream when executed attached below :
Picture
Fig28
Picture
Fig29

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.

Authors Bio
Picture
Sriram V, ​Senior Technical Lead
Sriram is working with Workload Automation for the last 12+ years. Started out as a Scheduler, later as an Administrator, SME and India SME of the Product. He has been part of the Product Team in the last few years supporting Workload Automation on SaaS before moving to the Lab Services and Tech Sales of WA.
View my profile on LinkedIn
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    March 2023
    February 2023
    January 2023
    December 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    January 2020
    December 2019
    November 2019
    October 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017

    Categories

    All
    Analytics
    Azure
    Business Applications
    Cloud
    Data Storage
    DevOps
    Monitoring & Reporting

    RSS Feed

www.hcltechsw.com
About HCL Software 
HCL Software is a division of HCL Technologies (HCL) that operates its primary software business. It develops, markets, sells, and supports over 20 product families in the areas of DevSecOps, Automation, Digital Solutions, Data Management, Marketing and Commerce, and Mainframes. HCL Software has offices and labs around the world to serve thousands of customers. Its mission is to drive ultimate customer success with their IT investments through relentless innovation of its products. For more information, To know more  please visit www.hcltechsw.com.  Copyright © 2019 HCL Technologies Limited
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new