Saturday, 8 September 2018

Installing AS ABAP Developer Edition with Hyper-V

If you want to install the AS ABAP Developer Edition, one choice you have to make is picking the virtualization software that manages the virtual machine. Common options are

◈ Oracle VirtualBox
◈ Docker
◈ VMware workstation
◈ Hyper-V

There are several guides on VirtualBox and Docker, so I thought why not try out Hyper-V. Hyper-V is a virtualization solution that is included in Windows Pro/Professional versions and up (including Education). It is disabled by default, as it is more intended to be something you use on a server and have permanently running than using it on a development machine. (But we are going to do just that)

I ran into several problems when I first tried it so I thought a how-to guide might be helpful.

Enabling Hyper-V


To enable Hyper-V you need to open the “Turn Windows features on or off” dialog (accessible using the start menu) and check all the Hyper-V options.

WARNING: Once you enable Hyper-V some other virtualization software will stop working. This includes VirtualBox (and the Android emulator). To get these running you need to uncheck these options again.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

After a reboot you should now be able to open the Hyper-V Manager. If that doesn’t work or you run into errors you might need to enable hardware virtualization support in your BIOS.

Setting up the local network


Before creating the new virtual machine some things about networking: If you want your application server to connect to the internet there are some additional steps to do.

Hyper-V has 3 options for virtual switches that you can attach to the virtual machine.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

External will bind the virtual machine somewhat directly to a “normal” network adapter (of for example a physical network card) of your choosing. That means if the network adapter provides internet connectivity the virtual machine will be able to access it. That also means that the virtual machine gets its own external IP address and might be directly accessible from other points of the network. In the network adapter settings of Windows you will see a new Bridged-adapter that connects the virtual switch to the physical adapter.

Internal means the virtual machine will be able to connect to the host machine and to other VMs on that switch.

Private means the VM can only access other VMs that use that switch too.

None of these options seem to fit for the use case in my opinion. I do not want the VM to get an external IP address. It should have a fixed one and not one given by some DHCP server that belongs to the Wifi network I happen to be in currently. Also I might have an AS ABAP installed on my laptop and one on my PC which are both on the same network. Since the hostname has to be vhcalnplci there would be a hostname clash in the network. But the other options do not provide an internet connection (which I need for abapGit). So what’s left?

In VirtualBox there is a NAT-Switch for this case, which will provide a local network that is able to access the internet. Fortunately Hyper-V has this type of switch as well, but there’s no GUI for it (yet). So you can either pick External with its drawbacks or use an elevated powershell prompt and practice your command line skills for later:

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

PS C:\> New-VMSwitch –SwitchName “NATSwitch” –SwitchType Internal
PS C:\> New-NetIPAddress –IPAddress 192.168.99.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NATSwitch)"
PS C:\> New-NetNat –Name NATNetwork –InternalIPInterfaceAddressPrefix 192.168.99.0/24
These commands might only work on recent updates of Windows 10 as it is quite new.

Going though these commands:

◈ New-VMSwitch will create a named network adapter that is registered in Hyper-V as a virtual switch. You could do this part in the GUI if you wanted to
◈ New-NetIPAddress will assign the Gateway IP address / subnet of the newly created switch.
◈ New-NetNat finally creates a local NAT network for which you assign the IP address range it provides

In my example I now have the following setup:

◈ Gateway of the NAT network: 192.168.99.1
◈ NAT network: 192.168.99.0/24 (255.255.255.0)
◈ IP address of the AS ABAP VM: 192.168.99.10 (this is just an IP in the range I chose)

I recommend picking an IP range that is unlikely to clash with any other parts of your network.

Creating the virtual machine


Back to GUIs and configuration wizards: Open Hyper-V Manager, right click on your computers hostname on the left and pick New -> Virtual Machine.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Navigate through the dialogs, some recommendations:
  • Pick generation 2
  • Assign at least 6 GB of memory (6144 MB)
  • IMPORTANT: Uncheck dynamic memory. If dynamic memory is used the installation of the ASE database will fail as it tries to allocate more memory than is currently available. You can enable it again later on if you want to, but I had some problems with that.
  • If you are using the NATSwitch do not connect it yet to the VM (pick “Not connected” instead). This is just to prevent the Linux installer to freeze on boot as it tries to contact a DHCP server (I think). The other options (Default-Switch or External) can be connected directly.
  • I recommend using ~150 GB as a hard disk. It is quite a bit of effort to expand it later on so some buffer should be useful. I tend to copy all the installation files of the AS ABAP into the VM to prevent filesystem issues that may occur when installing over a mounted “Windows network share” with CIFS, so there needs to be some space for that too.
  • In the operating system dialog you can already select the ISO or just do it later.

