Auto-Upgrade of SAPHOST-AGENT:

Estimated read time 5 min read

The SAP Host Agent (Version 720 with patch level 45 and higher) provides an automatic upgrade feature. 1473974 – Using the SAP Host Agent Auto Upgrade Feature – SAP for Me

Step-1:

Maintain the below parameters in host profile and restart the Host-agent

DIR_NEW=<path to a directory>

 The directory location containing the new extracted SAP Host Agent version can be changed using this profile value.

 hostexec/autoupgrade_delay=<minutes>

By default, SAP Host Agent performs the check on DIR_NEW five minutes after SAP Host Agent start and then periodically every 60 minutes.

This behavior can be changed using the profile value hostexec/autoupgrade_delay in the SAP Host Agent profile host_profile.

The minimum value can be 1 minute, the maximum value can be ~49 days.

However, the initial wait time (5 minutes by default) will not exceed 5 minutes.

For example

 DIR_NEW = C:tempSAPHOSTAGENT hostexec/autoupgrade_delay = 60

Restart the Hostagent: saphostexec –restart

Step-2:          

Create an empty file “.upgrading” in the location C:tempSAPHOSTAGENT

To avoid that SAP Host Agent starts the upgrade procedure during the extraction of the .SAR (with the consequence that only partially the new version of SAP Host Agent will be used for an upgrade) you should create an empty file called .upgrading in the directory DIR_NEW. SAP Host Agent will not start an Auto Upgrade as long as the .upgrading file is present in DIR_NEW.

Download the latest SAPHOSTAGENT.SAR file in the location C:tempSAPHOSTAGENT

Extract the SAPHOSTAGENT.SAR file by using SAPCAR Executables

SAPCAR –manifest SIGNATURE.SMF –xvf  <SAPHOSTAGENT.SAR>

Create a text file name “.delay” and it contains the below text
              180random120

Step-3:

 It’s 16:00, and a new Host Agent has just been released.
 I want to install the new SAP Host Agent to my landscape, and the upgrade should be delivered during the night, outside of office hours (i.e. 20:00).

hostexec/autoupgrade_delay is not changed. 60 minutes by defaultSAP Host Agents are running for a while alreadyDIR_NEW is emptycontent of “ .delay” is 180random120

 This will delay the upgrade start 3 hours and add a random delay between 0 and 120 minutes on top the random part is 0.5 for this example, which will lead to a 4-hour delay (180 minutes + (120 minutes * 0.5))

The timestamp from which the delay will be calculated is the last modification or creation time of the “.delay” file16:00 create .upgrading file in DIR_NEW16:00 unpack the new SAPHOSTAGENT.SAR into DIR_NEW16:00 create .delay file, content 180random12016:00 projected auto upgrade start at 20:00 (creation time of .delay + 4 hours)16:00 delete the .upgrading file from DIR_NEW17:00 delay not yet expired18:00 delay not yet expired19:00 delay not yet expired20:00 delay expired, auto upgrade starts

Cleanup

After a successful auto upgrade of the landscape, DIR_NEW should be cleaned to prevent further Auto Upgrade checks from the already up-to-date SAP Host Agents. This will greatly reduce the amount of network traffic towards DIR_NEW.

Please leave your valuable input in the comments section below.

Thanks,
Mani

 

 

​ The SAP Host Agent (Version 720 with patch level 45 and higher) provides an automatic upgrade feature. 1473974 – Using the SAP Host Agent Auto Upgrade Feature – SAP for MeStep-1:Maintain the below parameters in host profile and restart the Host-agentDIR_NEW=<path to a directory> The directory location containing the new extracted SAP Host Agent version can be changed using this profile value. hostexec/autoupgrade_delay=<minutes>By default, SAP Host Agent performs the check on DIR_NEW five minutes after SAP Host Agent start and then periodically every 60 minutes.This behavior can be changed using the profile value hostexec/autoupgrade_delay in the SAP Host Agent profile host_profile.The minimum value can be 1 minute, the maximum value can be ~49 days.However, the initial wait time (5 minutes by default) will not exceed 5 minutes.For example DIR_NEW = C:tempSAPHOSTAGENT hostexec/autoupgrade_delay = 60Restart the Hostagent: saphostexec –restartStep-2:          Create an empty file “.upgrading” in the location C:tempSAPHOSTAGENTTo avoid that SAP Host Agent starts the upgrade procedure during the extraction of the .SAR (with the consequence that only partially the new version of SAP Host Agent will be used for an upgrade) you should create an empty file called .upgrading in the directory DIR_NEW. SAP Host Agent will not start an Auto Upgrade as long as the .upgrading file is present in DIR_NEW.Download the latest SAPHOSTAGENT.SAR file in the location C:tempSAPHOSTAGENTExtract the SAPHOSTAGENT.SAR file by using SAPCAR ExecutablesSAPCAR –manifest SIGNATURE.SMF –xvf  <SAPHOSTAGENT.SAR>Create a text file name “.delay” and it contains the below text              180random120Step-3: It’s 16:00, and a new Host Agent has just been released. I want to install the new SAP Host Agent to my landscape, and the upgrade should be delivered during the night, outside of office hours (i.e. 20:00).hostexec/autoupgrade_delay is not changed. 60 minutes by defaultSAP Host Agents are running for a while alreadyDIR_NEW is emptycontent of “ .delay” is 180random120 This will delay the upgrade start 3 hours and add a random delay between 0 and 120 minutes on top the random part is 0.5 for this example, which will lead to a 4-hour delay (180 minutes + (120 minutes * 0.5))The timestamp from which the delay will be calculated is the last modification or creation time of the “.delay” file16:00 create .upgrading file in DIR_NEW16:00 unpack the new SAPHOSTAGENT.SAR into DIR_NEW16:00 create .delay file, content 180random12016:00 projected auto upgrade start at 20:00 (creation time of .delay + 4 hours)16:00 delete the .upgrading file from DIR_NEW17:00 delay not yet expired18:00 delay not yet expired19:00 delay not yet expired20:00 delay expired, auto upgrade startsCleanupAfter a successful auto upgrade of the landscape, DIR_NEW should be cleaned to prevent further Auto Upgrade checks from the already up-to-date SAP Host Agents. This will greatly reduce the amount of network traffic towards DIR_NEW.Please leave your valuable input in the comments section below.Thanks,Mani    Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author