IBM Cloud Docs
Configuring and performing manual failover for SAP S/4HANA in a multizone region deployment

Configuring and performing manual failover for SAP S/4HANA in a multizone region deployment

The following information provides step-by-step instructions for performing a manual failover of the SAP S/4HANA system. This process helps ensure continued availability of critical services in a multizone deployment on Power Virtual Server instances.

It is intended for cloud architects and SAP specialists who plan high-availability deployments of SAP S/4HANA on Power Virtual Server.

High availability is a critical requirement for enterprise SAP workloads. In a multizone region deployment on Power Virtual Server, redundancy and failover mechanisms help ensure business continuity during planned maintenance or unexpected infrastructure failures.

To achieve high availability, the architecture includes:

Redundant SAP HANA systems
Deploy two SAP HANA instances in separate zones within the same region. Configure the secondary system as a synchronous replica of the primary system to ensure zero data loss and minimal service interruption. This configuration achieves a recovery point objective (RPO) of 0 seconds and a recovery time objective (RTO) of only a few minutes.
SAP Central Services redundancy
Provision two virtual server instances in separate zones to host the ABAP SAP Central Services (ASCS) and the SAP Enqueue Replication Server (ERS). During normal operation, the ASCS instance runs on one server and the ERS instance on the other. If a failure occurs or maintenance is required, the ASCS instance can be manually relocated to the standby server.
Shared file systems
Use File Storage for VPC with regional shares to support SAP instance directories such as SAPMNT and SAPTRANS across zones.

Preparing the SAP S/4HANA system environment

To support manual failover in a multizone region, prepare the SAP S/4HANA environment with the following components.

  • Provision IBM Power Virtual Server workspaces:

    • Create two IBM Power Virtual Server workspaces in separate zones in the same region. In this example, the workspaces are named workspace-1 and workspace-2.
  • Provision virtual server instances on either Red Hat Enterprise Linux (RHEL) or SUSE Linux Enterprise Server (SLES):

    • Ensure that you have a valid subscription for RHEL for SAP Applications, RHEL for SAP Solutions, or SLES for SAP Applications.

    • Create two virtual server instances for SAP HANA. In this example, the hostnames for the SAP HANA instances are prd-db-1 and prd-db-2.

    • Create two virtual server instances for the ASCS and ERS instances. In this example, the hostnames for these instances are prd-cs-1 and prd-cs-2.

    • Distribute each pair across the two IBM Power Virtual Server workspaces to ensure zone-level redundancy.

  • Provision SAP application servers:

    • Provision a virtual server instance for the SAP Primary Application Server (PAS). In this example, the hostname for PAS is prd-as-1.
    • Optionally, deploy SAP Additional Application Server (AAS) instances to support scalability.
  • Configure shared storage:

  • Configure network connectivity:

    • Create a Transit Gateway and attach both IBM Power Virtual Server workspaces to it.
  • Verify user permissions:

    • Ensure that your user account has the required permissions to create and manage static routes in both workspaces.

The following table lists the IP addresses of the virtual server instances that are used in this example configuration.

Sample IP addresses of the virtual server instances
Hostname Workspace Role IP address
prd-db-1 workspace-1 HANA primary 192.168.20.115
prd-cs-1 workspace-1 ASCS 192.168.20.54
prd-as-1 workspace-1 Primary Application Server 192.168.20.97
prd-db-2 workspace-2 HANA secondary 192.168.10.25
prd-cs-2 workspace-2 ERS 192.168.10.8

Preparing the virtual hostnames on the virtual server instances

  • The virtual hostname prd-db is used for communication with the database (DB) server.
  • The ASCS instance is installed with the virtual hostname prd-cs, and the ERS instance is installed with the virtual hostname prd-er.

The following table lists the IP addresses assigned to the SAP instances in this example configuration.

Sample virtual IP addresses of the SAP instances
Virtual hostname Role IP address
prd-cs ASCS 192.168.21.42
prd-er ERS 192.168.21.46
prd-db DB server 192.168.12.102
  • Add the virtual hostnames and corresponding IP addresses to DNS, or configure local name resolution by updating the /etc/hosts file on all instances.