After that you should have a new virtual machine in the list. Right click on it and open the settings. Under “Processor” you might want to adjust the number of virtual processors in some way to the amount of physical CPU cores you have. I don’t know what the best ratio is here. I just noticed with 1 processor assigned the maximum physical CPU usage I get is 25% with an i7. So I put it up to 4.

Installing the Operating System


Once the virtual machine is created you can install the operation system. I always pick OpenSUSE Leap because it seems to work the best for me. 

Go into the settings again, this time under SCSI Controller (which should be installed by default for the virtual hard drive) add a DVD drive and attach the SUSE-ISO file to it.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Save the settings and connect to the VM by double clicking on it and press “Start”. You should now be greeted by the OpenSUSE boot selection menu of the installation disk. Press “Installation”.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

(If you cannot get to this screen you might need to disable SecureBoot in the VM settings.)

And here’s another installation wizard. Some suggestions:
  • Network settings
    • I suggest skipping these for now. If you are using the NATSwitch the network should not be connected at this point anyway. When I tried configuring the network here it was only saved within the installer and not in the OS itself afterwards.
  • User Interface
    • This is a server so pick “Server”.
  • Partitioning
    • Press “Guided Setup”
    • Do not enable LVM or encryption
    • Change the file system type to EXT4, disable separate partitions for everything
ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials
  • Local User
    • I always add a user named “admin” so that there’s a separate one from root
  • Installation Settings
    • Disable the firewall
    • Enable SSH service 
ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

After the installation the VM should automatically reboot and show you the login screen. Login with the user you created and proceed having lots of fun, I guess.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Preparing the virtual machine


Before we can install the application server first we need to get the network setup. Go into the VM settings again and attach NATSwitch to the machine. Then open the CLI configuration interface of SUSE:

admin@linux-z3ax:~> sudo yast

(You can do all of this by manually editing several configuration files instead)

Navigate to System -> Network Settings using the arrow keys and press enter.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

You will get a message that currently the network settings are not managed by YaST. Therefore change “Network Setup Method” from “NetworkManager Service” to “Wicked Service”. You can navigate through these dialogs using the TAB key.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

On the same page you may want to disable IPv6, so that it does not get in the way. Then go to “Overview” and select “Edit” on “Virtual Ethernet Card 0”. Ensure that DHCP is not enabled and statically assign the IP address you chose and the subnet mask you configured in the NATSwitch. You should add the fixed hostname “vhcalnplci”. For me it looks like this:

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Press next. In the “Hostname/DNS” tab you need to specify the new hostname “vhcalnplci” and you should also add some DNS servers of your choosing. For me these are the Google ones and the one of my home network.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Go to “Routing” and change the “Default IPv4 Gateway” to the gateway you configured on the NATSwitch (for me that’s 192.168.99.1) for device eth0.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

Press OK and leave YaST. Restart the virtual machine.

admin@linux-z3ax:~> sudo reboot

Next time you login you should now see the hostname has changed in the prompt and with a bit of luck networking should work. You can check by pinging Google using the IP for their public DNS server and their normal URL to check DNS does also work.

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

You might want to ping a machine in your local network to see if that works as well (like the host machine).

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

If everything’s fine I suggest creating a snapshot (or checkpoint as Hyper-V calls them).

If it doesn’t work you have some network troubleshooting to do. For me I either had to restart the machine again or I messed up some of the settings mentioned above. You might also need to configure a proxy server if that is relevant in your network environment.

The ABAP server needs a service called UUIDD (UUID Daemon). Since the internet connection should now work you can install and enable it like this:

admin@vhcalnplci:~> sudo zypper install uuidd
admin@vhcalnplci:~> sudo systemctl enable uuidd
admin@vhcalnplci:~> sudo systemctl start uuidd

I install some other packages as well. If you plan on extracting the installation files on the virtual machine you need some rar-compatible unarchiving software like unar. Alternatively you can extract the files on your host machine and just copy the result into the VM.

admin@vhcalnplci:~> sudo zypper install htop tmux unar

Installing the application server


To install the AS ABAP server you first need to download the installation files from https://tools.hana.ondemand.com/#abap. Currently 7.51 SP02 is the most recent one (7.52 should be coming soon). After you downloaded the 10 rar-archive-files you need to transfer them inside of the virtual machine (you could instead directly install it over the network but I had issues with that). There are several ways to do this.

