From 068d02a01db973c331da69703d14fc157958f4a2 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 11 Mar 2018 15:09:56 +1100 Subject: [PATCH] Added OC --- source/server/index.md | 11 ++--- source/server/runoc.md | 91 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 source/server/runoc.md diff --git a/source/server/index.md b/source/server/index.md index 0d269db..f675d92 100644 --- a/source/server/index.md +++ b/source/server/index.md @@ -8,6 +8,7 @@ related: - { page: "normalrun", title: "Normal Run of Container" } - { page: "upgrade", title: "Upgrading SP" } - { page: "recover", title: "Recoverying the SP Database" } +- { page: "runoc", title: "Running OC in a container" } --- # Putting Spectrum Protect into a Container (These instructions as based on Spectrum Protect 8.1.1. References to *SP* means Spectrum Protect.) @@ -19,7 +20,7 @@ related: I actually perform the build on an iMac with 16GB of memory allocated to Docker. It is also using the `overlay` storage driver, which means the size of the volume the build container gets is the available free capacity of my /Users mount point. > * The accompaning files for this build are available in my [gitlab](http://dev.leenooks.net/deon/spdocker/tree/master) > * And lastly, most importantly, running SP in a container is **not officially supported by IBM** - so you cannot make a helpdesk call about having problems. - Technically it should work without problems, but if you are experiencing a problem, be prepaid to recreate your environment on a physical host and validate that your problem still exists (and thus not a result of Docker or the implementation on Docker). + Technically it should work without problems, but if you are experiencing a problem, be prepared to recreate your environment on a physical host and validate that your problem still exists (and thus not a result of Docker or the implementation on Docker). ## Create your Dockerfile As at the time of writing these instructions, Red Hat linux is not available in the Docker hub - but CentOS is a good clone. We'll use it @@ -62,8 +63,8 @@ RUN SOURCE_URL=http://YOUR_SITE_URL_HERE && \ mkdir -p /tmp/build/8.1.x && cd /tmp/build/8.1.x && \ curl -SL ${SOURCE_URL}/8.1.x > tsm && \ chmod +x tsm && ./tsm && rm -f tsm && \ - ./install.sh -s -input /tmp/install-fp.xml -acceptLicense && df && \ - rm -rf /tmp/install* /tmp/build/8.1.x + ./install.sh -s -input /tmp/install-fp.xml -acceptLicense && \ + rm -rf /tmp/build /tmp/install*xml ``` **NOTE**: Some information on what is occuring here. @@ -131,7 +132,7 @@ ENTRYPOINT [ "/sbin/init" ] CMD [ "start" ] ``` -A complete Dockerfile is available [here](http://dev.leenooks.net/deon/spdocker/blob/master/Dockerfile) if you need one as a starting point. Once you have your images loaded on a web server, the config files, you are reading to run `docker build -t ibm/spectrumprotect:8.1.x .` +A complete Dockerfile is available [here](http://dev.leenooks.net/deon/spdocker/blob/master/Dockerfile) if you need one as a starting point. Once you have your images loaded on a web server, and the supporting build files run `docker build -t ibm/spectrumprotect:8.1.x .` If your final build is successful, you should see a Docker Image that is about 3GB. @@ -142,4 +143,4 @@ ibm/spectrumprotect 8.1.1 14aba816e231 2 minutes ago 2.96GB **NOTES** * Make sure you have enough space in your `/var/lib/docker` directory - the build will use about 9 GBs. -Now that your container is built, you'll want to start it a specific way, depending on whether you are starting a clean new instance of SP, or an existing instance. Those details are [here](#soon). +Now that your container is built, you'll want to start it a specific way, depending on whether you are starting a clean new instance of SP, or an existing instance. Those details are [here](firstrun.html). diff --git a/source/server/runoc.md b/source/server/runoc.md new file mode 100644 index 0000000..af4fbf3 --- /dev/null +++ b/source/server/runoc.md @@ -0,0 +1,91 @@ +--- +title: Operations Center +header-img: img/header_img/server.jpg +date: 2018-03-07 09:50:12 +description: Operations Center in a Docker Container +related: +- { page: "index", title: "Containerising SP" } +- { page: "runoc", title: "Running OC in a container" } +--- +> **NOTES** +> * Operations Center is a good fit for a container - especially in a cluster (eg: Swarm), it requires no persistent storage (other than the initial config). +> * Make sure your host has sufficient memory to perform the build - OC requires at least 4GB of RAM to pass the installation logic. +> * The accompaning files for this build are available in my [gitlab](http://dev.leenooks.net/deon/spdocker/tree/oc) +> * And lastly, most importantly, running SP in a container is **not officially supported by IBM** - so you cannot make a helpdesk call about having problems. + Technically it should work without problems, but if you are experiencing a problem, be prepared to recreate your environment on a physical host and validate that your problem still exists (and thus not a result of Docker or the implementation on Docker). + +The process for Containerising OC is very similiar to [Containerising Spectrum Portect](index.html). + +## Create your Dockerfile +As at the time of writing these instructions, Red Hat linux is not available in the Docker hub - but CentOS is a good clone. We'll use it + +### Image preparation +```Dockerfile +FROM centos:7 +``` + +Operations Center doesnt really need any dependancies - you can check the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.4/srv.install/c_oc_inst_reqs_os.html) for any updates. However, to pass the installation logic, we do need to have a redhat-release RPM installed. For CentOS it doesnt exist (CentOS calls it centos-release), so I created one. + +```Dockerfile +RUN yum -y install http://yum.leenooks.net/CentOS/7/base/redhat-release-7-6.el7.centos.12.2.x86_64.rpm \ + libaio \ + ksh \ + compat-libstdc++-33 \ + numactl && \ + yum clean all && rm -rf /var/tmp/* +``` + +**NOTE**: During the installation of SP, it tests to make sure it is running on RedHat linux by testing the existence of an RPM package `redhat-release`. The redhat-release installed on line 1 is a fake RPM package - it installs no files, but just emulates the existance of that required RPM package. + +### Operations Centre Installation + +Now copy in our silent install configuration files. These files are based on the silent install xml files that come on the installation media. Some details on these files are also in the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.4/srv.install/t_srv_inst_silently-linux.html) + +```Dockerfile +COPY install.xml install-fp.xml /tmp/ +``` +**NOTE**: We only include the silent install configuration files here - not the installation media, otherwise the size of the resulting Docker image is too big. Current versions of `docker build` do provide the ability to "flatten" the resulting container, but those instructions are outside the scope of this tutorial. + +Next, is performing a silent installation of SP. + +```Dockerfile +RUN SOURCE_URL=http://YOUR_SITE_URL_HERE && \ + mkdir -p /tmp/build && cd /tmp/build && \ + curl -SL ${SOURCE_URL}/8.1.1 > tsm && \ + chmod +x tsm && ./tsm && rm -f tsm && \ + ./install.sh -s -input /tmp/install-oc.xml -acceptLicense && \ + rm -rf /tmp/build /tmp/install*xml +``` + +**NOTE**: Some information on what is occuring here. +* To avoid the resulting Docker Image being too large, we download the installation media from a web server (Line 3) and then delete it after it has been expanded (line 4). +* Line 5 is the silent installation method for installing SP components. +* Line 6 deletes any installation files to reduce the size of the resulting Docker Image. + +And our final Docker Image settings for when our container starts. + +```Dockerfile +COPY init /sbin/ + +# Our final docker parameters +EXPOSE 11443 +ENTRYPOINT [ "/sbin/init" ] +CMD [ "start" ] +``` + +A complete Dockerfile is available [here](http://dev.leenooks.net/deon/spdocker/blob/oc/Dockerfile) if you need one as a starting point. Once you have your images loaded on a web server, and the supporting build files run `docker build -t ibm/spectrumprotect-oc:8.1.x .` + +If your final build is success, you should see a Docker Image that is nearly 1GB. + +```plain +REPOSITORY TAG IMAGE ID CREATED SIZE +ibm/spectrumprotect-oc 8.1.1 5110bce0e6a7 1 minutes ago 973MB +``` + +Now that your container is built, starting OC is simple + +`docker run --detach=true --interactive=false --link=spectrumprotect -v /serverConnection.properties:/opt/tivoli/tsm/ui/Liberty/usr/servers/guiServer/serverConnection.properties --memory=1g -p 11443:11443 --privileged=false --rm=false --restart=no --tty=false --name=spectrumprotectoc ibm/spectrumprotect-oc:8.1.1` + +***NOTES***: +* The OC container needs to connect to your SP server(s). If your SP server is running in a container, you can use the `--link=` to link to the container name of your server (not necessarily required). If you are running your container in a cluster (eg: Docker Swarm), then you'll need to use the appropriate configuration for your cluster to do container-to-container networking. +* The `-v /serverConnection.properties:../serverConnection.properties` will saving you having to do a "setup" of OC if the container is ever stopped and destroy (this will happen in cluster environments). Make sure the file reference in the `-v` option is available on your cluster persistent storage.