Microsoft and SAP NetWeaver – step by step up to the cloud – Part V : simple online SAP System copy

Intro

 

In my last blog I described how a simple "offline copy" of a SAP System could be accomplished :

https://blogs.msdn.com/b/saponsqlserver/archive/2012/08/05/microsoft-and-sap-netweaver-step-by-step-up-to-the-cloud-part-iv-simple-offline-copy-of-a-central-system.aspx

This time I would like to describe a solution which allows to create a simple online SAP system copy.
A typical use case could be to create a copy of a production system which then acts as a test or
development system where it's not necessary to be 100% synchronized. While it's acceptable to
have a little gap regarding the content ( e.g. testing a new feature, support package Installation and
so on ) it's not acceptable to take a production system offline for this purpose.

Challenge

As I showed in my last blog there is no "online VM copy" feature available right now in System Center
Virtual Machine Manager. The "create VM from VM" activity requires that the source VM is offline.
Therefore the question comes up how this could work then - if at all ?

An important aspect when looking for a solution is to find something which is officially supported and
practicable. A "hack" is not an option. In addition the final process should have some flexibility to
allow e.g. creating a virtualized system copy out of a bare-metal installation or a single-VM copy
out of a distributed system landscape.


Solution

To show how the challenge described above could be solved I want to present an answer from our
partner connmove. I mentioned them already in my former SAP cloud blogs. The usage of their
"Easycloud" product makes life again much easier. They offer an implementation of an online SAP
system copy and published a live demo about it :

https://connmove.eu/en/solutions/self-service-it-processes/

The basic workflow looks like this :

 

Figure 1 :  high-level workflow of an online SAP system copy

As you can see the basic idea is to create a copy not from a VM perspective but from a SAP system
perspective. SAP software is already installed on a VM template. Creating a VM out of such a
template means that the new target VM has already a SAP and SQL Server installation.
A SQL Server database backup on the source side can be done online. In a second step this backup
has to be restored on the new target system. Everybody who is familiar with SAP NetWeaver knows
that after the restore the target system won't come up because user and profile data and the hostname
don't fit. This is where the SAP rename tool will help again as described in my last blog about the
offline copy. connmove just used it in unattended mode to put everything into an Orchestrator
runbook ( see more Details further down ).

The SAP rename tool will just fix the basics to make sure that the new target system will start. There is
still some additional post-copy work to do until the new system can be fully used ( e.g. SE06 or
SAP note 1532825 ). All these steps cannot be covered completely by a pre-configured process.
There will be always customer specific steps and configurations. As the workflow is based on a
System Center Orchestrator runbook it's quite easy though to adapt this part. And the connmove
PowerShell Interface for SAP ( "Easycloud" ) simplifies a lot of tasks significantly.

Sure - via "Easycloud", SAP batch input and other SAP interfaces one can achieve basically
everything to automate a SAP System copy using a System Center Orchestrator runbook. But another
important question is of course how long this might take ? What if you want to create a copy of a
10TB SAP System ? Well - that's again the beauty of a workflow defined in an Orchestrator runbook.
It's not a compiled monolithic program. Consider the SQL Server backup/restore method as an option.
In case there is some special storage support available which allows to create a consistent online
copy of the device(s) used by the SAP System which then can be easily mounted to the new VM
( e.g. using Windows VSS ) - perfectly fine. There is nothing which would prevent us from replacing
the SQL Server backup/restore in the Orchestrator runbook by something else.

Finally - as one can see on the last two screenshots below - it's straight forward to call an
Orchestrator runbook out of System Center 2012 Service Manager. In Addition our Partner connmove
used the SharePoint integration of Service Manager to easily create a self-service portal for
managing the SAP System copy. You find additional Information regarding These Topics here :

https://technet.microsoft.com/en-us/library/hh519695.aspx
https://www.microsoftvirtualacademy.com/tracks/system-center-2012-orchestrator-service-manager
https://technet.microsoft.com/en-us/library/hh914195.aspx

 

Some screenshots from the connmove SAP System copy solution :
 

Figure 2 : Orchestrator runbook sample from our Partner connmove to create an online
                SAP System copy :

                - create a new VM from a template where SAP and SQL Server is already installed
                - create a SQL Server DB backup via T-SQL backup command on the source System
                - take the SQL Server DB on the target System offline
                - restore the SQL Server backup from the source System on the new target VM
                - modify SAP profiles and copy usr/sap files and prepare for SAP rename tool
                - start SAP rename tool in unattended mode
                - set number of batch work processes to 0 and start SAP System ( to avoid that 
                  batch jobs might start when the system comes up )
                - call program BTCTRNS1 to suspend all batchjobs. "Easycloud" allows to call a
                  program via transaction SE38 by a simple Powershell command
                - stop the target SAP System and change the number of Batch work processes.
                  no problem now after all jobs were suspended
                - send email telling that the SAP System copy is done and additional post-copy
                  tasks might be necessary

                As mentioned already before this approach provides a lot of flexibility. A SQL
                Server backup can also be taken from a bare-metal installation whereas the
                new target System is in fact virtualized. 
               
   

Figure 3 : program BTCTRNS1 to suspend batch jobs after creating the system copy
           

 

 

 

Figure 4 :  as mentioned in the last blog the SAP Rename Tool uses the sapinst framework and
                 therefore allows to use it in unattended mode. This works similar to the sapinst sample
                 in a former blog about an automated installation of a SAP dialog instance

 

 Figure 5 : call program BTCTRNS1 in SE38 via connmove "Easycloud" PowerShell command

 

Figure 6 :  the SAP System clone process was added to System Center Service Manager via a
                 service request

 

 

 Figure 7 : System Center 2012 Service Manager offers easy integration of Orchestrator runbooks
                 which was used by connmove to trigger the SAP System copy workflow

For additional information or need of consulting services to implement such a solution feel free to
contact our partner connmove directly :

https://connmove.eu/en/