DEV Community

Cover image for Automated SAP deployments on AWS
Sourabh Chordiya
Sourabh Chordiya

Posted on

Automated SAP deployments on AWS

The SAP products are used by almost every major enterprise irrespective of business they do. There are plenty of SAP products available, the key ERP product that is now S/4HANA and traditionally being SAP ECC. Alongside, SAP has plenty of solutions for Supply Chain, Customer Relationship Management, Analytics among others. With Digitalization being the part of every Organization's strategy, one of the key requirements that come in with deployment on AWS platform is to deploy quickly and prepare repeatable deployments. In this article, while we primarily focus on SAP, the concepts are re-usable for any other software stack as well. We will understand the various tools that can be used along with some sample scripts on how we can get started with such deployments. It is expected that the reader understands SAP and Infrastructure basics.
IaaC, abbreviation for Infrastructure as a Code is commonly used terminology in DevOps. Unlike traditional web software, SAP has a different design and usage pattern, and hence it's important to understand the cases in which IaaC becomes applicable before we understand the tools that can be used. SAP environments typically require ABAP application layer and database layer which can be on same or multiple different servers. There are also Java applications, Business Objects, and several other products that SAP supports. In addition, the SAP BTP platform is a combination of several services that SAP provides in PaaS model which covers integration scenarios and various latest technologies like AI/ML. All these products are available to be deployed on AWS as long as they support minimal version requirements as per the SAP and AWS documentation. (SAP Note 1656099 - https://launchpad.support.sap.com/#/notes/1656099 - login required) documents the version requirements.
For the infrastructure deployment on AWS, CloudFormation is a natively available framework from AWS, however, to remain cloud-agnostic, one can use Terraform, Chef, Puppet, which are popular products in the market for such use-cases. The next step is Configuration Management, or in simple words, configuring the deployed infrastructure, including operating systems, applications, databases and anything else that uses underlying infrastructure. Ansible is the most popular tool although Terraform, Chef, Puppet and other tools can do the same as well to some extent. For SAP administrators and architects, it is important to know basics of Github, its an open-source collaboration platform, used in DevOps projects primarily, but can also be used for any sort of code that need to be hosted and maintained in versions. There are many useful features and automation codes including SAP deployment automation use-cases, one of these covered in https://github.com/darpan92/SAPS-4HANA_Terraform_Ansible which is referred in the blog https://blogs.sap.com/2021/05/05/automated-vm-and-sap-systems-deployment-on-cloud-part-1/. Note that AWS already have an offering called AWS Launch Wizard that can automate S/4HANA deployments, it provides deployment mechanism using a UI driven approach with lesser customizations.

The key item to keep in mind with SAP automation is to break it down into different phases, which are as below.

1. SAP Sizing and Design - this can be partially automated. While the sizing topic on AWS is a detailed blog in itself, however the sizing is adjustable in AWS for a lot of aspects, which makes it easier for architects to start with smaller setups and ramp-up as needed. The automations can play an important role in ramping up automatically. In some cases, it might be required to deploy additional application servers, or restart database servers where a failover can simplify the capacity change plan

2. Infrastructure Deployment - AWS Infrastructure can be deployed via AWS Console, AWS CLI, APIs as well as automation tools discussed earlier. This step can be automated, but we have to keep in mind that writing scripts also requires a little bit of time and also expertise. If its a couple of servers, one could better go for manual approach, the automations come in handy when requirement spans across more than 10 servers that follow same pattern. With IaaC tools, a basic design pattern is automated. Lets understand with an example, for an SAP system, we will need an ASCS server, an application server, and a database server. For this case we will consider them to be on SUSE Linux, and then they will require some initial configurations like kernel, shared memory changes, a few additional packages to be installed, filesystem mount and swap creation among others. The list will be longer in case high availability setup is planned.

3. Operating System Configuration - The operating system need to be configured for various parameters, disks need to be partitioned and formatted, the shared filesystems will need to be created for sapmnt and trans directories before an SAP system can be installed. All these can be achieved using both Terraform and Ansible, however we will see this using Ansible. The process is pretty much same irrespective of tools being used, usually only syntax differs for simple tasks.

4. SAP system Installation - The process for installation of database and SAP systems remains pretty much how we would perform this manually, but instead of using GUI mechanism of SWPM and other installers, we will leverage the silent/unattended installation method. Almost every parameter can be passed through an input parameter file ( SAP note https://launchpad.support.sap.com/#/notes/2230669 - login required). By running SWPM once manually, the file can easily be generated and then customized. In most cases, except for SID and passwords, the inputs remain pretty much same across the landscape, which makes the silent installation a go-to option for automation

5. Post installation configurations - Most of the basic activities are covered in ABAP task-list SAP_BASIS_SETUP_INITIAL_CONFIG for ABAP systems (https://help.sap.com/docs/SLTOOLSET/e345db692e3c43928199d701df58c0d8/66e402a5545a4ccf95e3134bc4fa974f.html?version=CURRENT_VERSION) and the few other tasks like backup configuration using AWS Backup or backint integration can be scripted easily using a combination of terraform scripts to deploy resources and ansible scripts to perform configuration changes like parameter adjustments. Note that the post installation activities may involve items like updating a central inventory, making changes to SAP GUI logon pad entries, and similar steps that are usually outside of Basis team's control but can be managed in automated fashion depending on tools being used.

References -

https://bluelight.co/blog/best-infrastructure-as-code-tools
https://blogs.sap.com/2021/05/05/automated-vm-and-sap-systems-deployment-on-cloud-part-1/
Image by Gerd Altmann from Pixabay

Top comments (0)