Installing NetWeaver AS ABAP 7.52 SP 01 Developer Edition with Vagrant and Ubuntu
Recently AS ABAP 7.52 dev edition has been released. There are quite a lot of articles how to install it with virtual box and docker. However, I haven’t seen any blog on how to do it with Vagrant and Ubuntu. The only vagrant config I found was this. Also most of blog posts use OpenSUSE. So I decided to add some diversity.
This is yet another guide on how to easily install NW dev edition. This time with Vagrant which make it really easy and automatic. First a few theoretical explanations and disclaimers.
UPD 2019-01-26: the provisioning scripts now install sapnw as a systemd service so it should autostart at boot time. See details in the repository readme.
UPD 2019-10-19: the script also works with the newest AS ABAP 752 SP04, developer edition. The latest script updates also have an option to automatically install abapGit, see my other blog post on this subject and the youtube video 🙂
What is vagrant
It is a tool to setup virtual environments conveniently which is quite popular for deployments in other dev environments. 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? (IMHO, arguable)
- Ideologically docker is supposed to be stateless. Databases should be in volumes, not inside docker layer
- Besides, docker storage layer is slower than volumes
Note: to be objective, this is not a terrible obstacle. I think /sybase directory can be mounted to a volume, logs and transports also… Just might need some more effort to make it properly with docker.
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 small and just ~1 GB in size
3) … and yes, I know Ubuntu better, which might be the main reason 😉
OK, enough of theory, let’s go through installation. First check the official blog post about the installation, in particular for hardware requirements – https://blogs.sap.com/2018/09/13/as-abap-7.52-sp01-developer-edition-concise-installation-guide/.
To install you will need:
- installed virtual box
- installed vagrant, on Windows 7 vagrant will ask for powershell 3. You get it here if needed
- download this repository from github – https://github.com/sbcgua/sap-nw-abap-vagrant. You can either download it as zip or with git – ‘git clone https://github.com/sbcgua/sap-nw-abap-vagrant.git’
- download NW752 distribution and uncompress (!) it to ‘distrib’ folder of the cloned repository
- open cmd or powershell in the cloned directory
- run ‘vagrant up’
- wait for installation to finish … (took ~1-1.5 hours on my laptop)
- That’s it, no more manual install actions ! Vagrant will do all the rest. The final fresh VM weight just around 40 GB.
After this you can connect to the instance (127.0.0.1) and continue with post-installation steps as described in main guides. No need to configure forwarding ports it is already done by Vagrant. What you actually get as the result is ready to use VM in Virtualbox.
How to use
- To start VM
- run cmd in the Vagrantfile directory
- start vm with ‘vagrant up’ (this will detect that the machine was already provisioned and just start it)
- run ‘vagrant ssh -c startsap.sh’ to run instance
- To stop machine
- run cmd in the Vagrantfile directory
- run ‘vagrant ssh -c stopsap.sh’
- run ‘vagrant halt’
- Note: start/stopsap.sh are a shortcut scripts installed by the Vagrant config, they are not real start/stopsap. To run commands inside you have to login to the VM with ‘vagrant ssh’ and then run ‘sudo su -l npladm’ to switch to sap admin user
Alternatively, you can address it just by name from any location (e.g. by running cmd with Win+R). For this check VM status with ‘vagrant global-status’ and then run ‘vagrant up sapnw‘ and ‘vagrant ssh sapnw …’ where sapnw is the VM name.
Yet more alternatively you can run VM directly from virtual box, Vagrant did it’s job by now and now it is just a convenient option.
Have a look at the repo README for some additional details. In particular there is some consideration regarding memory – the current config create VM with 6GB of RAM. You can optionally decrease it to 4GB + enable swap (just uncomment a couple of lines in Vagrantfile). This worked for me, however this is under the official recommendations so should not be considered as the best practice. To configure more than 6GB – change value for ‘vb.memory =’ param in Vagrantfile (before the installation).
I hope you find this useful !
P.S. For those who doesn’t want to use Vagrant but want to use Ubuntu – you can check ‘scripts’ folder in the repo dir to figure out main command sequence.