Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
alisa_dermen
Advisor
Advisor
1,580

In this blog post, I share hands-on insights on how to minimize downtime for your SAP HANA Cloud database by leveraging SAP Automation Pilot. By simply going through this step-by-step guide, you will learn how easy it is to set up SAP Automation Pilot to perform automated availability checks effortlessly, so that you minimize disruptions, keep your business running smoothly and maximize performance!

Introduction

Undoubtedly, ensuring that your HANA Cloud instances are always up and running can be crucial for the success of your business operations. In Biser Simeonov's last blog post co-authored by me, “Automated Availability Check for SAP HANA Cloud (on CF level) with SAP Automation Pilot”, we showed you how to automate the monitoring of your HANA Cloud instances enabled in a Cloud Foundry space by using SAP Automation Pilot and SAP Alert Notification Service for SAP BTP – two powerful tools from the SAP Business Technology Platform (SAP BTP) DevOps portfolio. You learned how to utilize these tools to check the availability of your instances, and even start the ones that are not accessible. So far so good!

However, with the 2022 QRC3 release in October 2022, SAP HANA Cloud went "multi-environment". As a result, now you can have HANA Cloud instances in subaccounts that don’t have the Cloud Foundry environment enabled. For more information, see:

In the following guide, I will show you how to perform the same HANA Cloud Availability Check for HANA Cloud instances enabled in “Other Environments” (multi-environment setup).

How does the HANA Cloud Availability Check work?

The process is visualized in the graphic below. I advise you to check out the previous blog post for a more detailed explanation.

BiserSimeonov_0-1715273779974.png

Step-by-Step Guide

Prerequisites

  • SAP HANA Cloud database provisioned on subaccount level (multi-environment);
  • SAP Automation Pilot (See Initial Setup);
  • SAP Alert Notification service for SAP BTP enabled in Cloud Foundry (See Initial Setup);
  • Integration between SAP Automation Pilot and SAP Alert Notification service for SAP BTP (See Integrate with SAP Alert Notification Service for SAP BTP);
  • SAP Service Manager instance with plan “subaccount-admin” provisioned on space level or on subaccount level;

After you’ve made sure that you meet all the prerequisites, you can proceed with the steps below.

1. Verify that you have provisioned SAP Automation Pilot. You should be able to see it in the “Subscriptions” section in your subaccount:

Screenshot 2024-04-03 093105.png

NOTE: SAP Automation Pilot can interact with resources in any BTP landscapes. All you need is to have at least one instance of SAP Automation Pilot.

2. Verify that you have Alert Notification and Service Manager instances, and that your HANA Cloud instance is enabled in “Other Environments”.

Your Service Manager instance can be provisioned either in your subaccount, or in your space. The only difference this will make is whether you will have to create a “Service Binding” or a “Service Key” later.

instances.png

3. You need to create a Service Key for your Alert Notification service instance. This key will be used on a later stage by the SAP Automation Pilot command. To create a Service Key, choose the “Create Service Key” option:

Screenshot 2024-04-03 095812.png

Enter a name for your service key and choose “Create”:

Screenshot 2024-04-03 105546.png

4. Next, you need to create a “Service Binding” for your HANA Cloud instance, which will be used by the SAP Automation Pilot command. To do that, choose the “Create Service Binding” option:

create-hana-binding.png

Enter a name for your service binding and choose “Create”:

Screenshot 2024-04-11 135332.png

5. Depending on the scope of your Service Manager instance, you need to create:

  • a “Service Key” if your instance is on space level.
  • a “Service Binding” if your instance is on subaccount level.

6. The SAP Automation Pilot team has prepared a catalog with example commands, which can be imported directly into your SAP Automation Pilot instance.

Copy the contents of the catalog:

catalog.png

7. Now you need to import the catalog with example commands in your SAP Automation Pilot instance. From the left-side menu, choose “My Catalogs” and then “Import”:

Screenshot 2024-04-02 180015.png

Paste the catalog and choose “Import”:

Screenshot 2024-04-02 180419.png

8. You can see the imported catalog “Automation Pilot Examples” in “My Catalogs”. From this catalog, choose “Commands”:

Screenshot 2024-04-03 111415.png

9. From the catalog, open the “CheckHanaCloudMultiEnvAvailabilitySample” command by clicking on it. Explore the Input Keys, the Output Keys, and the Executors of the command:

multi-opened.png

10. Scroll down to “Configuration” and choose the “notifyANS” executor. You need to define the event that SAP Automation Pilot will ingest into Alert Notification service. Choose “Edit” to edit the properties of your event:

Screenshot 2024-04-15 154232.png

You can use these example values for the required event properties of your event:

  • body: The availability check for HANA Cloud with Service Instance ID $(.execution.input.hanaServiceInstance) has failed. Now the Automation Pilot proceeds with an automated START for this HANA Cloud instance.
  • category: ALERT
  • eventType: FailedHCAvailabilityCheck
  • resourceName: hana
  • resourceType: database
  • serviceKey: $(.execution.input.AnsServiceKey) -> use a dynamic expression to get the AnsServiceKey from the inputs
  • severity: ERROR
  • subject: Failed HANA Cloud Availability Check $(nowMillis | toDate("yyyy-MM-dd"))

Screenshot 2024-04-08 101847.png

11. After you have done that, trigger the command:

Screenshot 2024-04-11 141414.png

