Engineering

Engineering

Come for answers, stay for best practices. All we're missing is you.

 View Only

ELM - Scripts for a complete silent/batch installation

By Jérôme Desquilbet posted Fri September 25, 2020 10:18 AM

  

This article aims at explaining how to install / uninstall / upgrade IBM Engineering Lifecycle Management (ELM), entirely using scripts, i.e. in batch mode.

Nothing really new here as this works for quite a few past versions, but a concise set of explanations in a single place about how to achieve that.

Environment

We will assume an installation on a supported UNIX (RHEL, AIX…) with a console-only (ssh) access. As I am writing, the current ELM version is 7.0.1.

Steps for a new installation

  1. Create a technical user, for example jazz (it is a good practice not to run an application as root).
  2. Create a directory structure to hold the installation, for example:

Note: IM = IBM Installation Manager.

/opt/
Jazz/
IM/ (for IM)
IMShared/ (for IM)
repos/ (for IM)
scripts/ (for the installation scripts)
JTS-7.0.1/ (the installation target)
etc/ (for IM)
var/ (for IM)

Notes:

  • etc/ and var/ will be created when running IM, but in ~jazz, so prepare in advance sym links
    • ~jazz/etc/opt/Jazz/etc
    • ~jazz/var/opt/Jazz/var
  • it is a good practice to mention the version in the target installation directory name: it will be very useful for the next upgrade when the new version will have to be installed besides the current one.
  • I always unzip the IM repositories in /opt/Jazz/repos so that the scripts do not have to do it. Takes more disk space however.
  1. Upload the IM repositories (product and latest iFix)
  2. Write the scripts :-)
  3. Run the scripts :-)

Scripts to be created

  • IM install
  • IM uninstall
  • ELM install
  • ELM iFix install
  • ELM uninstall
  • ELM certificates install
  • ELM setup

For a new installation, the scripts have to be run in that order:

  1. IM install
  2. ELM install
  3. ELM certificate install
  4. ELM setup (start ELM before)
  5. ELM iFix install

For completely uninstalling:

  1. ELM uninstall
  2. IM uninstall

Note that there some differences between Linux and AIX; here are two differences I needed to take into account at some point:

  • unzip command does not exist in AIX, jar has to be used (and installed before that), hence:
OS=`uname`
if [ ${OS} = "Linux" ]
then
JAZZ_ARCH='x86_64'
elif [ ${OS} = "AIX" ]
then
JAZZ_ARCH='ppc64'
else
echo -e "\n\tOS ${OS} is not Linux nor AIX!\n\a"
exit 2
fi
if [ `uname` = "AIX" ]
then
Unzip="jar xf"
else
which unzip
status=$?
if [ ${status} -eq 0 ]
then
Unzip="unzip -q"
else
echo -e "ERROR: unzip not found! jar not found! Won't be able to unzip :-("
exit 3
fi
fi
(BTW, this also defines the architecture variable needed for the IM configuration).
  • in AIX, sed does not know the -i (--in-place) argument, hence

replace

sed -i -e <expression> ${File}


by something like

mv ${File} ${File}.tmp ; sed -e <expression> ${File}.tmp > ${File}


(useful in case you want to use a template and change it depending on the version and variant of ELM and its environment).

A final advice, start your scripts with

export LANG=C


to be sure everything will be in English, other languages being chosen explicitly through the installation configuration.

Scripts running IM

First thing, install IM manually:

export LANG=C
cd /opt/Jazz/repos/agent.installer*
./userinstc -c # console mode
when prompted to do so, choose to generate a response file (install_IM.xml). A response file is an XML file that can be used to silently run IM.


Now, uninstall IM:

export LANG=C
/opt/Jazz/var/ibm/InstallationManager/uninstall/uninstallc


You are back to an empty installation, but with an XML response file to install IM itself:

export LANG=C
cd /opt/Jazz/repos/agent.installer*
JAZZ_RESPFILE=/opt/Jazz/scripts/IM/install_IM.xml
./userinstc -input "${JAZZ_RESPFILE}" -acceptLicense

IM has been silently installed.

Note that you can change the generated install_IM.xml file and add variables in it, that will have to be given values on the userinstc command line.

For example, use the following install_IM.xml file (compare with the one you got earlier):