The virtual hostnames correspond to overlay IP addresses within the IBM Power Virtual Server workspaces. These IP addresses fall outside the Classless Inter-Domain Routing (CIDR) ranges that are defined for the workspace subnets.

Configuring the overlay IP address for the ASCS instance

Configure the virtual hostname for the ASCS instance by adding it as an IP alias (secondary IP address) to the network adapter of the virtual server instance.

  1. Log in as user root to the virtual server instance prd-cs-1.

  2. Run the following command to add the overlay IP address to the network adapter env2.

    ip address add 192.168.21.42/32 dev env2
    

Configuring the overlay IP address for the ERS instance

Configure the virtual hostname for the ERS instance by adding it as an IP alias (secondary IP address) to the network adapter of the virtual server instance.

  1. Log in as user root to the virtual server instance prd-cs-2.

  2. Run the following command to add the overlay IP address to the network adapter env2.

    ip address add 192.168.21.46/32 dev env2
    

Configuring the overlay IP address for the DB server

Configure the virtual hostname for the database server by adding it as an IP alias (secondary IP address) to the network adapter of the virtual server instance.

  1. Log in as user root to the virtual server instance prd-db-1.

  2. Run the following command to add the overlay IP address to the network adapter env2.

    ip address add 192.168.12.102/32 dev env2
    

Configuring static routes in the workspaces

The following table shows the static route configuration that is used in this example. Create three routes in each of the two workspaces to enable communication with the overlay IP addresses.

Enable each route only in the workspace where its destination IP address is active.

Sample route configuration
Workspace Route Name Destination Next hop Advertise Status
workspace-1 prd-db-vip-route-zone1 192.168.12.102 192.168.20.115 Enabled Enabled
workspace-1 prd-cs-vip-route-zone1 192.168.21.42 192.168.20.54 Enabled Enabled
workspace-1 prd-er-vip-route-zone1 192.168.21.46 192.168.20.54 Enabled Disabled
workspace-2 prd-db-vip-route-zone2 192.168.12.102 192.168.10.25 Enabled Disabled
workspace-2 prd-cs-vip-route-zone2 192.168.21.42 192.168.10.8 Enabled Disabled
workspace-2 prd-er-vip-route-zone2 192.168.21.46 192.168.10.8 Enabled Enabled

Creating the routes for workspace-1

Follow these steps to create static routes for the virtual IP addresses in workspace-1.

  1. Log in to Power Virtual Server workspaces.
  2. Select workspace-1, and then click View virtual servers.
  3. In the left pane, click Routes.

Create the route for the virtual IP address of the database.

  1. Click Create static route.
  2. Enter prd-db-vip-route-zone1 as the Name.
  3. Enter 192.168.12.102 as the Destination.
  4. Enter 192.168.20.115 as the Next hop.
  5. Keep Advertise and Status set to enabled.
  6. Click Create route.

Create the route for the virtual IP address of the ASCS instance.

  1. Click Create static route.
  2. Enter prd-cs-vip-route-zone1 as the Name.
  3. Enter 192.168.21.42 as the Destination.
  4. Enter 192.168.20.54 as the Next hop.
  5. Keep Advertise and Status set to enabled.
  6. Click Create route.

Create the route for the virtual IP address of the ERS instance.

  1. Click Create static route.
  2. Enter prd-er-vip-route-zone1 as the Name.
  3. Enter 192.168.21.46 as the Destination.
  4. Enter 192.168.20.54 as the Next hop.
  5. Set Advertise to enabled and Status to disabled.
  6. Click Create route.

Creating the routes for workspace-2

Follow these steps to create static routes for the virtual IP addresses in workspace-1.

  1. Log in to Power Virtual Server workspaces.
  2. Select workspace-2, and then click View virtual servers
  3. In the left pane, click Routes.

Create the route for the virtual IP address of the database.

  1. Click Create static route.
  2. Enter prd-db-vip-route-zone2 as the Name.
  3. Enter 192.168.12.102 as the Destination.
  4. Enter 192.168.10.25 as the Next hop.
  5. Set Advertise to enabled and Status to disabled.
  6. Click Create route.

