Wednesday 30 November 2016

Run Docker on Oracle Cloud Compute Service and OL 7.2

DEPRECATED - with the availability of the Unbreakable Enterprise Kernel Release 4 (4.1.12) image, the update steps are no longer necessary. Just yum install docker.

---8<-------------------------------------------------------------------------------------------------------

Installing Docker on Oracle Linux 7.x is easy, just to follow the official documentation. According to the documentation "Docker requires the use of the Unbreakable Enterprise Kernel Release 4 (4.1.12)". To get that running on the Oracle Public Cloud Compute Service, a few steps are neccesary.


Start with creating a new instance


Go with the latest OL 7.2. Notice, that some of the 6.x images are already running Unbreakable Enterprise Kernel (UEK) R4, but OL 7.2 is still running UEK R3, which is Linux Kernel 3.x.


Upload your SSH private key and create the image, then open the SSH port and and ssh to your machine. uname -r shows, that it is still on Kernel 3.8.13-something. Yum offers only a slight update for the kernel.


Anyways do a full yum update for the installation and afterwards reboot your instance.


The kernel is still UEK R3, but yum check-update now offers a UEKR4 kernel version 4.1.12, which is exact the minimum requirement for Docker 1.12. Pew! Do the yum update and reboot thing again.


After reboot just double check that the kernel is now 4.1.12. Now we are ready to go.


The rest is straight forward. The fastest way is not to follow Docker's guide for Oracle Linux, but use their guide for Red Hat Linux instead and use the script.

curl -fsSL https://get.docker.com/ | sh

That does the trick. And it nicely reminds you of adding your user to the docker group, so better do so.


Then just follow Docker's documentation and run

sudo systemctl enable docker.service

sudo systemctl start docker

sudo docker run hello-world

The last step should give you "Hello from Docker!", that's it.

Tuesday 15 November 2016

Fix: Oracle Linux 7 (or Red Hat) hangs on boot after installing new VirtualBox Guest Additions


After updating the Guest Addtions of a Oracle Linux 7 (or Red Hat) VM in Virtual Box, sometimes Linux hangs at the boot screen after reboot. I already posted a fix for this problem under OL 6.4 on my German Blog. It was just to Ctrl-Alt-F2 to get to another virtual display and run

/etc/init.d/vboxadd-x11 setup

Unfortunately that does not work anymore under OL 7.x, as there is no /etc/init.d/vboxadd-x11. The solution is just to run it from its new location, eg.

/opt/VBoxGuestAdditions-5.1.8/lib/VBoxGuestAdditions/vboxadd-x11 setup

and reboot.

Friday 4 November 2016

Using PaaS Service Manager (PSM) for Oracle Cloud under Windows

With the PaaS Service Manager (PSM), Oracle delivers a command line interface (CLI) for the Oracle Cloud PaaS services. It requires cURL and Phython, which needs to be set up in advance. On Linux systems, this can easily done by using the package manager of your distribution. Under Windows, a few manual steps are required. Unfortunately the official documentation is missing a point. This tutorial will show how it works.
For the installation of cURL and Python for Windows, start with the URL's from the Oracle Documentation 'Performing Prerequisite Tasks for the Command Line Interface' to download and install both tools. The Python installer gives you the option to add Python to the PATH variable, for cURL this has to be done manually in the Windows System Settings.


A quick test with python --version and curl --version should be successful as shown above


Now we need the PSM binaries. Log into your Oracle Cloud services and open the service console of any PaaS service.


Click on your username, then help|Download Center.


Download the PSM from here, which should give you a psmcli.zip. Now here is the point, that is missing in the official documentation. To install psmcli.zip you need pip.exe or pip3.exe, but that is not part of the standard installation. Here is how to get it:


Go to https://pip.pypa.io/en/stable/installing/ and click on get-pip.py. Choose Open with Python.


Wait until the installer windos closes, now you have pip.


It is located in python/Scripts, so unfortunately no in your path. For easy access, you could change your PATH again, or create a shortcut ...


... and move that into your python directory (which should be in the PATH).


Starting pip from anywhere should now return some instructions


Now you can continue with the official documentation, so install psm by running


pip install -U psmcli.zip

from the directory, where you downloaded psm.


Then enter your credentials.


And try psm help, to see if it works.


If psm works, try to query your cloud services, eg.


psm jcs services

As shown above, if anything is set up correctly, the information should be returned, Thats is, psm is ready to use.