<?xml version='1.0' encoding='UTF-8'?>
<agent-input clean='true' temporary='true'>
    <variables>
        <variable name='version' value='1.9'/>
        <variable name='jazzDir' value='/opt/Jazz'/>
        <variable name='imDir' value='${jazzDir}/IM'/>
        <variable name='repo' value='${jazzDir}/repos/agent.installer.${version}'/>
        <variable name='arch' value='x86_64|ppc'/>
    </variables>
    <server>
        <repository location='${repo}'/>
    </server>
    <profile id='IBM Installation Manager' installLocation='${imDir}' kind='self'>
        <data key='cic.selector.arch' value='${arch}'/>
        <data key='cic.selector.nl' value='en'/>
    </profile>
    <install>
    <!-- IBM® Installation Manager -->
        <offering profile='IBM Installation Manager' id='com.ibm.cic.agent' version='${version}' features='agent_core,agent_jre,agent_web'/>
    </install>
</agent-input>

as follows:

export LANG=C
./userinstc -input "${JAZZ_RESPFILE}" \
    -variables jazzDir="${JAZZ_DIR}",imDir="${JAZZ_IM_DIR}",repo="${JAZZ_IM_REPO}",arch="${JAZZ_ARCH}",version="${JAZZ_VERSION}" \
    -acceptLicense

Now, you know how to create a script (and a response file) to install IM. Uninstalling IM has been covered, too.

Using IM to install and uninstall ELM

IM in batch always works reading a response file. I have some generic response files to use and adapt, but you can choose to generate one each time you need it, with a test sequence like:

  1. install IM (see above)
  2. install ELM with the options you need, in order to generate an IM installation response file (launch IBM IM in console mode with the -record parameter)
export LANG=C
/opt/Jazz/IM/eclipse/tools/imcl \
    -consoleMode \
    -acceptLicense \
    -record "${JAZZ_INSTALL_RESPFILE}"
  1. uninstall ELM, in order to generate an IM uninstallation response file
export LANG=C
/opt/Jazz/IM/eclipse/tools/imcl \
    -consoleMode \
    -acceptLicense \
    -record "${JAZZ_UNINSTALL_RESPFILE}"
  1. Edit the response files, add variables if needed

  2. install/uninstall from a script

export LANG=C
/opt/Jazz/IM/eclipse/tools/imcl \
    -input ${${JAZZ__RESPFILE}} \
    -acceptLicense

Now, you know how to create a script and a response file to install ELM and to uninstall ELM.

ELM setup scripts

After the ELM installation step, the setup is usually run by starting the server, pointing an internet browser to https://example.com/jts/admin/setup, then going through all the steps.

The same can be done in console mode with a repotools command, first to record a setup property file, then to setup from the command line, taking the previously generated property file as an input. The test sequence will be:

  1. Install IM and ELM (see above)
  2. Generate a setup property file
export LANG=C
rm ${JAZZ_SETUP_PROPERTYFILE}
cd ${JAZZ_JTS_DIR}/server
./server.shutdown # in case...
./server.startup
./repotools-jts.sh -setup \
    repositoryURL=https://${HOST_PORT}/jts \
    responseFile=${JAZZ_SETUP_PROPERTYFILE} \
    overwrite=yes \
    adminUserId=${LOGIN} \
    adminPassword=${PASSWORD} \
    prompt \
    includeLifecycleProjectStep=false
./server.shutdown
  1. Edit the property file if needed
  2. Uninstall ELM (see above)
  3. Setup from the command line
export LANG=C
cd ${JAZZ_JTS_DIR}/server
./server.shutdown # in case...
./server.startup
./repotools-jts.sh -setup \
    repositoryURL=https://${HOST_PORT}/jts \
    parametersFile=${JAZZ_SETUP_PROPERTYFILE} \
    overwrite=yes \
    adminUserId=${admin_userid} \
    adminPassword=${admin_password} \
    prompt=missing
./server.shutdown

Now, you know how to create a script to perform the setup steps in batch mode.

Other scripts

Other scripts are need, that don’t rely on IM:

  • ELM iFix install (script the instructions given in the README file)
  • ELM certificates install (script the commands needed for doing that)

Conclusion

Preparing a complete installation and setup in silent/batch mode takes some efforts and patience. But there are many advantages when it is ready:

  • no more manual steps
  • the documentation is the scripts
  • it can be easily repeated on the same server
  • it can be easily repeated on different servers (different environments, different product configurations) with only some variants in the input files
  • it can be reused for the next version.

Hopefully, this article will help you jumping into that mode.


#Engineering
#Sustainability
0 comments
29 views

Permalink