Create the route for the virtual IP address of the ASCS instance.

  1. Click Create static route.
  2. Enter prd-cs-vip-route-zone2 as the Name.
  3. Enter 192.168.21.42 as the Destination.
  4. Enter 192.168.10.8 as the Next hop.
  5. Set Advertise to enabled and Status to disabled.
  6. Click Create route.

Create the route for the virtual IP address of the ERS instance.

  1. Click Create static route.
  2. Enter prd-er-vip-route-zone2 as the Name.
  3. Enter 192.168.21.46 as the Destination.
  4. Enter 192.168.10.8 as the Next hop.
  5. Keep Advertise and Status set to enabled.
  6. Click Create route.

Installing the SAP S/4HANA Server system

To install an SAP S/4HANA system:

  1. Complete planning and preparation.
  2. Install the SAP HANA database.
  3. Use SAP Software Provisioning Manager (SWPM) to install the SAP S/4HANA server.

In this example, the SAP systems are installed with the following configuration.

Sample system configuration
Parameter Value
SAP HANA System ID PRD
SAP HANA InstNo 00
SAP System ID PRD
ASCS InstNo 11
ASCS virtual hostname prd-cs
ERS InstNo 22
ERS virtual hostname prd-er
PAS hostname prd-as-1
PAS InstNo 00

Installing the SAP HANA database servers

Install two SAP HANA systems by using the SAP HANA database lifecycle manager (HDBLCM), and configure SAP HANA System Replication to enable high availability.

The installation of SAP HANA and configuration of HANA System Replication is not specific to the Power Virtual Server environment. Follow the standard SAP HANA installation procedures as documented by SAP.

Mounting the file shares for the ASCS and the ERS instances

Refer to Accessing File Storage for VPC with regional availability from IBM Power Virtual Server instances for instructions on configuring shared storage with regional availability.

Create regional file shares for following NFS file systems:

  • /usr/sap/PRD contains directories for both the ASCS and ERS instances.
  • /sapmnt/PRD hosts the sapmnt share.
  • /usr/sap/trans is required for shared transport directories (saptrans).

Mount the file shares on the virtual server instances prd-cs-1, prd-cs-2, prd-as-1, and eventually on the other application servers.

  1. Log in as the root user to the virtual server instance.

  2. Run the following command to create the mount points for the SAP instance file systems.

    mkdir -p /usr/sap/PRD /sapmnt/PRD
    
  3. Configure the regional file shares in the /etc/fstab file system table.

    Check whether /etc/fstab already contains entries for the sapmnt and usrsap file shares. If not, add the required entries.

    Make sure to adjust the export paths to match your regional file share layout.

    cat >> /etc/fstab << EOT
    mt-sapha-nfs.sapha.com:/DC44A0EC27C6426F90D2CE6DE3155056/SAP_PRD/sapmnt /sapmnt/PRD nfs4 rw,sec=sys,hard,rsize=65536,wsize=65536,namlen=255 0 0
    EOT
    
    cat >> /etc/fstab << EOT
    mt-sapha-nfs.sapha.com:/DC44A0EC27C6426F90D2CE6DE3155056/SAP_PRD/usrsap /usr/sap/PRD nfs4 rw,sec=sys,hard,rsize=65536,wsize=65536,namlen=255 0 0
    EOT
    

    Ensure that duplicate entries are not added to /etc/fstab. Use cat >> only if the entries do not exist.

  4. Run the following commands to mount the file shares.

    mount /usr/sap/PRD
    
    mount /sapmnt/PRD
    

Installing SAP S/4HANA

Install the ASCS and ERS instances for the SAP S/4HANA system on the two designated virtual server instances.

Install the PAS on prd-as-1. During installation, the SAP HANA database tenant is automatically loaded. Optionally, add one or more AAS instances later to support application server availability, scalability, and load distribution.

After installation is complete, start the SAP S/4HANA system and verify that all components are operational.

Configuring the systemd services for the ASCS instance and the ERS instance

Register the ASCS and ERS instance agents with systemd by running the sapstartsrv command with the -reg option. This command performs the following actions:

  • It registers the instance with systemd.
  • It creates the corresponding systemd unit files.
  • It updates the /usr/sap/sapservices configuration file.

