Skip to Content
Technical Articles
Author's profile photo Showkath Ali Naseem

[ BTP DevOps ] : Auto remediation with SAP Alert Notification service and Automation Pilot – Part2

New Year , New Blog PostΒ  πŸŽ‰

πΏπ‘’π“‰β€™π“ˆ π“Œπ‘’π“π’Έπ‘œπ“‚π‘’ π“‰π’½π’Ύπ“ˆ nπ‘’π“Œ c𝒢𝓁𝑒𝓃𝒹𝒢𝓇 y𝑒𝒢𝓇 𝟀𝟒𝟀πŸ₯ w𝒾𝓉𝒽 𝑔𝓇𝑒𝒢𝓉 π‘’π“ƒπ“‰π’½π“Šπ“ˆπ’Ύπ’Άπ“ˆπ“‚ and π“ƒπ‘’π“Œ π‘’π“ƒπ‘’π“‡π‘”π’Ύπ‘’π“ˆ, accompanied by 𝓉𝒽𝑒 π“Œπ’Άπ“‡π“‚π‘’π“ˆπ“‰ π’Άπ“ˆπ“…π’Ύπ“‡π’Άπ“‰π’Ύπ‘œπ“ƒπ“ˆ. π‘€π’Άπ“Ž π“‰π’½π’Ύπ“ˆ π“Žπ‘’π’Άπ“‡ 𝒷𝓇𝒾𝓃𝑔 π“ƒπ‘’π“Œ π’½π’Άπ“…π“…π’Ύπ“ƒπ‘’π“ˆπ“ˆ, π“ƒπ‘’π“Œ π‘”π‘œπ’Άπ“π“ˆ, π“ƒπ‘’π“Œ π’Άπ’Έπ’½π’Ύπ‘’π“‹π‘’π“‚π‘’π“ƒπ“‰π“ˆ, π“π‘œπ“‰π“ˆ π‘œπ’» 𝑒𝓍𝒸𝒾𝓉𝒾𝓃𝑔 π‘œπ“…π“…π‘œπ“‡π“‰π“Šπ“ƒπ’Ύπ“‰π’Ύπ‘’π“ˆ 𝒢𝓃𝒹 π“‚π’Άπ“ƒπ“Ž π“ƒπ‘’π“Œ π’Ύπ“ƒπ“ˆπ“…π’Ύπ“‡π’Άπ“‰π’Ύπ‘œπ“ƒπ“ˆ π“‰π‘œ π“Žπ‘œπ“Šπ“‡ 𝓁𝒾𝒻𝑒. Let’s all 𝑒𝓍𝓅𝑒𝓇𝒾𝑒𝓃𝒸𝑒 π“ƒπ‘’π“Œ π“‰π’½π’Ύπ“ƒπ‘”π“ˆ 𝒢𝓃𝒹 𝓁𝑒𝒢𝓇𝓃 π“ƒπ‘’π“Œ π“‰π’½π’Ύπ“ƒπ‘”π“ˆ in π“‰π’½π’Ύπ“ˆ π“ƒπ‘’π“Œ π“Žπ‘’π’Άπ“‡ 🍫 🍬🍦

 

This blog post is part ofΒ a series of blog postsΒ related to SAP BTP Β Alert Notification service.
In Part 1 Use case was ”Β how to catch application crashes in SAP BTP by utilizing Alert Notification” . The idea of Part 2 isΒ  to β€œReact Proactively & automatically remediate application instance crashes by using out-of-the-box integration of a state-of-the-art DevOps tools, such as SAP Automation PilotΒ ,Β  SAP BTP Alert Notification

As you know , the primary goal ofΒ SAP Automation Pilot is to simplify and automate complex manual processes , automate multiple DevOps tasks in order to minimize the cloud operational effort behind any cloud solution in theΒ SAP Business Technology Platform

Use-case 1 : Simple Scenario

In this blog post , we would like to illustrate Auto remediation With simple use case

“Auto Start Application instance when Application Crashed/Stopped”

Configurations in SAP Automation Pilot

 

Β Step1 ) Create Service AccountΒ withΒ Execute privileges.This Technical Service Account you will use in Alert Notification service. As of now Service Account Supports two types of Authentication

  1. Basic Authentication
  2. SAP Cloud PKI Client Certificate

Reference : Service Account in SAP Automation Pilot

 