If you already have some network share available you can save the rar-files in there and mount the folder in the virtual machine and copy them over in a temporary directory:

admin@vhcalnplci:~> sudo mkdir -p /mnt/share
admin@vhcalnplci:~> sudo mount.cifs "//fileserver/share" /mnt/share -o user=YourUser
admin@vhcalnplci:~> mkdir -p /tmp/asabap
admin@vhcalnplci:~> cp /mnt/share/sap*.rar /tmp/asabap

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

If that’s not the case you could share the folder with the downloaded files on your local machine and mount that. I do not know of a way to just attach a folder of the host machine without network sharing like you can do in VirtualBox.

To extract the files I use unar that I installed previously:

admin@vhcalnplci:~> cd /tmp/asabap
admin@vhcalnplci:/tmp/asabap> unar sap_netweaver_as_abap_751_sp02_ase_dev_edition.part01.rar

Remove the rar files to get some disk space back and set the installer to executable:

admin@vhcalnplci:/tmp/asabap> rm *.rar
admin@vhcalnplci:/tmp/asabap> cd sap_netweaver_as_abap_751_sp02_ase_dev_edition
admin@vhcalnplci:/tmp/asabap/sap_netweaver_as_abap_751_sp02_ase_dev_edition> chmod +x install.sh

Create a new checkpoint here.

ASE License


If you are installing the AS ABAP 7.51 SP02 you might now have a licensing problem. The ASE license packaged in the installation files has already expired. You can download the new valid license here, but somehow you need to swap out the license before the installer uses it. There are two ways to do this:

1. Extract some more archives, swap out the file and compress them again (guide in this comment)
2. Swap it out while the installation is going on before the license is used but after it was extracted to the target folder

I’ll describe the second approach as the other one is already documented and I cannot be bothered to remember any tar command syntax.

Start the installation

Just execute the installer with sudo and follow the instructions:

admin@vhcalnplci:/tmp/asabap/sap...> sudo ./install.sh -s

(For some reason without the -s flag the installer will complain about the hostname. It should however be set up correctly and everything works fine skipping the check, so I am not sure why it is doing that.)

If you haven’t fixed the license yet follow the instructions until the installation is running. Then switch to another TTY session by pressing Ctrl+Alt+F2. You should now be on a new login screen (you can switch back with Ctrl+Alt+F1). Login, switch to root and wait for this file to appear:

/sybase/NPL/SYSAM‐2_0/licenses/SYBASE_ASE_TestDrive.lic

admin@vhcalnplci:~> sudo su
vhcalnplci:/home/admin # cd /sybase/NPL
vhcalnplci:/sybase/NPL # l
vhcalnplci:/sybase/NPL # cp /mnt/share/SYBASE_ASE_TestDrive.lic /sybase/NPL/SYSAM-2_0/licenses/SYBASE_ASE_TestDrive.lic
vhcalnplci:/sybase/NPL # cd /sybase/NPL/SYSAM-2_0/licenses
vhcalnplci:/sybase/NPL/SYSAM-2_0/licenses # chmod 0750 SYBASE_ASE_TestDrive.lic
vhcalnplci:/sybase/NPL/SYSAM-2_0/licenses # chown sybnpl:sapsys SYBASE_ASE_TestDrive.lic
vhcalnplci:/sybase/NPL/SYSAM-2_0/licenses # cat SYBASE_ASE_TestDrive.lic
vhcalnplci:/sybase/NPL/SYSAM-2_0/licenses # exit
admin@vhcalnplci:~> exit

The easiest way is to copy the file over from the mount point where your installation files were. With the cat command you should verify that the license is valid until some point in the future.

Switch back to the installation using Ctrl+Alt+F1 and wait until it’s done.

Hopefully you should now get this screen:

ABAP Developer, SAP ABAP Certification, SAP ABAP Study Materials

This means to system was successfully installed and is up and running. You can connect to it with SAP GUI using the NAT-IP address (192.168.99.10 here). For ADT and other web-based things to work you should add it to your host file and use the hostname vhcalnplci instead.

For cleanup purposes clear the installation folder and unmount the network share:

admin@vhcalnplci:~> sudo umount /mnt/share
admin@vhcalnplci:~> rm -rf /tmp/asabap

Create a new snapshot / checkpoint now just so you can return to this point if needed.

No comments:

Post a Comment