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
SAPMNTandSAPTRANSacross 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-1andworkspace-2.
- Create two IBM Power Virtual Server workspaces in separate zones in the same region. In this example, the workspaces are named
-
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-1andprd-db-2. -
Create two virtual server instances for the ASCS and ERS instances. In this example, the hostnames for these instances are
prd-cs-1andprd-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.
- Provision a virtual server instance for the SAP Primary Application Server (PAS). In this example, the hostname for PAS is
-
Configure shared storage:
- Provision a regional file share for the SAP instance file systems, including the
SAPMNTandSAPTRANSshares. 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. In this example, the DNS name for the mount target of the regional file share ismt-sapha-nfs.sapha.com, and the name of the share is/DC44A0EC27C6426F90D2CE6DE3155056.
- Provision a regional file share for the SAP instance file systems, including the
-
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.
| 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-dbis 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 hostnameprd-er.
The following table lists the IP addresses assigned to the SAP instances in this example configuration.
| 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/hostsfile 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.
-
Log in as user
rootto the virtual server instanceprd-cs-1. -
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.
-
Log in as user
rootto the virtual server instanceprd-cs-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.
-
Log in as user
rootto the virtual server instanceprd-db-1. -
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.
| 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.
- Log in to Power Virtual Server workspaces.
- Select workspace-1, and then click View virtual servers.
- In the left pane, click Routes.
Create the route for the virtual IP address of the database.
- Click Create static route.
- Enter prd-db-vip-route-zone1 as the Name.
- Enter 192.168.12.102 as the Destination.
- Enter 192.168.20.115 as the Next hop.
- Keep Advertise and Status set to enabled.
- Click Create route.
Create the route for the virtual IP address of the ASCS instance.
- Click Create static route.
- Enter prd-cs-vip-route-zone1 as the Name.
- Enter 192.168.21.42 as the Destination.
- Enter 192.168.20.54 as the Next hop.
- Keep Advertise and Status set to enabled.
- Click Create route.
Create the route for the virtual IP address of the ERS instance.
- Click Create static route.
- Enter prd-er-vip-route-zone1 as the Name.
- Enter 192.168.21.46 as the Destination.
- Enter 192.168.20.54 as the Next hop.
- Set Advertise to enabled and Status to disabled.
- Click Create route.
Creating the routes for workspace-2
Follow these steps to create static routes for the virtual IP addresses in workspace-1.
- Log in to Power Virtual Server workspaces.
- Select workspace-2, and then click View virtual servers
- In the left pane, click Routes.
Create the route for the virtual IP address of the database.
- Click Create static route.
- Enter prd-db-vip-route-zone2 as the Name.
- Enter 192.168.12.102 as the Destination.
- Enter 192.168.10.25 as the Next hop.
- Set Advertise to enabled and Status to disabled.
- Click Create route.
Create the route for the virtual IP address of the ASCS instance.
- Click Create static route.
- Enter prd-cs-vip-route-zone2 as the Name.
- Enter 192.168.21.42 as the Destination.
- Enter 192.168.10.8 as the Next hop.
- Set Advertise to enabled and Status to disabled.
- Click Create route.
Create the route for the virtual IP address of the ERS instance.
- Click Create static route.
- Enter prd-er-vip-route-zone2 as the Name.
- Enter 192.168.21.46 as the Destination.
- Enter 192.168.10.8 as the Next hop.
- Keep Advertise and Status set to enabled.
- Click Create route.
Installing the SAP S/4HANA Server system
To install an SAP S/4HANA system:
- Complete planning and preparation.
- Install the SAP HANA database.
- 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.
| 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/PRDcontains directories for both the ASCS and ERS instances./sapmnt/PRDhosts the sapmnt share./usr/sap/transis 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.
-
Log in as the
rootuser to the virtual server instance. -
Run the following command to create the mount points for the SAP instance file systems.
mkdir -p /usr/sap/PRD /sapmnt/PRD -
Configure the regional file shares in the
/etc/fstabfile system table.Check whether
/etc/fstabalready 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 EOTcat >> /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 EOTEnsure that duplicate entries are not added to
/etc/fstab. Usecat >>only if the entries do not exist. -
Run the following commands to mount the file shares.
mount /usr/sap/PRDmount /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
-
Log in as user
roottoprd-cs-1. -
Set the
LD_LIBRARY_PATHenvironment variable to include the instance executable directory.export LD_LIBRARY_PATH=/usr/sap/PRD/ASCS11/exe -
Check the status of the ASCS systemd service.
systemctl status SAPPRD_11.service -
Start the ASCS systemd service.
systemctl start SAPPRD_11.service -
Disable the ASCS service to prevent automatic startup.
systemctl disable SAPPRD_11.service -
Register the ERS instance.
/usr/sap/PRD/ASCS11/exe/sapstartsrv -reg pf=/usr/sap/PRD/SYS/profile/PRD_ERS22_prd-er -
Check the status of the ERS systemd service.
systemctl status SAPPRD_22.service -
Stop and disable the ERS systemd service.
systemctl disable --now SAPPRD_22.service
Configuring the systemd services on the second node
-
Log in as user
roottoprd-cs-2. -
Set the
LD_LIBRARY_PATHenvironment variable to include the instance executable directory.export LD_LIBRARY_PATH=/usr/sap/PRD/ERS22/exe -
Check the status of the ERS systemd service.
systemctl status SAPPRD_22.service -
Start the ERS systemd service.
systemctl start SAPPRD_22.service -
Disable the ERS service to prevent automatic startup.
systemctl disable SAPPRD_22.service -
Register the ASCS instance.
/usr/sap/PRD/ERS22/exe/sapstartsrv -reg pf=/usr/sap/PRD/SYS/profile/PRD_ASCS11_prd-cs -
Check the status of the ASCS systemd service.
systemctl status SAPPRD_11.service -
Stop and disable the ASCS systemd service.
systemctl disable --now SAPPRD_11.service
Starting the ASCS instance on prd-cs-1
-
Log in as user
prdadmtoprd-cs-1. -
Start the instance agent.
sapcontrol -nr 11 -function StartService PRD -
Start the ASCS instance.
sapcontrol -nr 11 -function Start
Starting the ERS instance on prd-cs-2
-
Log in as user
prdadmtoprd-cs-2. -
Start the instance agent.
sapcontrol -nr 22 -function StartService PRD -
Start the ERS instance.
sapcontrol -nr 22 -function Start
Starting the SAP HANA databases
Starting the HANA database on prd-db-1
-
Log in as user
prdadmtoprd-db-1. -
Start the SAP HANA system.
HDB start
Starting the HANA database on prd-db-2
-
Log in as user
prdadmtoprd-db-2. -
Start the SAP HANA system.
HDB start
Verifying the System Replication status on the SAP HANA primary
-
Log in as user
prdadmtoprd-db-1. -
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
-
Log in as user
prdadmtoprd-as-1. -
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
-
Log in as user
prdadmto nodeprd-db-1. -
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
-
Log in as user
roottoprd-db-1. -
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
- Log in to Power Virtual Server workspaces.
- Click workspace-1, and then click View virtual servers.
- In the left pane, click Routes.
- Select prd-db-vip-route-zone1, and then click Edit details.
- Toggle Status to Disabled.
- Click Edit route to save the changes.
Performing a database takeover on the SAP HANA secondary
-
Log in as user
prdadmto nodeprd-db-2. -
Run the following command to perform a HANA database takeover.
hdbnsutil -sr_takeover -
Verify that the system is now running as a primary.
hdbnsutil -sr_state
Adding the overlay IP address to the node
-
Log in as user
rootto nodeprd-db-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
- Log in to Power Virtual Server workspaces.
- Click workspace-2, and then click View virtual servers.
- In the left pane, click Routes.
- Select prd-db-vip-route-zone2, and then click Edit details.
- Toggle Status to Enabled.
- 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
-
Log in as user
roottoprd-cs-1. -
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.
- Log in to Power Virtual Server workspaces.
- Click workspace-1, and then click View virtual servers.
- In the left pane, click Routes.
- Select prd-cs-vip-route-zone1, and then click Edit details.
- Toggle the Status to Disabled.
- Click Edit route to save the changes.
Adding the ASCS overlay IP address to the ERS node
-
Log in as user
roottoprd-cs-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
- Log in to Power Virtual Server workspaces.
- Click workspace-2, and then click View virtual servers.
- In the left pane, click Routes.
- Select prd-cs-vip-route-zone2, and then click Edit details.
- Toggle Status to Enabled.
- Click Edit route to save the changes.
Starting the ASCS instance agent on prd-cs-2
-
Log in as user
roottoprd-cs-2. -
Run the following command to start the systemd service.
systemctl start SAPPRD_11.service -
Log in as user
prdadmtoprd-cs-2. -
Run the following command to start the instance agent.
sapcontrol -nr 11 -function StartService PRD
Starting the ASCS instance on prd-cs-2
-
Run the following command to start the ASCS instance.
sapcontrol -nr 11 -function Start -
Run the following command to verify that the ASCS instance is running.
sapcontrol -nr 11 -function GetProcessListGetProcessList 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.