To prevent the instance agents from starting automatically after a system restart, disable the systemd units SAPPRD_11.service (ASCS) and SAPPRD_22.service (ERS). This step ensures that both services do not start simultaneously on both nodes, which could lead to conflicts in the high-availability setup.

Configuring the systemd services on the first node

  1. Log in as user root to prd-cs-1.

  2. Set the LD_LIBRARY_PATH environment variable to include the instance executable directory.

    export LD_LIBRARY_PATH=/usr/sap/PRD/ASCS11/exe
    
  3. Check the status of the ASCS systemd service.

    systemctl status SAPPRD_11.service
    
  4. Start the ASCS systemd service.

    systemctl start SAPPRD_11.service
    
  5. Disable the ASCS service to prevent automatic startup.

    systemctl disable SAPPRD_11.service
    
  6. Register the ERS instance.

    /usr/sap/PRD/ASCS11/exe/sapstartsrv -reg pf=/usr/sap/PRD/SYS/profile/PRD_ERS22_prd-er
    
  7. Check the status of the ERS systemd service.

    systemctl status SAPPRD_22.service
    
  8. Stop and disable the ERS systemd service.

    systemctl disable --now SAPPRD_22.service
    

Configuring the systemd services on the second node

  1. Log in as user root to prd-cs-2.

  2. Set the LD_LIBRARY_PATH environment variable to include the instance executable directory.

    export LD_LIBRARY_PATH=/usr/sap/PRD/ERS22/exe
    
  3. Check the status of the ERS systemd service.

    systemctl status SAPPRD_22.service
    
  4. Start the ERS systemd service.

    systemctl start SAPPRD_22.service
    
  5. Disable the ERS service to prevent automatic startup.

    systemctl disable SAPPRD_22.service
    
  6. Register the ASCS instance.

    /usr/sap/PRD/ERS22/exe/sapstartsrv -reg pf=/usr/sap/PRD/SYS/profile/PRD_ASCS11_prd-cs
    
  7. Check the status of the ASCS systemd service.

    systemctl status SAPPRD_11.service
    
  8. Stop and disable the ASCS systemd service.

    systemctl disable --now SAPPRD_11.service
    

Starting the ASCS instance on prd-cs-1

  1. Log in as user prdadm to prd-cs-1.

  2. Start the instance agent.

    sapcontrol -nr 11 -function StartService PRD
    
  3. Start the ASCS instance.

    sapcontrol -nr 11 -function Start
    

Starting the ERS instance on prd-cs-2

  1. Log in as user prdadm to prd-cs-2.

  2. Start the instance agent.

    sapcontrol -nr 22 -function StartService PRD
    
  3. Start the ERS instance.

    sapcontrol -nr 22 -function Start
    

Starting the SAP HANA databases

Starting the HANA database on prd-db-1

  1. Log in as user prdadm to prd-db-1.

  2. Start the SAP HANA system.

    HDB start
    

Starting the HANA database on prd-db-2

  1. Log in as user prdadm to prd-db-2.

  2. Start the SAP HANA system.

    HDB start
    

Verifying the System Replication status on the SAP HANA primary

  1. Log in as user prdadm to prd-db-1.

  2. Check the HANA System Replication status.

    python $DIR_INSTANCE/exe/python_support/systemReplicationStatus.py
    

Verify the current system state:

  • The primary SAP HANA database is running on prd-db-1.
  • The secondary SAP HANA database is running on prd-db-2.
  • SAP HANA System Replication is active and in sync.

Verifying the ASCS and ERS instances

Verify that the ASCS and ERS instances are running on their designated virtual server instances:

  • The ASCS instance is running on prd-cs-1.
  • The ERS instance is running on prd-cs-2.

Starting the SAP application server instance

  1. Log in as user prdadm to prd-as-1.

  2. Start the dialog instance.

    sapcontrol -nr 00 -function Start
    

Verifying log on to the application server

Start an SAP GUI* session and log on to the application server to verify the system status.

Testing manual failover by simulating an outage of the SAP HANA primary

Verifying the System Replication status on the HANA primary

  1. Log in as user prdadm to node prd-db-1.

  2. Check the HANA System Replication status.

    python $DIR_INSTANCE/exe/python_support/systemReplicationStatus.py
    

