Generate SAP Application templates for automation
The SAP on Azure Deployment Automation Framework uses a Bill of Materials (BOM) to define the SAP Application. Before you can deploy a system using a custom BOM, you need to also create the templates for the ini-files used in the unattended SAP installation. This guide covers how to create the application templates for an SAP/S4 deployment. The process is the same for the other SAP applications.
Prerequisites
- Get, download, and prepare your SAP installation media and related files if you haven't already done so. Make sure to have the name of the SAPCAR utility file that you downloaded available.
- Prepare your BOM if you haven't already done so. Make sure to have the BOM file that you created available.
- An Azure subscription. If you don't already have an Azure subscription, create a free account.
- An SAP account with permissions to work with the database you want to use.
- Optionally, create a virtual machine (VM) within Azure to use for transferring SAP media from your storage account. This method improves the transfer speed. Make sure you have connectivity between your VM and the target SAP VM. For example, check that your SSH keys are in place.
Check media and tools
Before you generate an SAP Application template, make sure you have all required installation media and tools.
Sign in to your target VM as the root user.
Change the root user password to a known value. You'll use this password later to connect to the SAP Software Provisioning Manager (SWPM).
Make and change to a temporary directory.
mkdir /tmp/workdir; cd $_
Make sure there's a temporary directory for the SAP Application template.
mkdir /tmp/app_template/
Change the permissions for the SAPCAR utility to make this file executable. Replace
<SAPCAR>.EXE
with the name of the file you downloaded. For example,SAPCAR_1311-80000935.EXE
.chmod +x /usr/sap/install/download_basket/<SAPCAR>.EXE
Make sure the installation folder for SWPM exists.
mkdir -p /usr/sap/install/SWPM
Extract the SWPM installation file using the SAPCAR utility.
/usr/sap/install/download_basket/SAPCAR_1311-80000935.EXE -xf /usr/sap/install/SWPM20SP07_0-80003424.SAR -R /usr/sap/install/SWPM/
You can do an unattended SAP installations with parameter files. These files pass all required parameters to the SWPM installer.
Note
To generate the parameter file, you need to partially perform a manual installation. For more information about why, see SAP NOTE 2230669.
Generate ASCS parameter file
To generate your unattended installation parameter file for ASCS:
Sign in to your VM as the root user through your command-line interface (CLI).
Run the command
hostname
to get the host name of the VM from which you're running the installation. Note both the unique hostname (where<example-vm-hostname>
is in the example output), and the full URL for the GUI.Check that you have all necessary media and tools installed on your VM.
Launch SWPM as follows.
Replace
<target-VM-hostname>
with the hostname you previously obtained.Replace
<XML-stack-file-path>
with the XML stack file path that you created. For example,/usr/sap/install/config/MP_STACK_S4_2020_v001.xml
.
/usr/sap/install/SWPM/sapinst \ SAPINST_XML_FILE=<XML-stack-file-path>.xml \ SAPINST_USE_HOSTNAME=<target-VM-hostname> SAPINST_START_GUISERVER=true \ SAPINST_STOP_AFTER_DIALOG_PHASE=true
Connecting to the ASCS VM to launch ******************************************************************************** Open your browser and paste the following URL address to access the GUI https://<example-VM-hostname>.internal.cloudapp.net:4237/sapinst/docs/index.html Logon users: [root] ********************************************************************************
Open your browser and visit the URL for the GUI that you previously obtained.
Accept the security risk warning.
Authenticate with your system's root user credentials.
In the drop-down menu, select SAP S/4HANA Server 2020 > SAP HANA Database > Installation > Application Server ABAP > Distributed System > ASCS Instance.
For Parameter Mode, select Custom. Then, select Next.
Configure the SAP system settings:
Make sure the SAP system identifier is
{SID}
.Make sure the SAP mount directory value is
/sapmnt
.Select Next.
Configure the fully qualified domain name (FQDN) settings:
Make sure the FQDN value populates automatically.
Make sure to enable Set FQDN for SAP system.
Select Next.
Set up a main password, which you only use during the creation of this ASCS instance. You can only use alphanumeric characters and the special characters
#
,$
,@
, and_
for your password. You also can't use a digit or underscore as the first character.Enter a main password.
Confirm the main password.
Select Next.
Configure more administrator settings. Other password fields are pre-populated based on the main password you set.
Set the identifier of the administrator OS user (
<sid>adm
where<sid
> is your SID) to2000
.Set the identifier of the SAP system (
sapsys
) to2000
.Select Next.
When prompted for the SAPEXE kernel file path, enter
/usr/sap/install/download_basket
, then select Next.Make sure the package status is Available, then select Next.
Make sure the SAP Host Agent installation file status is Available, then select Next.
Provide information for the SAP administrator OS user.
Leave the password as inherited from the main password.
Set the OS user identifier to
2100
.Select Next.
Check the installation settings.
Make sure the instance number for the installation is correct.
Make sure to set the virtual host name for the instance.
Select Next.
Keep the ABAP message server port settings. These default settings are
3600
and3900
. Then, `select Next.Don't select any other components to install, then select Next.
Enable Skip setting of security parameters, then select Next.
Enable Yes, clean up operating system users, then select Next.
On Parameter Summary, don't do anything yet.
In the CLI, find your installation configuration file in the temporary SAP installation directory. At this point, the file is called
inifile.params
.Run
ls /tmp/sapinst_instdir/
to list the files in the SAP installation directory.If the file
.lastInstallationLocation
exists, view the file contents and note the directory listed.If a directory for the product that you're installing exists, such as
S4HANA2020
, go to the product folder. For example, runcd /tmp/sapinst_instdir/S4HANA2020/CORE/HDB/INSTALL/HA/ABAP/ASCS/
.
In your browser, in the SWPM GUI, select Cancel. Now, you have the ini files required to build the template that can do an unattended installation of ASCS.
Copy and rename
inifile.params
toscs.inifile.params
in/tmp/app_template
. Replace<path-to-INI-file>
with the path to your INI file as follows:cp <path-to-INI-file>/inifile.params /tmp/app_template/scs.inifile.params
Load database content
Make sure the following settings are in place on the VM before you begin:
Install and configure your HANA and SCS instances. These instances must be online before you complete the database content load.
The
<sid>adm
user you created when you generated the unattended installation file for ASCS must be a member of thesapinst
group.The user identifier for
<sid>adm
must match the value ofhdblcm
. This example uses2000
.The SWPM needs access to
/sapmnt/<SID>/global/
. To configure permissions, runchown <sid>adm:sapsys /sapmnt/<SID>/global
.
Generate database load template
To generate an unattended installation parameter file for the database content load:
Make and change to a temporary directory. Replace
<sid>
with your SID.sudo install -d -m 0777 <sid>adm -g sapinst "/tmp/db_workdir"; cd $_
Launch the SWPM and note the listed URL.
/usr/sap/install/SWPM/sapinst \ SAPINST_XML_FILE=/usr/sap/install/config/MP_STACK_S4_2020_v001.xml
In your browser, visit the URL you noted.
Accept the security risk warning.
Authenticate with your system's root user credentials.
Create a distributed system with custom parameters.
In the drop-down menu, go to SAP S4/HANA Server 2020 > SAP HANA Database > Installation > Application Server ABAP > Distributed System > Database Instance > Distributed System.
Select the Custom parameter mode.
Select Next.
Note the path of the profile directory that the ASCS installation creates. For example,
/usr/sap/<SID>/SYS/profile
where<SID>
is your SID. Then, select Next.Enter the ABAP message server port for your ASCS instance. The port number is
36<InstanceNumber>
, where<InstanceNumber>
is the HANA instance number. For example, if there are zero instances,3600
is the port number. Then, select Next.Enter your main password to use during the installation of database content. Then, select Next.
Make sure the details for the administrator user
<SID>adm
whereSID
is your SID) are correct. Then, select Next.Enter your information for the SAP HANA Database Tenant.
For Database Host, enter the host name of the HANA database VM. To find this host name, go to the resource page in the Azure portal.
For Instance Number, enter the HANA instance number. For example,
00
.Enter an identifier for the new database tenant. For example,
S4H
.Keep the automatically generated password for the database system administrator.
Select Next.
Make sure your connection details are correct. Then, select OK.
Enter your administrator password for the system database. Then, select Next.
Enter the path to your SAPEXE kernel,
/usr/sap/install/download_basket
. Then, select Next.Review which files are available.
Select Next.
Make sure the
SAPHOSTAGENT
file is available.Select Next again.
On the password confirmation page, select Next.
Review that all core HANA database export files are available. Then, select Next.
On Database Schema for
SAPHANADB
, select Next.On Secure Storage for Database Connection, select Next.
On SAP HANA Import Parameters, select Next.
Enter the password for the HANA database administrator (
<SID>adm
) for the database VM. Then, select Next.On SAP HANA Client Software Installation Path, select Next.
Make sure the SAP HANA client file is available. Then, select Next.
Make sure to enable Yes, clean up operating system users. Then, select Next.
On Parameter Summary, don't select anything yet.
Open your CLI and find your installation configuration file.
List the files in your temporary directory,
/tmp/sapinst_instdir/
.Make sure the installation configuration file
inifile.params
is there.If the file
lastInstallationLocation
is there, open the file. Note the directory listed in the file contents.If there's already a directory for the product that you're installing, such as
S4HANA2020
, go to the matching folder. For example,/tmp/sapinst_instdir/S4HANA2020/CORE/HDB/INSTALL/HA/ABAP/DB/
.
Open SWPM again.
Select Cancel. You can now use the unattended method for database content loading.
Copy and rename your installation configuration file as follows. Replace
<path_to_config_file>
with the path to your configuration file.cp <path_to_config_file>/inifile.params /tmp/app_template/db.inifile.params
Check the version of the
sapinst
tool in SWPM./usr/sap/install/SWPM/sapinst -version
If the version of
sapinst
is greater than749.0.6
, also copy the fileskeydb.xml
andinstkey.pkey
to follow SAP Note 2393060. Replace<path_to_config_file>
with the path to your configuration file.cp <path_to_config_file>/{keydb.xml,instkey.pkey} /tmp/app_template/
Generate PAS parameter file
Generate an unattended installation parameter file for use with PAS. These files all begin with inifile
.
Important
You might not see some of these settings in 2020 versions of SAP products. In that case, skip the step.
Connect to your VM through your CLI.
Check that you have all necessary media and tools installed on your VM.
Create and change to a temporary directory. Replace
<SID>
with your SID.sudo install -d -m 0777 <SID>adm -g sapinst "/tmp/pas_workdir"; cd $_
Connect to the node as the root user.
Sign in to the SWPM.
Go to the URL for the SWPM GUI. You got this URL when you generated the unattended installation file for ASCS.
Accept the security warning.
Authenticate with your system's root user credentials.
In the drop-down menu, go to SAP S/4HANA Server 2020 > SAP HANA Database > Installation > Application Server ABAP > Distributed System > Primary Application Server Instance.
On Parameter Settings, select Custom. Then, select Next.
Make sure the Profile Directory is set to
/sapmnt/<SID>/profile/
or/usr/sap/<SID>/SYS/profile
, where<SID>
is your SID. Then, select Next.Set the Message Server Port to
36<instance-number>
, where<instance-number>
is the ASCS instance number. For example,3600
. Then, select Next.Set the main password for all users. Then, select Next.
Wait for the list
below-the-fold-list
to populate. Then, select Next.Make sure to disable the setting Upgrade SAP Host Agent to the version of the provided SAPHOSTAGENT.SAR archive. Then, select Next.
Enter the instance number for the SAP HANA database, and the database system administrator password. Then, select Next.
On Configuration of SAP liveCache with SAP HANA, select Next.
On Database Schema for
DBACOCKPIT
, select Next.On Database Schema for
SAPHANADB
, select Next.On Secure Storage for Database Connection, select Next.
Make sure the PAS instance number and instance host are correct. Then, select Next.
On ABAP Message Server Ports, select Next.
On Configuration of Work Processes, select Next.
On ICM User Management for the SAP Web Dispatcher, select Next.
On SLD Destination for the SAP System OS Level, configure these settings:
Enable No SLD destination. Then, select Next.
Enable Do not create Message Server Access Control List. Then, select Next
Enable Run TMS.
Set user password for TMSADM int Client 000 to the main password. Then, select Next.
Enable No for Import ABAP Transports. Then, select Next.
On Additional SAP System Languages, select Next.
On SAP System DDIC Users, select Next.
On Secure Storage Key Generation, make sure to select Individual Key. Then, select Next.
On the warning screen:
Copy the key identifier and key value.
Store the key identifier and key value securely.
Select Next.
For Clean up operating system users, select Yes. Then, select Next.
In your CLI, open your temporary directory for the installation.
Make sure there's a copy of the parameters file
inifile.params
. For example,/tmp/sapinst_instdir/S4HANA2020/CORE/HDB/INSTALL/DISTRIBUTED/ABAP/APP1/inifile.params
.In SWPM, select Cancel. You can now install PAS through the unattended method.
Copy and rename your PAS parameter file to
pas.inifile.params
in/tmp/app_template
as follows. Replace<path_to_config_file>
with the path to your parameter file.cp <path_to_config_file>/inifile.params /tmp/app_template/pas.inifile.params
Create a copy of
pas.inifile.params
and download to your computer or VM.
Generate additional application servers parameter file
Generate an unattended installation parameter file for use with AAS. These files all begin with inifile
.
Important
You might not see some of these settings in 2020 versions of SAP products. In that case, skip the step.
Connect to your AAS VM through the CLI.
Check that you have all necessary media and tools installed on your VM.
Make sure the group
sapinst
exists.groupadd -g 2000 sapinst
Create a temporary directory for your installation as follows. Replace
<sid>
with your SID.sudo install -d -m 0777 <sid>adm -g sapinst "/tmp/aas_workdir"; cd $_
Sign in to the SWPM.
Go to the URL for the SWPM GUI. You got this URL when you generated the unattended installation file for ASCS.
Accept the security warning.
Authenticate with your system's root user credentials.
In the drop-down menu, SAP S/4HANA Server 2020 > SAP HANA Database > Installation > Application Server ABAP > High-Availability System > Additional Application Server Instance.
On Parameter Settings, select Custom. Then, select Next.
Make sure the Profile Directory is set to
/sapmnt/<SID>/profile/
or/usr/sap/<SID>/SYS/profile
, where<SID>
is your SID. Then, select Next.Set Message Server Port to
36<instance-number>
where<instance-number>
is the ASCS instance number. Then, select Next.Set the main password for all users. Then, select Next.
On Software Package Browser, set Search Directory to
/usr/sap/install/download_basket
. Then, select Next.Wait for the list
below-the-fold-list
to populate. Then, select Next.Make sure to enable Upgrade SAP Host Agent to the version of the provided SAPHOSTAGENT.SAR archive. Then, select Next.
Enter the instance number of your SAP HANA database and the database system administrator password. Then, select Next.
On Configuration of SAP liveCache with SAP HANA, select Next.
On Database Schema for
DBACOCKPIT
, select Next.On Database Schema for
SAPHANADB
, select Next.On Secure Storage for Database Connection, select Next.
Make sure the AAS instance number and instance host are correct. Then, select Next.
On ABAP Message Server Ports, select Next.
On Configuration of Work Processes, select Next.
On ICM User Management for the SAP Web Dispatcher, select Next.
On SLD Destination for the SAP System OS Level, make sure to enable No SLD destination. Then, select Next.
Enable Do not create Message Server Access Control List. Then, select Next.
Enable Run TMS.
Set the password for the user TMSADM in Client 000 to the main password. Then, select Next.
Set SPAM/SAINT Update Archive to
/usr/sap/install/config/KD75371.SAR
.Set Import ABAP Transports to No. Then, select Next.
On Preparing for the Software Update Manager Screen, enable Extract the SUM.SAR Archive*. Then, select Next.
On Software Package Browser, select the table Detected Packages. If the individual package location for SUM 2.0 is empty, set the package path to
usr/sap/install/config
. Then, select Next.Wait for the package location to populate. Then, select Next.
On Additional SAP System Languages, select Next.
Make sure to enable Yes, clean up operating system users. Then, select Next.
Through the CLI, check that your temporary directory now has a copy of the parameter file. For example,
/tmp/sapinst_instdir/S4HANA2020/CORE/HDB/INSTALL/AS/APPS/inifile.params
.Copy and rename the file to
aas.inifile.params
in/tmp/app_template
as follows. Replace<path_to_inifile>
with the path to your parameter file.cp <path_to_inifile>/inifile.params /tmp/app_template/aas.inifile.params
Create a copy of
aas.inifile.params
and download to your computer or VM.In SWPM, select Cancel. You can now do the AAS installation through the unattended method.
Combine parameter files
You can combine your parameter files, which all end with inifile.params
, into one file for the installation process.
Create combination file
To create a file that combines all your parameters:
If you haven't already, download each parameter file you created (ASCS, PAS, and AAS). You need these files on the computer or VM from which you're working.
Make a backup of each parameter file.
Create a new combination file. Name this file for the SAP product that you're using. For example,
S4HANA_2020_ISS_v001.inifile.params
.Open the ASCS parameter file (
scs.inifile.params
) in an editor.Copy the header of the ASCS parameter file into the combination file. For example:
######################################################################################################################### # # # Installation service 'SAP S/4HANA Server 2020 > SAP HANA Database > Installation # # > Application Server ABAP > Distributed System > ASCS Instance', product id 'NW_ABAP_ASCS:S4HANA2020.CORE.HDB.ABAP' # # # #########################################################################################################################
For each
inifile.params
file you have, copy the product identifier line from the header. Then, copy the product identifiers into the header of your combination file. For example:############################################################################################################################################# # # # Installation service 'SAP S/4HANA Server 2020 > SAP HANA Database > Installation # # > Application Server ABAP > Distributed System > ASCS Instance', product id 'NW_ABAP_ASCS:S4HANA2020.CORE.HDB.ABAP' # # > Application Server ABAP > Distributed System > Database Instance', product id 'NW_ABAP_DB:S4HANA2020.CORE.HDB.ABAP' # # > Application Server ABAP > Distributed System > Primary Application Server Instance', product id 'NW_ABAP_CI:S4HANA2020.CORE.HDB.ABAP' # # > Additional SAP System Instances > Additional Application Server Instance', product id 'NW_DI:S4HANA2020.CORE.HDB.PD' # # # #############################################################################################################################################
Open your
bom.yml
file in an editor.Copy the sections for
product_ids
into your combination file.For each
inifile.params
file you have, copy the product identifier from the header into the appropriate part ofproduct_ids
. For example, copy your ASCS toscs
:product_ids: scs: "NW_ABAP_ASCS:S4HANA2020.CORE.HDB.ABAP" db: "" pas: "" aas: "" web: ""
Remove any lines that you commented out or left blank.
Save your combination file.
Improve readability
Next, improve the readability of your combination file:
Open your combination file in an editor.
Sort all lines not in the header.
Remove any duplicated lines.
Align all the equals signs. For example:
archives.downloadBasket = /usr/sap/install/download_basket HDB_Schema_Check_Dialogs.schemaName = SAPHANADB HDB_Schema_Check_Dialogs.schemaPassword = MyDefaultPassw0rd HDB_Userstore.doNotResolveHostnames = x00dx0000l09d4
Separate the lines by prefixes. For example,
NW_CI_Instance.*
andNW_HDB_DB.*
.Update the following lines to use Ansible variables:
archives.downloadBasket = {{ download_basket_dir }}
HDB_Schema_Check_Dialogs.schemaPassword = {{ main_password }}
HDB_Userstore.doNotResolveHostnames = {{ hdb_hostname }}
hostAgent.sapAdmPassword = {{ main_password }}
NW_AS.instanceNumber = {{ aas_instance_number }}
NW_checkMsgServer.abapMSPort = 36{{ scs_instance_number }}
NW_CI_Instance.ascsVirtualHostname = {{ scs_hostname }}
NW_CI_Instance.ciInstanceNumber = {{ pas_instance_number }}
NW_CI_Instance.ciMSPort = 36{{ scs_instance_number }}
NW_CI_Instance.ciVirtualHostname = {{ pas_hostname }}
NW_CI_Instance.scsVirtualHostname = {{ scs_hostname }}
NW_DI_Instance.virtualHostname = {{ aas_hostname }}
NW_getFQDN.FQDN = {{ sap_fqdn }}
NW_GetMasterPassword.masterPwd = {{ main_password }}
NW_GetSidNoProfiles.sid = {{ app_sid | upper }}
NW_HDB_DB.abapSchemaPassword = {{ main_password }}
NW_HDB_getDBInfo.dbhost = {{ hdb_hostname }}
NW_HDB_getDBInfo.dbsid = {{ hdb_sid | upper }}
NW_HDB_getDBInfo.instanceNumber = {{ hdb_instance_number }}
NW_HDB_getDBInfo.systemDbPassword = {{ main_password }}
NW_HDB_getDBInfo.systemid = {{ hdb_sid | upper }}
NW_HDB_getDBInfo.systemPassword = {{ main_password }}
NW_readProfileDir.profileDir = /usr/sap/{{ app_sid | upper }}/SYS/profile
NW_Recovery_Install_HDB.extractLocation = /usr/sap/{{ hdb_sid | upper }}/HDB{{ hdb_instance_number }}/backup/data/DB_{{ hdb_sid | upper }}
NW_Recovery_Install_HDB.sidAdmName = {{ hdb_sid | lower }}adm
NW_Recovery_Install_HDB.sidAdmPassword = {{ main_password }}
NW_SAPCrypto.SAPCryptoFile = {{ download_basket_dir }}/SAPEXE_300-80004393.SAR
NW_SCS_Instance.instanceNumber = {{ scs_instance_number }}
NW_Unpack.igsExeSar = {{ download_basket_dir }}/igsexe_12-80003187.sar
NW_Unpack.igsHelperSar = {{ download_basket_dir }}/igshelper_17-10010245.sar
NW_Unpack.sapExeDbSar = {{ download_basket_dir }}/SAPEXEDB_300-80004392.SAR
NW_Unpack.sapExeSar = {{ download_basket_dir }}/SAPEXE_300-80004393.SAR
NW_SCS_Instance.scsVirtualHostname = {{ scs_hostname }}
nwUsers.sapadmUID = {{ sapadm_uid }}
nwUsers.sapsysGID = {{ sapsys_gid }}
nwUsers.sidadmPassword = {{ main_password }}
nwUsers.sidAdmUID = {{ sidadm_uid }}
storageBasedCopy.hdb.instanceNumber = {{ hdb_instance_number }}
storageBasedCopy.hdb.systemPassword = {{ main_password }}
Upload combination file
Finally, upload your combined template file to your SAP Library.
Sign in to the Azure portal.
Select or search for Storage accounts.
Select the storage account for your SAP Library.
In the storage account menu, under Data storage, select Containers.
Select the
sapbits
container.Go to the product folder for your BOM in
sapbits
. For example,boms/S4HANA_2020_ISS_v001
.If you don't already have a directory called templates, create this directory.
Open the templates directory.
Select Upload.
In the pane, select Select a file.
Select the combined template file. For example,
S4HANA_2020_ISS_v001.inifile.params
.Select Upload.
Update BOM with templates
After combining your parameter files, update your BOM with the new template files.
Open
bom.yml
.In the section
templates
, add your new template file names. For example:templates: - name: "S4HANA_2020_ISS_v001 ini file" file: S4HANA_2020_ISS_v001.inifile.params override_target_location: "{{ target_media_location }}/config"
If you're using the scripted application BOM preparation, remove the
#
before the template.Save your changes.
Then, upload the new BOM file to your SAP Library.
Sign in to the Azure portal.
Select or search for Storage accounts.
Select the storage account for your SAP Library.
In the storage account menu, under Data storage, select Containers.
Select the
sapbits
container.Go to the product folder for your BOM in
sapbits
. For example,boms/S4HANA_2020_ISS_v001
.Open the
boms
directory.Select Upload.
In the pane, select Select a file.
Select your BOM file,
bom.yml
, from your computer or VM.Make sure to enable Overwrite if files already exist.
Select Upload.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for