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: 
shraddhashetty
Product and Topic Expert
Product and Topic Expert
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 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 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.

FAQ

Please share your valuable feedback!

 

 

 
20 Comments
Martin-Pankraz
Active Contributor
0 Kudos
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
timkreis
Member
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
Dan_vL
Product and Topic Expert
Product and Topic Expert
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
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
ravicondamoor
Advisor
Advisor
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.
shraddhashetty
Product and Topic Expert
Product and Topic Expert
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
David_B
Explorer
0 Kudos
Hi,

Is it possible, now, to start and stop HANA at subaccount Level ?

Regards,

David Bizien
mohit_bansal3
Active Participant
Hi  shraddhashetty , Thanks for this detailed blog. I have quick issue while testing the above scenarios.

I have setup the Automation Pilot in Singapore Region(ap21) and Hana cloud instance in other sub account(us10). We are giving the HANA Cloud Instance ID as below and getting the error : "Service instance with ID 'instance of GUID' was not found.

Appreciate your suggestion, in case it is some limitation or some thing missed from my side.

 

Regards,

Mohit

 

 

 

 

 
joonchul_jung
Discoverer
0 Kudos

Hi,

Thanks for very valuable contents.

Is it possible to add multiple instance ID in Input so that multiple HANA instances are started/stopped at a command?

Best Regards,
Joonchul
0 Kudos

Hello joonchul.jung,

Thank you for your question!

Yes, it is possible to start/stop multiple HANA instances at one command. We have an example how this works in our samples repository in GitHub. You can directly import the content in your Automation Pilot tenant and use the command afterwards. If you have any further questions, do not hesitate to ask here or write to support dot autopilot at groups dot sap dot com.

Best regards,

Antoniya
Automation Pilot Team

0 Kudos

Dear David,

I'm delighted to inform you that starting and stopping HANA Cloud at the subaccount level is now possible through the utilization of the Service Manager catalog within Automation Pilot. In the near future, we will be sharing an example in our GitHub samples repository that demonstrates how this can be achieved. Please don't hesitate to reach out if you have any further inquiries.

Best regards,

Antoniya Tsoneva

Automation Pilot Team

bhargab_sarma
Discoverer
0 Kudos
I also have the same question. Do you have any inputs?
0 Kudos
Hello bhargab.sarma,

I am happy to share with you that we have a GitHub repository that contains example Automation Pilot commands which demonstrate the automation of various scenarios such as Start/Stop Hana Cloud Databases.  However, without knowing the specifics of your problem, I encourage you to explore the repository and refer to the provided example. If you have any specific questions or require further clarification, please feel free to reach out to us via email (support dot autopilot at groups dot sap dot com).

Best regards,

Antoniya
Automation Pilot Team
Incture
Explorer
0 Kudos
Hi Antoniya,

 

I have Automation Pilot in Singapore region and Hana Cloud instance in US region in trial account, I am getting this error "Service instance with ID '<hana cloud instance id>' was not found,

 

Regards,

Bhargab
0 Kudos

Hello Bhargab,

Please ensure that you have provided the correct instance ID for your HANA Cloud instance and check that you have followed the example in repository correctly. If the issue persists or if you have further questions, please provide more details for better assistance.

Kind regards,

Antoniya
Automation Pilot Team

bhargab_sarma
Discoverer
0 Kudos
Hi Antoniya,

This is the exact error I got "Service instance with ID '8d09e073-c875-4e24-bb69-4ca2d6d3cfc3' was not found" and I have followed all the steps mentioned in the blog.

Attaching the screenshot of the instance ID.


 

Regards,

Bhargab
0 Kudos
Hello Bhargab,

I will suggest to schedule a brief Teams call to discuss the problems you are experiencing and provide immediate assistance. Please let me know your availability, preferred date, and time for the call, and I will promptly schedule it.

Kind regards,

Antoniya
Dan_vL
Product and Topic Expert
Product and Topic Expert
Another resource that may be of interest is the tutorial group Automating SAP HANA Cloud Tasks which demonstrates how to use the BTP and CF CLIs as well as the SAP Automation Pilot to perform SAP HANA Cloud administrative actions such as start/stop/create/delete/update/upgrade etc.
Wiebke
Newcomer
I had problems with the inputs. I got the error Space '<spacename>' was not found in organization. The problem was that the region wasn't set correctly. I found this example and then it worked.


trimbandaru
Participant
Hi Mohit Bansal

 

I am also in the same boat where I have HANA Cloud in US-10 and Automation Pilot in ap21 region.

getting the hana db instance not found. I tried with name and ID as well.


Did you find any solution so far?

 

Please let us know if any resolution  shraddhashetty

Thanks

-Trim