Role start_sap

The role start_sap is used to start one or multiple SAP instances, either for a given SAP system ID (tag -t sap_start_instances) or for all SAP systems that are configured in file /usr/sap/sapservices (tag -t sap_start_all_systems). If a requested SAP instance is already active, the request will be ignored and no error message will be sent. The role start_sap is using the sapcontrol command of the SAP Host Agent as suggested in SAP Note 1763593. It requires that the SAP start services for the selected instances are active. By default, the SAP start services are started automatically when the subsystem QUSRWRK is started. If the SAP start services are not active, they can be started by using this role with the tag -t sap_start_services.

If the role start_sap is used with tag -t sap_start_instances, it needs the SAP system ID as input in variable startsap_input_sap_sid. An SAP instance number can be provided optionally in variable startsap_input_sap_instance_nr. If an instance number is provided, only this instance is started. If no instance number is provided, start_sap will start all configured instances for the given SID, also on remote servers in a distributed landscape. It is recommended that the role start_sap is executed on the logical partition or server that hosts the central services instance (ASCS, SCS), the primary application server instance, or the central instance.

If the role start_sap is used with tag -t sap_start_all_systems, the values in the variables startsap_input_sap_sid and startsap_input_sap_instance_nr are ignored. Instead, all SAP systems that are configured in file /usr/sap/sapservices will be started with all their instances.

If the role start_sap is used with tag -t sap_start_services, you can specify a SAP system ID in variable startsap_input_sap_sid or the special value "*". If you specify "*", SAP start services will be started for all SAP systems that are configured in /usr/sap/sapservices.

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 start services for the requested SAP system must be configured in file /usr/sap/sapservices. In a standard installation, they are started automatically after an IPL when subsystem QUSRWRK is started (autostart job entry SAPINIT). They can be started manually by calling program R3SAP400/SAPINIT or by executing the role start_sap with tag -t sap_start_services.

Tags

Specify one of the following tags to specify what parts of an SAP system you want to start. If you do not specify a tag, -t sap_start_instances will be assumed as default. If you misspell the tag, an error message will be sent.

Tag

Usage

sap_start_instances

One or all instances for a specific SAP system ID are started. The SAP system ID must be specified in variable startsap_input_sap_sid, the instance number can optionally be specified in variable startsap_input_sap_instance_nr.

sap_start_all_systems

All instances are started for all SAP systems that are configured in file /usr/sap/sapservices.

sap_start_services

Start SAP start services for the SAP system ID specified in variable startsap_input_sap_sid or for all SAP systems that are configured in file /usr/sap/sapservices when variable startsap_input_sap_sid is set to "*".

Variables

Variable

Usage

Required

startsap_dir_sapctrl_managednode

Directory path on the target host where the sapcontrol executable is located

Yes 1

startsap_input_sap_sid

SAP system ID or "*"

Yes 2

startsap_input_sap_instance_nr

SAP instance number

No 3

startsap_input_waitforstarted

Timeout in seconds when waiting for instance to be completely started

Yes 1

Remarks:

1(1,2)

Default provided.

2

The variable is only evaluated when the tags -t sap_start_instances or -t sap_start_services are set.

3

The variable is only evaluated when the tag -t sap_start_instances is set. If the variable is omitted, all instances of the specified SAP system ID will be started.

Defaults

Suggested default values are provided in defaults/main.yml:

Variable

Default

startsap_dir_sapctrl_managednode

"/usr/sap/hostctrl/exe"

startsap_input_waitforstarted

"1200"

startsap_env_classicuserconcept

For internal use only

startsap_ordered_list_instance_types

For internal use only

startsap_sapstartsrv_user

For internal use only

Dependencies

None.

Example Playbook

The example playbook is used to start all instances of an SAP system with the SAP system ID (SID) PRD. 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 ASCS instance is installed on host ibmiserver01.mycorp.com, and the SAP start services for SAP system PRD are active on all hosts that have instances for SAP system PRD. The example playbook in the current directory is named start_sap.yml and has the following contents:

- hosts: ibmiserver01.mycorp.com
  vars:
  - startsap_input_sap_sid: "PRD"
  roles:
  - role: <ansible_dir>/roles/start_sap

To execute this playbook, enter the command:

ansible-playbook --verbose start_sap.yml -t sap_start_instances

Note: When using the role start_sap with tag -t sap_start_instances to start instances of an SAP system on several hosts, you only need to execute the role on one host, typically the host that holds the central services instance. When using the role start_sap with tag -t sap_start_services to start the SAP start services, you must execute it on all hosts that hold SAP instances for the specified SAP system.

License

This collection is licensed under the Apache 2.0 license.

Author Information

SAP on IBM Power Development Team