Skip to Content
Technical Articles
Author's profile photo Shraddha Shetty

Automation Pilot : Start & Stop HANA Instance, Schedule Executions on Automation Pilot

This blog provides the command to start and stop the SAP HANA Instance and also schedule to do the same in a timely manner. This blog aims to provide an approach on how one can automate the uptime of a SAP HANA Cloud instance which reduces operational costs. Scheduling the HANA Start/Stop sample shows how to reduce the manual effort & reliable execution by automation.

You can read more on SAP Automation Pilot (here).

Pre-requisites :

Open the Automation Pilot from your BTP subaccount.

 

Dashboard%20of%20Automation%20Pilot

Dashboard of Automation Pilot

Note : You can create a Catalog and clone the existing commands provided by Automation Pilot for easier access or skip to Step 2 to proceed with creating inputs and trigger the command directly.

Step 1: Lets set up the command and inputs in a catalog. Create a new catalog.

Create a new catalog

Once the catalog is created, we have to add the commands and inputs into it. You can already view some of the predefined commands that exists in the Automation Pilot by going to the commands section.

Predefined%20Commands

Predefined Commands

Search for “StartHanaCloudInstance” and choose the one below.

 

You can click on clone the “StartHanaCloudInstance”  

Select the catalog that was created and add this cloned command into the StartStop Catalog.

Repeat the same steps to do the same for StopHanaCloudInstance command and add it to the StartStop Catalog.

Step 2: Now, create an input to store the connection details for an SAP HANA Cloud database.

Add the keys and assign the respective values to the keys.

Values that must be assigned are as follows:

Region – your region details ( eg: cf-eu10 )

subAccount – the name of your Cloud Foundry ORGANIZATION

resourceGroup – the name your Cloud Foundry CF SPACE

resourceName – the name of your HANA SERVICE INSTANCE

user – Your technical user’s email address

password – Your technical user’s password

Note : When storing a password. always turn on the sensitive option.

Note : For SAP Users, you can create a p-user(here). Also when using the p-user, add this user in Global account level, Subaccount level, add as Org members in Cloud Foundry level. 

Step 3: In the newly created command clone, Go to ‘StartHanaCloudInstanceClone’ & select input and add an additional value which is the StartStopInputs input.

Assign the values below

Step 4: Now add an executor

Click on ‘Here’ & Add the below values,

Step 5: Now once you have the inputs and executor ready. Trigger the execution

Step 6: Select the StartStopInputs for Inputs and all the values will be automatically assigned to its respective fields. Click on trigger.

You can see the status and the progress of the execution of the command.

Step 7: Check the SAP HANA Cloud Central to see if the HANA cloud instance has been started.

Once the execution is finished successfully, you will see the below

 

Step 8: Perform the same steps to do the StopHANACloudInstance

  • Clone the existing command from the command list
  • Add the input keys
  • Add the executor called “StopHANA”

You can use the same inputs i.e.  StartStopInputs

Once you click on the trigger, it will execute to stop the SAP HANA Cloud instance.

 

Check the SAP HANA Cloud central to see the status, it will be as shown in the below image.

Schedule Executions

You can also schedule the above commands to execute on a desired time period. Scheduling the execution can help to reduce the active running time of SAP HANA Cloud instances to the working hours of the developers. This can reduce the operational costs of running database.

Create a new schedule and provide the command details and user input details.

Schedule as per needed

You can now schedule the start and stop of SAP HANA Cloud instances as per needed and it will run the jobs accordingly.

Quick links : You can also follow the below tutorial to get more hands on with Automation Pilot. The below tutorial explains an approach to schedule SQL statements which are run against an SAP HANA Cloud database.

Please share your valuable feedback!

 

 

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Martin Pankraz
      Martin Pankraz

      Interesting! How about ERP and any-premise Hana?

      @Community have a look here to learn more about self-service snoozing. By the way the Azure Automation Account is supported by the SAP Private Link for some months now. You might trigger the SAP snoozing scripts from any BTP app.

      KR

      Martin

      Author's profile photo Tim Kreis
      Tim Kreis

      We´re having trouble getting this to work.

      We have deployed our SAP HANA Cloud Instance on subaccount level and not in a space. Is there something we have to do different or is it just not possible at all?

      Additionally when adding a executor to a command we get the flipped command inside the config-overlay. So the Executor from the StartHana command can only get the StopHana command and vice versa.

       

      Kr

      Tim

      Author's profile photo Daniel Van Leeuwen
      Daniel Van Leeuwen

      One other option to consider is to use the SAP BTP CLI to start and stop your HANA Cloud instances that are deployed on the subaccount level.  An example of the steps to do this is available at Manage SAP HANA Cloud using the BTP CLI.

      Hope that helps,
      Dan van Leeuwen

      Author's profile photo Kaloyan Simitchiyski
      Kaloyan Simitchiyski

      Hi Tim,

       

      Automation Pilot supports the management of HANA Cloud on space level only. We are exploring the possibility to extend this to subaccount level as well. I'll reply back to you once this is available.

      Regarding your second remark, this sounds like a potential bug. Let's communicate over email to gather more context and solve your issue. You can contact me (kaloyan.simitchiyski at sap dot com) and Biser Simeonov (biser.simeonov at sap dot com).

       

      Best regards,

      Kaloyan

      Author's profile photo Ravi Condamoor
      Ravi Condamoor

      Instead of

      user – Your technical user’s email address

      password – Your technical user’s passwordc

      can I create a temporary account to be explicitly used for Automation Pilot?  My whole team has access to the subaccount and Automation Pilot instance and I don't want to expose my personal info.

      Author's profile photo Shraddha Shetty
      Shraddha Shetty
      Blog Post Author

      Hi Ravi,

      Yes you should create a technical account to use SAP Automation Pilot. This user has to be treated the same way as your other users in your subaccount which has the right roles and entitlements.

      Best,

      Shraddha