Compare commits

..

7 Commits
oc ... master

Author SHA1 Message Date
b50626d753 Updated init 2024-02-24 22:28:31 +11:00
Deon George
7650ace35d
Minor description correction for Dockerfile 2020-04-23 12:14:29 +10:00
Deon George
d58c71f096 Update for SP Server 8.1.9 2019-12-13 15:03:43 +11:00
Deon George
ac2eb34ce8 Update for SP Server 8.1.7 2019-05-06 14:23:48 +10:00
Deon George
fe463ab482
Set localtime of image 2018-03-21 16:29:47 +11:00
Deon George
bba1dee6a9
Minor updates and cleanup 2018-03-11 11:24:07 +11:00
Deon George
5deabda8f4 Initial release 2018-03-08 10:38:02 +11:00
8 changed files with 235 additions and 16 deletions

57
Dockerfile Executable file → Normal file
View File

@ -1,6 +1,7 @@
# NAME ibm/spectrumprotect-oc
# NAME ibm/spectrumprotect
# VERSION 8.1.9
# BUILD docker build -t="ibm/spectrumprotect-oc:latest" .
# BUILD docker build -t="ibm/spectrumprotect:latest" .
# START docker run -dp 1500:1500 [ -p 1543:1543 ] -v source:/tsm -v source:/data --restart=always --name=spectrum-protect ibm/spectrumprotect
# Since SP is supported on RHEL and its not available in docker, we'll use CentOS.
FROM centos:7
@ -8,22 +9,60 @@ FROM centos:7
# OS Installation Prerequisites
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/*
COPY install-oc.xml /tmp/
# Installation
# http://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/server/v8r1/Linux/8.1.?.???/x86_64/ ... for maintenance releases (without license files).
COPY install.xml install-fp.xml /tmp/
# New Install - Base level without License
## If you have the version from PPA (with license files), then use install.xml instead of install-fp.xml
RUN SOURCE_URL=http://YOUR_SITE_URL_HERE SOURCE=8.1.9.000-IBM-SPSRV-Linuxx86_64.bin && \
mkdir -p /tmp/build && cd /tmp/build && \
curl -SL ${SOURCE_URL}/${SOURCE} > tsm && chmod +x tsm && ./tsm && rm -f tsm && \
./install.sh -s -input /tmp/install-oc.xml -acceptLicense && \
./install.sh -s -input /tmp/install-fp.xml -acceptLicense && \
rm -rf /tmp/build /tmp/install*xml
## New Upgrade Install - Need to get license from base level - which you get from PPA. the patch you can get from Fixcentral
## https://www.ibm.com/support/fixcentral
## http://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/server/v8r1/Linux/8.1.?.???/x86_64/ ... for maintenance releases (without license files).
#RUN SOURCE_URL=http://YOUR_SITE_URL_HERE SOURCE=SP_8.1_LIN86_SER_STG_ML.bin FIXPACK=8.1.9.000-IBM-SPSRV-Linuxx86_64.bin && \
# mkdir -p /tmp/build/base && cd /tmp/build/base && \
# curl -SL ${SOURCE_URL}/${SOURCE} > tsm && chmod +x tsm && ./tsm && rm -f tsm && \
# ./install.sh -s -input /tmp/install.xml -acceptLicense && \
# rm -rf /tmp/build/base && \
# mkdir -p /tmp/build/patch && cd /tmp/build/patch && \
# curl -SL ${SOURCE_URL}/${FIXPACK} > tsm && chmod +x tsm && ./tsm && rm -f tsm && \
# ./install.sh -s -input /tmp/install-fp.xml -acceptLicense && \
# rm -rf /tmp/build /tmp/install*xml
# Dont forget to change the user in the init file too
ENV USER=tsm USERDIR=/tsm USERID=201 GROUPID=201
# Setup User
RUN groupadd servers -g ${GROUPID} && useradd -d ${USERDIR} -u ${USERID} -g ${GROUPID} -s /bin/bash ${USER}
# Server options file in place
COPY dsmserv.opt tsmdbmgr.opt ${USERDIR}/
COPY dsm.sys /opt/tivoli/tsm/server/bin/dbbkapi/
RUN chmod a+r /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys
# Create TSM Instance
# Change the default directory for the database to be the same as the instance directory for the server.
RUN /opt/tivoli/tsm/db2/instance/db2icrt -a server -s ese -u ${USER} ${USER} && \
mkdir -m 750 /database && chown ${USER}:servers /database /tsm/dsmserv.opt /tsm/tsmdbmgr.opt && \
su ${USER} -lc "db2 update dbm cfg using dftdbpath ${USERDIR} && db2set -i ${USER} DB2NOEXITLIST=ON"
# 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"
# An admin macro to create the admin user
COPY admin.macro /tsm/
# init is how we start our container, it supports a "setup" mode for new installs
COPY init /sbin/
# Our final docker parameters
EXPOSE 11443
EXPOSE 1500 1543
VOLUME [ "${USERDIR}","/database","/data" ]
ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ]
# Fix OC startup, since it cant find liberty
RUN sed -i 's#^installPath=#installPath=/opt/tivoli/tsm/ui#' /opt/tivoli/tsm/ui/Liberty/bin/opscenter.rc
# Set out local time
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime

2
admin.macro Normal file
View File

@ -0,0 +1,2 @@
REG A admin password PASSE=30 FORCEPW=Y
GR AUTH admin CL=SY

6
dsm.sys Normal file
View File

@ -0,0 +1,6 @@
SERVERName TSMDBMGR_TSM
COMMMETHod TCPIP
TCPSERVERAddr localhost
TCPPort 1500
ERRORLogname /tsm/tsmdbmgr.log
NODEName $$_TSMDBMGR_$$

26
dsmserv.opt Normal file
View File

@ -0,0 +1,26 @@
COMMmethod TCPIP
TCPWindowsize 0
DATEformat 2
EXPInterval 0
VOLUMEHistory /tsm/VOLHIST.TXT
DEVCONFig /tsm/DEVCONFIG.TXT
DEDUPREQUIRESBACKUP NO
SSLTCPPORT 1543
ALLOWREORGINDEX YES
REORGBEGINTIME 08:00
REORGDURATION 12
THROUGHPUTDATATHRESHOLD 5
THROUGHPUTTIMETHRESHOLD 30
ARCHLOGCOMP YES
DISABLEREORGTable
DISABLEREORGIndex BF_AGGREGATED_BITFILES,BF_BITFILE_EXTENTS,BACKUP_OBJECTS,ARCHIVE_OBJECTS
DISABLEREORGCleanupindex
ACTIVELOGSize 2048
MIRRORLOGDirectory /database/mirrorlog
ARCHFAILOVERLOGDirectory /database/archfaillog
ACTIVELOGDirectory /database/activelog
ARCHLOGDirectory /database/archlog

41
init
View File

@ -5,17 +5,52 @@ NAME="SP"
function stop {
echo "Stopping ${NAME}"
/opt/tivoli/tsm/ui/Liberty/bin/opscenter.rc stop
kill $(pgrep dsmserv)
echo "You should really connect with a client and issue HALT" && sleep 60
}
trap 'stop' SIGTERM
[ -z "${USER}" ] && echo "The USER environment variable is not set - this script wont work without it." && exit 1
if [ "$1" == "start" ]; then
/opt/tivoli/tsm/ui/Liberty/bin/opscenter.rc start
# @TODO: this assumes -v is used, but we have exposed the VOLUMES, so -v doesnt have to be used.
[ ! -f /tsm/.INIT -o ! -f /database/.INIT ] && echo "Please use -v <USER>:/tsm.init and <DATABASE>:/database.init and run init1" && exit 1
( while ps -p $(cat /opt/tivoli/tsm/ui/Liberty/usr/servers/.pid/guiServer.pid) >/dev/null; do sleep 600; done ) &
[ -x /opt/tivoli/tsm/server/bin/dsmserv ] && su ${USER} -lc /opt/tivoli/tsm/server/bin/dsmserv &
# **NOTE**: ln /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys to /tsm/dbbkapi/dsm.sys, otherwise backups will fail
ln -sf /tsm/dbbkapi/dsm.sys /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys
wait
# Init one needs to copy some data from the install /tsm directory to our persistent storage volume - so that volume should be mounted under /tsm.init
elif [ "$1" == "init1" ]; then
[ ! -d /tsm.init -o ! -d /database.init ] && echo "ERROR: /tsm.init or /database.init doesnt exist" && exit 1
cp -a /tsm/.[a-z]* /tsm/* /tsm.init/
mkdir /database.init/tsmdb /database.init/activelog /database.init/archlog /database.init/archfaillog /database.init/mirrorlog
chown -R ${USER}:servers /database.init /tsm.init
# Init two creates our database, and runs our admin marco.
elif [ "$1" == "init2" ]; then
su ${USER} -lc "sed -i \"s/\$(cat sqllib/db2nodes.cfg |awk '{print \$2}')/$(hostname)/\" sqllib/db2nodes.cfg"
su ${USER} -lc "dsmserv format dbdir=/database/tsmdb activelogsize=2048 activelogdirectory=/database/activelog archlogdirectory=/database/archlog archfailoverlogdirectory=/database/archfaillog mirrorlogdirectory=/database/mirrorlog"
[ -f $(eval echo ~${USER}/admin.macro) ] && su ${USER} -lc "dsmserv runfile admin.macro"
touch /database/.INIT
touch /tsm/.INIT
elif [ "$1" == "upgrade" ]; then
[ ! -f /tsm/.INIT -o ! -f /database/.INIT ] && echo "Please use -v <USER>:/tsm.init and <DATABASE>:/database.init and re-run upgrade" && exit 1
/opt/tivoli/tsm/db2/instance/db2iupdt -d ${USER}
elif [ "$1" == "restoredb" ]; then
su ${USER} -lc "dsmserv restore db ${2:+password=$2} restorekeys=yes on=DBDIRS.TXT"
elif [ "$1" == "restore" ]; then
echo "! Running [dsmserv $@]"
su ${USER} -lc "dsmserv $@"
else
exec $@
fi

View File

@ -10,7 +10,7 @@
<!-- Set these variables if you are installing the OC.-->
<variable name="port" value="11443" />
<variable name="ssl.password" value="T$M4Ev3ryB0dY+" />
<variable name="ssl.password" value="" />
<!-- Update the value of installDir to change the installation directory.-->
<variable name='installDir' value='/opt/tivoli/tsm'>
@ -36,7 +36,7 @@
<!-- Operations Center profile variables. -->
<data key="user.securePortNumber,com.tivoli.dsm.gui.offering" value="${port}" />
<data key="user.SSL_PASSWORD" value="T$M4Ev3ryB0dY+" />
<data key="user.SSL_PASSWORD" value="T$M4Ev3ryB0dY!" />
</profile>
<install modify='false'>
@ -45,7 +45,7 @@
<offering id='com.tivoli.dsm.server'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.server.main'
installFixes='none' selected='false'/>
installFixes='none' selected='true'/>
<!-- Change selected='false' to skip install of the storage agent offering -->
<offering id='com.tivoli.dsm.stagent'
@ -90,7 +90,7 @@
<offering id='com.tivoli.dsm.gui.offering'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.gui.main_asm,com.ibm.java.jre'
installFixes='none' selected='true'/>
installFixes='none' selected='false'/>
</install>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>

110
install.xml Normal file
View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<agent-input clean="true" temporary="true">
<variables>
<!--@ATTENTION@ Select your product license before doing a silent install. -->
<!-- Enter 'tsm' for the value of license.selection to accept the IBM Tivoli Storage Manager license -->
<!-- Enter 'tsmee' for the value of license.selection to accept the IBM Tivoli Storage Manager Extended Edition license -->
<!-- Enter 'ssam' for the value of license.selection to accept the IBM System Storage Archive Manager license -->
<variable name='license.selection' value='tsmee'/>
<!-- Set these variables if you are installing the OC.-->
<variable name="port" value="11443" />
<variable name="ssl.password" value="" />
<!-- Update the value of installDir to change the installation directory.-->
<variable name='installDir' value='/opt/tivoli/tsm'>
<!-- For Windows, update this value to change the installation directory.-->
<if name='platform:os' equals='win32' value='C:\Program Files\Tivoli\TSM'/>
</variable>
</variables>
<server>
<repository location='repository'/>
</server>
<profile id='IBM Tivoli Storage Manager' installLocation='${installDir}' >
<data key='user.license,com.tivoli.dsm.server' value='${license.selection}'/>
<!-- @ATTENTION@ If you are upgrading an exsting server instance, replace <instanceName>-->
<!-- with the instance name you are upgrading below. If you are upgrading multiple instances -->
<!-- you can add additional instanceName_update and instanceName_password lines below for each -->
<!-- additional instance. -->
<!--data key='user.<instanceName>_update,com.tivoli.dsm.server' value='true'/-->
<!-- Update this value with the instance users password. -->
<!--data key='user.<instanceName>_password,com.tivoli.dsm.server' value=''/-->
<!-- Operations Center profile variables. -->
<data key="user.securePortNumber,com.tivoli.dsm.gui.offering" value="${port}" />
<data key="user.SSL_PASSWORD" value="T$M4Ev3ryB0dY!" />
</profile>
<install modify='false'>
<!-- This will install the server offering -->
<offering id='com.tivoli.dsm.server'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.server.main'
installFixes='none' selected='true'/>
<!-- Change selected='false' to skip install of the storage agent offering -->
<offering id='com.tivoli.dsm.stagent'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.stagent.main'
installFixes='none' selected='false'/>
<!-- Change selected='false' to skip install of the device offering -->
<offering id='com.tivoli.dsm.devices'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.devices.main'
installFixes='none' selected='false'/>
<!-- This will install the license offering -->
<offering id='com.tivoli.dsm.license'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.license.main'
installFixes='none' selected='true'/>
<!-- Change selected='false' to skip install of the Language offering -->
<!-- Language Feature names:
com.tivoli.dsm.lang.spanish
com.tivoli.dsm.lang.portuguese
com.tivoli.dsm.lang.german
com.tivoli.dsm.lang.french
com.tivoli.dsm.lang.italian
com.tivoli.dsm.lang.russian
com.tivoli.dsm.lang.japanese
com.tivoli.dsm.lang.korean
com.tivoli.dsm.lang.tchinese
com.tivoli.dsm.lang.schinese
-->
<offering id='com.tivoli.dsm.lang'
profile='IBM Tivoli Storage Manager'
features=''
installFixes='none' selected='false'/>
<!-- Change selected='false' to skip install of the Operation center offering -->
<offering id='com.tivoli.dsm.gui.offering'
profile='IBM Tivoli Storage Manager'
features='com.tivoli.dsm.gui.main_asm,com.ibm.java.jre'
installFixes='none' selected='false'/>
</install>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
<preference name='offering.service.repositories.areUsed' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
<preference name='http.ntlm.auth.kind' value='NTLM'/>
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
<preference name='PassportAdvantageIsEnabled' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>
<preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/>
</agent-input>

1
tsmdbmgr.opt Normal file
View File

@ -0,0 +1 @@
SERVERNAME TSMDBMGR_TSM