You are implementing Azure Site Recovery for an SAP NetWeaver deployment on Azure virtual machines.
- The SAP Web Dispatcher, application server and Central Services virtual machines are replicated to a secondary region by Site Recovery.
- The SQL Server database tier uses an Always On availability group that has a secondary replica in the secondary region.
- You created a recovery plan in which all the replicated SAP virtual machines are in Group 1.
- The ASR-SQL-FailoverAG and ASR-AddSingleLoadBalancer sample scripts are already imported into your Azure Automation account.
Requirements for a failover:
- The availability group replica in the secondary region must become primary before the SAP virtual machines in Group 1 fail over.
- After failover, the Web Dispatcher virtual machines in the secondary region must be attached to a load balancer.
How should you configure the scripts in the recovery plan?
A recovery plan sequences the tiers of a multi-tier application during failover, and scripts can run before or after a group. The guidance for SAP is to add ASR-SQL-FailoverAG as a pre-action of Group 1, so the availability group fails over before the web and application tiers. ASR-AddSingleLoadBalancer is added as a post-action, so it attaches a load balancer to the Web Dispatcher virtual machines once they have failed over.
- Not correct: Add ASR-AddSingleLoadBalancer as a pre-action and ASR-SQL-FailoverAG as a post-action of Group 1. This reverses both scripts. The database would fail over after the SAP virtual machines, and the load balancer step would run before the failed-over virtual machines exist.
- Not correct: Add ASR-SQL-FailoverAG as a post-action and ASR-AddSingleLoadBalancer as a post-action of Group 1. As a post-action, the availability group failover runs only after the SAP virtual machines have failed over. The guidance is to fail over web and application tiers only after the database failover completes.
- Not correct: Add ASR-SQL-FailoverAG as a pre-action and ASR-AddSingleLoadBalancer as a pre-action of Group 1. The load balancer script is meant to attach a load balancer to the failed-over virtual machines. As a pre-action, it runs before those virtual machines exist in the secondary region.
- Correct: Add ASR-SQL-FailoverAG as a pre-action and ASR-AddSingleLoadBalancer as a post-action of Group 1. The SQL availability group script runs as a pre-action of Group 1, so the database fails over first. The load balancer script runs as a post-action, so it attaches the load balancer to the failed-over Web Dispatcher virtual machines.