on 03-31-2014 4:52 PM
We have a monthly maintenance window where we patch and reboot all of our SAP instances running on Windows both physical and virtual.
I was checking out SAP LVM 2.0 to see how I could automate the stopping of SAP and rebooting of the servers.
I have created a server reboot script and can execute it from operations tab with no problems.
When I setup an automated task the only options I have is to stop/start/restart SAP.
How can I add my server reboot script as an automation task?
I'm hoping I can setup an automations task to run at a scheduled time where I can stop all my instances, reboot the servers and then start them back up at a scheduled time.
Thanks
Jay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
I am also having same requierment as original post here. To reboot the server after the SAP instance is stopped.
I tried the approach mentioned by you and was able to run the custom hook. And as a post Hook I ran a command "Shutdown -r -f -c Server will be rebooted -t 600" and it worked as expected. After Instance was stopped this Script ran on the server and server was rebooted.
But it is not robust as this hook will just run the script and no feedback or return code will be checked by LVM. to see if the custom hook have restarted the server and have ran successfully or not.
So, I am looking for option if in Automation of Custom hook can we read the response and LVM task is then set as successfull or unsuccessfull accordingly.
Regards,
Amandeep
Hi Christof,
In the meantime I was able to fetch the data from the Custom Hooks.LVM is designed to readt teh response of the cistom hooks. Just you have to be consiuos on the parameters you are using in this hooks to get the response. Follow the SAP note 1396981 - Custom Services Configuration for ACC 7.3/SAP LVM to understand the key words and how to use it.
For example,
the SAPHOSTAGENT configure file should contain the parameters like:
Mode: Sync
ResultConverter: hook
This will make your hook to get the details back to LVM. And in the Script make sure the output somehow mention the keywords (Like RESULT).
For example; Output= System running fine
then in echo you have to mention the result;
echo [RESULT]:%output%
Then the LVM will be able to interpret it as result and shows you in execution log of this script. And somehow you say that if teh script didn't ran correctly and the output should be error.So, somehow you have to add in the echo or output read by the LVM logs the key word. Something like:
echo [ERROR]:Error occurred while rebooting the server.
Here [ERROR] is the key word and your LVM will understand it and in the logs it writes this as log and your the task will go into error. In this way you will be sure whether script executed correctly.
Regards,
Amandeep
Jay,
you can define any specific action as a so-called custom hook to be triggered during the process.
For details, see online help.
Dieter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dieter,
I created a provider implementation definition via Setup - Extensibility.
For this defintion I created a custom operation.
But in Automation - Tasks I can not find my defined operation.
I also defined some hooks which I can see in Operations - Hosts in tab Details at Custom Operations.
But how can I use them automated?
We are on Version Enterprise Edition 2.0 SP04_3.
Regards,
Julia
Hello Julia,
you find custom operations under the "operations" section of LVM under the instance.
Here you can take a look at where to find them:
As for hooks, they are executed as part of an existing process, e.g. when you do a copy and defined a hook for the clone step, the hook will be executed as part of the clone operation.
Take a look at the above document and linked videos.
Kind Regards
Hello Michael,
thanks for your reply and the mentioned hints.
I read your link and I had a look into the youtube videos -> very informative.
But I'm looking for a solution to use own scripts in area automation, which is provided in LVM.
In operation section I can just choose between Start, Stop and Restart. Is it possbile to store own scripts here:
Regards,
Julia
Hello Julia,
no, this is not possible. The only way would be to define a hook for an existing function that would get executed as part of an overall process. e.g. you could modify the start/stop function with a hook and then select start/stop in the automation list. Keep in mind to use constraints to restrict the execution of the hook, otherwise your modified start/stop routine will be used on every start/stop operation.
Michael
Hello Michael,
for Custom Provisioning Processes I can add Hooks via Setup - Extensibility - Custom Provisioning Processes. Here I can add customized hooks to the given labels (Storage Clone, e.g. Restore Backup (Target System)).
But there I don't find a start/stop function. I can just edit functions for Storage Clone or System Rename.
Where do I modify this start/stop function with a hook?
Regards,
Julia
Hello Michael,
ok, if I understand your answer correct process would be as following:
I create a hook via Setup - Extensibility - Custom Hook with hook type "Pre Hook" and Entity Type "Host". There I add a constraint "Process Type (static)" with Operator "=" and Value "Start" (for security reasons I should add constraint Network (static) with value of my operating system, that action is performed only with this system).
If I create a an automation now which uses a sequential operation task with operation type "normal" and operation "Start", my hook will be executed before?!
Regards,
Julia
Hi,
generally yes. BUT 😉 you should define as many constraints as possible. Keep in mind this is the global start function used in every procedure inside LVM so when you modify it your modifications will apply to "EVERY" start operation. To avoid problems, define very restrictive constraints. also please test it in a non productive environment.
Good luck
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.