Verify the current system state:

  • The primary SAP HANA database is running on prd-db-1.
  • The secondary SAP HANA database is running on prd-db-2.
  • SAP HANA System Replication is active and in sync.

Simulating an outage of the SAP HANA primary

  1. Log in as user root to prd-db-1.

  2. Run the following command to trigger an immediate system shutdown.

    echo o > /proc/sysrq-trigger
    

Failing over to the SAP HANA secondary

Disabling the DB server route in workspace workspace-1

  1. Log in to Power Virtual Server workspaces.
  2. Click workspace-1, and then click View virtual servers.
  3. In the left pane, click Routes.
  4. Select prd-db-vip-route-zone1, and then click Edit details.
  5. Toggle Status to Disabled.
  6. Click Edit route to save the changes.

Performing a database takeover on the SAP HANA secondary

  1. Log in as user prdadm to node prd-db-2.

  2. Run the following command to perform a HANA database takeover.

    hdbnsutil -sr_takeover
    
  3. Verify that the system is now running as a primary.

    hdbnsutil -sr_state
    

Adding the overlay IP address to the node

  1. Log in as user root to node prd-db-2.

  2. Run the following command to add the overlay IP address to the network adapter env2.

    ip address add 192.168.12.102/32 dev env2
    

Enabling the DB server route in workspace workspace-2

  1. Log in to Power Virtual Server workspaces.
  2. Click workspace-2, and then click View virtual servers.
  3. In the left pane, click Routes.
  4. Select prd-db-vip-route-zone2, and then click Edit details.
  5. Toggle Status to Enabled.
  6. Click Edit route to save the changes.

Verifying the SAP system status

Open an SAP GUI session to the application server and verify the system status.

Testing manual failover by simulating an outage of the SAP ASCS instance

Simulating an outage of the ASCS instance

  1. Log in as user root to prd-cs-1.

  2. Run the following command to trigger an immediate system shutdown.

    echo o > /proc/sysrq-trigger
    

Performing an ASCS failover to the ERS instance

Disabling the ASCS route in workspace workspace-1

Disable the ASCS route in workspace workspace-1.

  1. Log in to Power Virtual Server workspaces.
  2. Click workspace-1, and then click View virtual servers.
  3. In the left pane, click Routes.
  4. Select prd-cs-vip-route-zone1, and then click Edit details.
  5. Toggle the Status to Disabled.
  6. Click Edit route to save the changes.

Adding the ASCS overlay IP address to the ERS node

  1. Log in as user root to prd-cs-2.

  2. Run the following command to add the virtual IP address to the network adapter env2.

    ip address add 192.168.21.42/32 dev env2
    

Enabling the ASCS route in workspace workspace-2

  1. Log in to Power Virtual Server workspaces.
  2. Click workspace-2, and then click View virtual servers.
  3. In the left pane, click Routes.
  4. Select prd-cs-vip-route-zone2, and then click Edit details.
  5. Toggle Status to Enabled.
  6. Click Edit route to save the changes.

Starting the ASCS instance agent on prd-cs-2

  1. Log in as user root to prd-cs-2.

  2. Run the following command to start the systemd service.

    systemctl start SAPPRD_11.service
    
  3. Log in as user prdadm to prd-cs-2.

  4. Run the following command to start the instance agent.

    sapcontrol -nr 11 -function StartService PRD
    

Starting the ASCS instance on prd-cs-2

  1. Run the following command to start the ASCS instance.

    sapcontrol -nr 11 -function Start
    
  2. Run the following command to verify that the ASCS instance is running.

    sapcontrol -nr 11 -function GetProcessList
    
    GetProcessList
    OK
    name, description, dispstatus, textstatus, starttime, elapsedtime, pid
    msg_server, MessageServer, GREEN, Running, 2025 10 14 09:22:28, 8:58:34, 2106825
    enq_server, Enqueue Server 2, GREEN, Running, 2025 10 14 09:22:28, 8:58:34, 2106826
    

Verifying the SAP system status

Open an SAP GUI* session to the application server and verify the system status.