Β Step2 ) Build Trigger URL

  1. Go to the Executions section in the Automation Pilot’s UI and choose theΒ Build Event Trigger
  2. ChooseΒ AlertΒ NotificationsΒ a trigger type.
  3. Select your desired command by specifying the catalog, command and version fields.
  • For Restarting and re-staging applications: You have below commands
    RestartCfApp, RestageCfApp, StartCfApp, StopCfApp
    TriggerStartCfApp,TriggerStopCfApp​

    4. After all fields are set in the desired way, you can scroll back to the top and copy the automatically generated URL (To any notepad).

    Configurations in Alert Notification

    Let’s start by creating a SAP Automation Pilot action for the Alert Notification.

    1. Navigate to Alert Notification’s service instance UI in your Cloud Cockpit, tabΒ Actions, click theΒ Create.
    2. Choose SAP Automation Pilot action type.

    Β  Β  Β  Β  Β 3. In the displayed form, enter the name of the target table in Automation Pilot.

    Β  Β  Β  Β  4. You can now paste URL you copied from the Automation PilotΒ in additional URL property field, then enter Automation Pilot service account user name and password for authentication.

    Β 

    Β  Β Here I would like to share one good news for you that ,Β It is possible to share an instance of theΒ  Β  Automation URL between different sub-accounts or different spaces.

     

    Use-case 2 : Complex Scenario

    Sometimes your BTP Cloud app deployment Fails , If your app is too large, or you have exceeded your organisations memory limit, You are unable to run an application.

    Common reasons deploying an app fails include:

    • There is no organization memory and route quota assigned to the specific organization in the BTP Cloud Foundry environment.
    • You always has to make sure your org and space have enough resources for all instances of your app.
    • You cannot use more resources in a space than is allocated for your org.
    • The memory available for the whole subaccount is shown in the brackets of β€œMemory Quota” called β€œavailable memoryβ€œ

    Β  Β As per Note ,In BTP global accounts that use the consumption-based commercial model, SAP BTP, Cloud Foundry Runtime is not listed in the Entitlements pages in the SAP BTP cockpit. AΒ quota limit of 50 GB of Cloud Foundry Runtime memory is assigned by default to everyΒ subaccount.If you need to increase this limit, report an incident to SAP supportInformationΒ published on SAP site on the BC-NEO-CIS component.This also applies to other services that have a technical quota limit.

    Manual ProcessΒ 

    Genrally this kind of activities take taken care by Cloud administrators or Operation Team
    Global Account administrators assign Cloud Foundry Runtime quota to the subaccounts using the “Entitlements” page in the BTP Cockpit, on Global Account level. Optionally, the Org Manager can create quota plan inside the organization and assign it to Spaces, or let the spaces consume the whole quota of the organization. For details, see Managing Entitlements and Quotas Using the Cockpit.
    You can automate this Cloud Quota Management Workflow process using SAP BTP DevOps tools, such asΒ SAP Automation Pilot Β  , SAP BTP Alert NotificationΒ 

    Configurations in Alert Notification

    For example, If you would like to Notify Quota issues on BTP in case if BTP Organisation memory usage is over 75% then you can configureΒ Subscription “Monitor Quota Usage on BTP Alert Notification Service”

    Reference : Resource Quota UtilizationΒ 

    Then BTP Alert Notification service will trigger an event if Org memory usage is over 75%

    Configurations in SAP Automation Pilot

    BTP AutomationΒ  provided commands are generic – they do exactly one thing (restart your app, start your app, create a jira ticket, etc…). If you have a more complex scenarios which includes multiple steps – you need to create a custom command.

    Here custom command can be usedΒ  along with provided commands .For example you can create a new command that used StartCfApp and then CreateJiraIssue.

    Create Action of Type Automation Pilot integrate with servicenow (refer Blog Post) or create IT Support Ticket/JIRA using API Integration in Automation Pilot

    In this way you can build Own Custom commands.

     

    Thank you for reading this blog post.Β If you find this material useful, please leave your feedback in the comments section below.

    Please feel free to add your questions ,if you need any further information or in case you face the issue/problem

    Also ‘Like’ ,‘Share’ , ‘Follow’ me to get new updates.

     

    Happy DevOpsΒ  πŸ™‚ !

    Assigned Tags

        Be the first to leave a comment
        You must be Logged on to comment or reply to a post.