Updated server build details

This commit is contained in:
Deon George 2018-03-08 10:42:58 +11:00
parent 12ef07f1a1
commit 5b5090d154
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254

View File

@ -5,7 +5,14 @@ date: 2018-03-07 09:50:12
description: Spectrum Protect Server in a Docker Container
---
# Putting Spectrum Protect into a Container
(These instructions as based on Spectrum Protect 8.1.4. References to *SP* means Spectrum Protect.)
(These instructions as based on Spectrum Protect 8.1.1. References to *SP* means Spectrum Protect.)
> **NOTES**
> * Depending how your storage volumes are provisioned to running containers, you may need to increase the "default size" of a provisioned volume.
For example if your storage driver is `devicemapper` then the default volume size `Base Device Size` may be 10GB, which wont be enough for a SP installation. You will need to increase it to at least 15GB - details on how to do that are outside of the scope of this document.
> * Also make sure your host has sufficient memory to perform the build - SP requires at least 12GB of RAM to pass the installation logic.
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)
## 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
@ -15,7 +22,7 @@ As at the time of writing these instructions, Red Hat linux is not available in
FROM centos:7
```
Next we need to install some dependancies - these are documented in the Knowledge Center as a requirement for running SP on Linux
Next we need to install some dependancies - these are documented in the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.4/srv.install/r_srv_lnx_sysreq_inst_x-linux.html) as a requirement for running SP on Linux. You might like to check to make sure these are still all that is required for newer releases of SP.
```Dockerfile
RUN yum -y install http://yum.leenooks.net/CentOS/7/base/redhat-release-7-6.el7.centos.12.2.x86_64.rpm \
@ -30,7 +37,7 @@ RUN yum -y install http://yum.leenooks.net/CentOS/7/base/redhat-release-7-6.el7.
### Spectrum Protect Installation
Now copy in our silent install configuration files
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/
```
@ -40,20 +47,22 @@ COPY install.xml install-fp.xml /tmp/
Next, is performing a silent installation of SP.
```Dockerfile
RUN mkdir -p /tmp/build/8.1.0 && cd /tmp/build/8.1.0 && \
curl -SL http://SITE_URL/docker/tsm/8.1.0 > tsm && \
RUN SOURCE_URL=http://yum.leenooks.net/docker/tsm && \
mkdir -p /tmp/build/8.1.0 && cd /tmp/build/8.1.0 && \
curl -SL ${SOURCE_URL}/8.1.0 > tsm && \
chmod +x tsm && ./tsm && rm -f tsm && \
./install.sh -s -input /tmp/install.xml -acceptLicense && \
rm -rf /tmp/build/8.1.0 && \
mkdir -p /tmp/build/8.1.x && cd /tmp/build/8.1.x && \
curl -SL http://SITE_URL/docker/tsm/8.1.x > tsm && \
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
```
**NOTE**: Some information on what is occuring here.
* This is an "new install" (lines 1-5) then followed by an "upgrade" (lines 6-12). The reason for the new install first, is that the Spectrum Protect license files and license libraries are not available in upgrades. So you'll need to install from your downloaded media from Passport Advantage, and then upgrade it to the latest release from Fix Central.
* This is an "new install" (lines 1-5) then followed by an "upgrade" (lines 6-12). The reason for the new install first, is that the Spectrum Protect license files and license libraries are not available in upgrades (from Fix Central). So you'll need to install from your downloaded media from Passport Advantage, and then upgrade it to the latest release from Fix Central.
If you sourced your installation media from Passport Advantage, then the license files and libraries are probably in that installation media, so you only need to run lines 1-5.
* To avoid the resulting Docker Image being too large, we download the installation media from a web server (Line 2) and then delete it after it has been expanded (line 3). We also do the same for up upgrade package (lines 7 & 8).
* Lines 4 and 9 are silent installation methods for install SP and applying updates.
* Lines 5 and 10 delete any installation files to reduce the size of the resulting Docker Image.
@ -98,19 +107,21 @@ Setup sqllib/userprofile
RUN su ${USER} -lc "echo setenv LD_LIBRARY_PATH /opt/tivoli/tsm/server/bin/dbbkapi:/usr/local/ibm/gsk8_64/lib64:\\\$LD_LIBRARY_PATH >> sqllib/usercshrc && echo export LD_LIBRARY_PATH=/opt/tivoli/tsm/server/bin/dbbkapi:/usr/local/ibm/gsk8_64/lib64:\\\$LD_LIBRARY_PATH >> sqllib/userprofile && echo export DSMI_CONFIG=${USERDIR}/tsmdbmgr.opt >> sqllib/userprofile && echo export DSMI_DIR=/opt/tivoli/tsm/server/bin/dbbkapi >> sqllib/userprofile && echo export DSMI_LOG=${USERDIR} >> sqllib/userprofile"
```
When SP starts on a new install, there are no ADMINs defined, so here is a macro to help us.
```Dockerfile
COPY admin.macro /tsm/
```
### Final Docker Image Parameters
And our final Docker Image settings for when our container starts.
```Dockerfile
EXPOSE 1500 1543
VOLUME [ "${USERDIR}","/database","/data" ]
COPY admin.macro /tsm/
COPY init /sbin/
# Starting
EXPOSE 1500 1543
VOLUME [ "${USERDIR}","/database","/data" ]
ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ]
```
@ -124,6 +135,6 @@ REPOSITORY TAG IMAGE ID CREATED SIZE
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 many GBs.
* 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](here).
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).