12. You need to provide values for the following input keys:

  • AnsServiceKey - Service Key for your Alert Notification service instance.
  • hanaClientTokenURL - The URL needed to be called in order to generate a token to access your HANA Cloud instance. The URL is built as follows: in the HANA Cloud service binding file, in the "uaa" section, look for the specified "url" + add to it /oauth/token?grant_type=client_credentials.
  • hanaCloudBindingKey - Service Binding for your Hana Cloud instance
  • hanaCloudResourceName - The exact name of your HANA Cloud instance, e.g. "hanaDemo", "hanaProd", etc.
  • hanaClusterNeeded to access the HANA Cloud API gateway, where 'cluster' typically identifies either a production, pre-production or trial environment. Examples: trial, prod
  • hanaDatacenter - Needed to access the HANA Cloud API gateway, where 'datacenter' is the data center where your HANA Cloud is deployed, i.e. eu10, us10, etc.
  • hanaServiceInstance - The Instance ID of your HANA Cloud instance - it can be found from the provisioned service in BTP Cockpit, look for "Instance ID".
  • ServiceManagerKey - Service Key or Service Binding for your Service Manager instance used to perform management tasks against multiple instances in your BTP subaccount.

You can also look at the prepared outputs (no need to provide values for them but it is important to understand what data is returned as the command's output):

  • checkPing - The entire response for the metric "HDBAccessible" returned by HANA Cloud Metrics Service REST API.
  • isHanaCloudAvailable - Check on whether the HANA Cloud instance is available, where: "true" = HANA Cloud is available; "false" = HANA Cloud is not available.
  • resultHanaStart - Check on whether the HANA Cloud instance has been started successfully, where: "true" = HANA Cloud has been started; "false" = HANA Cloud was not started'.

13. Provide values for all input keys and then trigger the command:

Screenshot 2024-04-11 142252.png

There are two possible options for the outcome of the execution:

Option 1: Your HANA Cloud instance is accessible and the command for starting HANA Cloud has not been triggered. You should be able to see the following execution details:

Screenshot 2024-04-11 142609.png

If you click on “Output Values”, you can see the output values for checkPing, isHanaCloudAvailable, and resultHanaStart:

option1values.png

You can verify in SAP Hana Cloud Central that your HANA Cloud instance is up and running:

Screenshot 2024-04-11 150458.png

Option 2: Your HANA Cloud instance is not accessible and the command for starting HANA Cloud has been triggered:

Screenshot 2024-04-11 154128.png

You can verify in SAP Hana Cloud Central that your HANA Cloud instance is starting:

Screenshot 2024-04-11 152402.png

If you click on “Output Values”, you can see the output values for checkPing, isHanaCloudAvailable, and resultHanaStart:

option2values.png

You have successfully performed the HANA Cloud Availability Check via SAP Automation Pilot. Now you can make a subscription in Alert Notification service, so that you can receive a notification when SAP Automation Pilot detects that your multi-environment HANA Cloud instance is not accessible. If you want to do that, continue with the following steps:

14. Navigate to your Alert Notification service instance and open it. Choose the “Subscriptions” tab form the left-side menu and then “Create” to create a new subscription:

ans-create.png

15. Enter a name for your subscription and click “Create” to move on to the next step:

Screenshot 2024-04-03 130140.png

16. Next, create a Condition. Give your condition a name. Then define your condition by choosing the event property “eventType”, operand “Is Equal To”, and, in our case, expected value “FailedHCAvailabilityCheck”:

Screenshot 2024-04-05 134313.png

The expected value for “eventType” is the one you provided in step 10:

eventtype.png

17. To finish your subscription in Alert Notification service, select an Action by choosing “Create Action”:

Screenshot 2024-04-03 132354.png

Select an Action Type of your preference, for example “Email” and choose “Next”:

Screenshot 2024-04-03 132405.png

Give your Action a name, and then provide the email address where you want to receive the email notification:

Screenshot 2024-04-03 132730.png

Screenshot 2024-04-03 132825.png

NOTE: After you have created some of the actions, they are labeled as Not Confirmed. To enable them, you have to confirm them as described in Confirming Actions.

Choose “Save” to finish making your subscription. You will see a confirmation that your subscription was created:

Screenshot 2024-04-03 133321.png

You can find more information about Subscriptions, Conditions, and Actions in Configuration Management Using the SAP BTP Cockpit.

18. Now you can test your subscription. If you stop your HANA Cloud Instance and trigger the CheckHanaCloudMultiEnvAvailabilitySample command again, you will receive an email from Alert Notification service with information that the HANA Cloud Availability Check has failed. You can see an example email below:

ans-email.png

NOTE: If you also want to receive notifications in a Microsoft Teams channel of your choice, check out the previous blog post for a detailed step-by-step explanation on how to make this configuration.

Wrap-up

In this blog, you've learned to utilize SAP Automation Pilot and SAP Alert Notification service for SAP BTP to effectively monitor the availability of your multi-environment HANA Cloud instances. By using these innovative tools in your daily operations, you can save time, prevent potential disruptions, and ensure your operations continue to run smoothly. If you are interested to learn more about these products and how they can transform your business, please refer to the following sources:

SAP Automation Pilot:

SAP Alert Notification service for SAP BTP:

You can also check out these very useful tutorials prepared by our colleague Dan van Leeuwen:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5 Comments