sbcgua / sap-nw-abap-vagrant

Vagrant config for SAP NW developer edition
46 stars 15 forks source link
abap sap-netweaver

Version

Vagrant config for SAP NW752 SP01/SP04 dev edition

[PINNED] 2020-03 SYBASE LICENCE update

The sybase DB license included in the original distrib expired on March 2021. The new license can be obtained as described here: https://blogs.sap.com/2018/08/30/as-abap-7.5x-ase-license-available/

In order to include this file into a new installation:

  1. Place the SYBASE_ASE_TestDrive.lic file into distrib folder, near install.sh script.
  2. Edit Vagrantfile, uncomment config.vm.provision "shell", path: "scripts/provision/patch_install_script.sh" line near the end of the file.
  3. This will adjust the install.sh script so that it find and copies the new licence after uncompressing the files and before start of the SAP installation.

What is it ?

This repo contains a Vagrant script and set of deployment scripts which installs SAP NW752 SP01 dev edition in Ubuntu in Virtual Box environment with minimal manual steps required. The target is that you copy the script, download distribs, run Vagrant which will do allmost of steps from the offical guide and some more, and then you have ready system which just needs the post install license steps. In addition to the official installation guide the script does:

For a quick start watch this video

Confirmed to work with NW752 SP01 and the newer SP04.

How to install

How to use

Starting from v1.1 of this repo the scripts install sapnw as a systemd service and enables it by default. So the netveawer should automatically start on boot (note that it will take a minute or two after the machine is up) and you should be able to connect. On the system halt the service will attempt to gracefully stop NW (with 5 min timeout). If you want to disable the service for whatever reason run vagrant ssh -c "sudo systemctl disable sapnw", then start/stop sap manually (see below).

Start/stop virtual machine

Alternatively you can run VM directly from virtual box, Vagrant did it's job by now and now it is just a convenient option.

Useful commands for systemd service control

Manual mode (if the service is disabled)

Changing VM Name

specify --vm-name parameter to set virtual machine name... - this was deprecated in v1.3.1. Unfortunately, parsing command line args in Vagrant file conflicts with it's native args (see more in this issue). Instead a new approach was implemented via environment variables (see below).

The default name for VM is defined at the beginning of the Vagrant file in argMachineName variable. It is used in the code after to define the virtual machine name. You can override it by setting VAGRANT_SAPNW_VM_NAME environment variable for the session (or, optionally, redefine it directly in the file).

The way depends on your shell:

Don't forget to set the variable, especially before the sensitive commands like up and destroy. If you work with several instances a lot you might want to create dedicated script/batch files.

Example (cmd):

set VAGRANT_SAPNW_VM_NAME=my_new_sapnw
vagrant up
vagrant ssh -c "sudo /vagrant/scripts/install_addons.sh"

Additional comments

Infos

What is vagrant

A tool to setup virtual environments conveniently. No need to go through boring installation process which is a plus. Basic virtual machine is created within seconds (for popular flavors that exist in vagrant cloud repository).

Why not docker? (my opinion, no offends :)

1) Imho docker is supposed to be stateless. Databases should be in volumes, not inside docker layer. 2) Besides, docker storage layer is slower than volumes (AFAIK)

P.S.: Probably this can be solved. /sybase directory can be mounted to volume. Also logs and transports should be considered. Well, I don't have enough basis skills for this :) Maybe someday.
P.P.S.: Docker has a lot of potential in terms of composability. E.g. compose several pods with NW dev edition, HANA express for sidecar, configured SMTP server and make them interact. Feel free to reuse the scripts from the repo, they should be very portable to docker, in fact they work inside Ubuntu so might be zero changes needed.

Why Ubuntu

1) Ubuntu is very popular linux flavor. The community is huge and there are a lot of materials on how to solve this or that issue 2) Bare ubuntu server is just ~1 GB in size 3) and yes, I know debian-like system better than other flavors ;) might be the main reason.

Memory

Currently machine is setup to consume 6GB. Though in my experiance 4GB is usually enough (ungrounded opinion). One option to decrease memory usage is to activate swap. To do this:

SSL certificates

SSL certificates installation can be triggered by /vagrant/scripts/install_addons.sh or separate /vagrant/scripts/addons/install_ssl_certificates.sh scripts. It install the files from certificates directory. The repositiry contains certificates of github and gitlab. However, you can add more (in *.cer format) before running the script above. The script will install all the certificates that are in the folder. In order to initiate certificate script again later (if you don't want to install certificates manually via STRUST), login to ssh and run /vagrant/scripts/addons/install_ssl_certificates.sh.

Publication

Regards and references

TODO