Role upgrade_sap_kernel
The role upgrade_sap_kernel is used to upgrade the kernel of an already installed SAP system with new code that has been downloaded from the SAP Software Distribution Center (SWDC) in SAP Archive (SAR) files. The SAR files must be available in the download directory that is specified in variable upgsapkrn_dir_download_managednode
. In a distributed landscape, it is recommended to share the download directory across all servers or logical partitions of that landscape. The role uses the tool APYSIDKRN, which is documented in SAP Note 1632755. It will apply the contents of all SAR files that are provided in the download directory. It is your responsibility to ensure that the downloaded SAR files are compatible with your SAP system and database.
You can either replace one or a few components of an SAP kernel, for example applying a new dw patch, or you can replace the complete kernel, for example with a new stack kernel or even a new release. If you are replacing the currently installed kernel with code of the same release and build level, variable upgsapkrn_input_upgrade_mode
defines how to proceed: A value of "ADD"
specifies that only the provided components are being replaces, a value of "FULLY"
specifies, that the existing kernel is deleted and completely replaced with the contents of the downloaded SAR files.
If instance-specific directories are used for executables (see SAP Note 1632754), the new kernel will only be activated when stopping and starting the instances.
The role upgrade_sap_kernel needs the SAP System ID as input in variable upgsapkrn_input_sap_sid
.
By specifying a tag, you define if you are replacing the currently installed kernel with code of the same release and build level (-t sap_kernel_upgrade_same_release
) or with code at a different release or build level (-t sap_kernel_upgrade_new_release
). SAP is marking different build levels in the same release with additions like “EXT” or “EX2”. The default is -t sap_kernel_upgrade_same_release
.
Log files from the tool APYSIDKRN will be stored in directory /sapmnt/<sid>/patches/log. If you execute the role upgrade_sap_kernel frequently, you may want to cleanup this directory from time to time to save space on disk.
Table of contents
Requirements
This role is intended for the operating system IBM i. The target system must be enabled to execute Ansible playbooks. For details, see the prerequisites section in Ansible Content for IBM Power Systems - IBM i with SAP Software.
The SAP system must be configured to use the “New User Concept” as described in SAP Note 1123501.
The role upgrade_sap_kernel will install the contents of all SAR files in the download directory specified in variable upgsapkrn_dir_download_managednode
. It is the responsibility of the user to ensure that the download directory contains all necessary patches for the required upgrade mode ("ADD"
or "FULLY"
).
Variables
Variable |
Usage |
Required |
---|---|---|
|
SAP system ID |
Yes |
|
Directory for temporarily storing a script that is needed to execute the APYSIDKRN command |
Yes 1 |
|
Download directory that contains the SAR files with the new kernel components to be installed. To avoid runtime errors, the length of the path name should not exceed 220 characters. |
Yes 1 |
|
Directory for temporarily extracting the ILETOOLS archive. |
Yes 1 |
|
Upgrade mode: “ADD” or “FULLY”. This value is ignored when the tag
|
Yes 2 |
|
Path name to the SAPCAR tool |
Yes 1 |
|
File name of the SAPCAR tool |
Yes 1 |
Remarks:
Defaults
Suggested default values are provided in defaults/main.yml:
Variable |
Default |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Dependencies
None.
Example Playbook
The example playbook is used to replace the existing kernel of SAP system PRD with a new stack kernel in the same release on several hosts. It is based on the assumption that a configuration file and an inventory file with contents similar to the configuration documentation exist in the current directory. The necessary archives must have been downloaded from the SAP Software Distribution Center and stored in directory /tmp/downloads/kernel. The playbook is located in the current directory, named replace_kernel_in_same_release.yml and has the following contents:
- hosts: ibmi_servers
vars:
- upgsapkrn_input_sap_sid: "PRD"
- upgsapkrn_input_upgrade_mode: "FULLY"
roles:
- role: <ansible_dir>/roles/upgrade_sap_kernel
To execute this playbook, enter the command:
ansible-playbook --verbose replace_kernel_in_same_release.yml -t sap_kernel_upgrade_same_release
License
This collection is licensed under the Apache 2.0 license.
Copyright
Copyright IBM Corporation 2021,2022