Automated IBM Spectrum Control installation with Ansible.

Ole Kristian Myklebust
Possimpible
Published in
8 min readJan 28, 2020

This article is written to help with the installation of IBM Spectrum Control on Linux with the Automation tool RedHat Ansible.

Update 27.12.21.
Updated and tested with version: Spectrum Control 5.4.5 and IBM DB2 11.5.4

Some information about the IBM Spectrum Control Product

  • IBM Spectrum Control, previously known as IBM Tivoli Storage Productivity Center, provides a single point of control that administrators manage every aspect of the storage infrastructure — between the hosts, through the fabric, and down to the physical disks — across multi-site storage environments.
  • IBM Spectrum Control helps consolidate management of file, object, SAN, server-based and software-defined storage.
  • With support for block file and object systems, Spectrum Control enables administrators to provide efficient management for heterogeneous storage environments.
  • Spectrum Control delivers a complete set of advanced functions to manage Spectrum Virtualize, Spectrum Accelerate, and Spectrum Scale storage infrastructures as well as traditional IBM and select 3rd party storage hardware systems.

There is also a cloud-based solution called — IBM Storage Insights

For more information and IBM Spectrum Control documentation, check out [KnowledgeCenter]

Ansible information

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com

  • Ansible Playbooks
    It uses YAML in form of ansible-playbook. Playbook is a file where automation is defined through tasks. A task is a single step to be performed like installing a package.
  • Ansible Roles
    Roles are ways of automatically loading certain vars_files, tasks, and handlers based on a known file structure. Grouping content by roles also allows easy sharing of roles with other users.
    Roles can be dropped into Ansible PlayBooks and immediately put to work.
  • Ansible Galaxy
    Galaxy is a hub for finding and sharing Ansible content.
  • More Information about Ansible
    There is plenty of information about Ansible on Medium:
    Check out this article:

Ansible Role:

Reason for creating an Ansible role to install IBM Spectrum Control

The Spectrum Control installation can be sometimes time-consuming, boring and upgrades are getting more frequent. So with that, I wanted to simplify and automate the installation of IBM Spectrum Control and IBM DB2.
PS: The role can be used to update IBM Spectrum Control.

The feature of the Spectrum Control Ansible role

  • Install and configure IBM Spectrum Control on RedHat and Centos
  • Installation option for Singel Server: Singel Typical and Singel Custom installation
  • Upgrade IBM Spectrum Control
  • Integrated DB2 installer with DB2Role.

Also, check the latest readme from GitHub.

For more Information about the Ansible role on Galaxy and GitHub

GitHub Ansible Spectrum Control
Ansible Galaxy -Spectrum Control

What do you need ✅

Make sure you have these before start:

  • Host/VM to serve the IBM Spectrum Control and Database (IBM DB2)
    Check HW Requirements —
    - Recommended Memory is 32 GB RAM, but at least 16 GB is. recommended as a minimum.
    - Disk space is from 50–100Gb++ Depends on The number of resources that are monitored
  • IBM DB2 Binary and IBM Spectrum Control Binary. (Download from PassportAdvantage)
  • SSH connection from your Ansible controller to the IBM Spectrum Control host.
  • IP-Connection to the Storage Systems you want to monitor.
  • For more information about Spectrum Control and config see KC

If you already have the Ansible controller installed, skip to #2

1. Install Ansible on your control node. 🖥

  • To install Ansible on your control node, this could be a host, docker or your local computer, there are many guides to install Ansible out there so just google Ansible install and your OS.
  • For CentOs/Red Hat Enterprise Linux:
    You can use the yum installer. $ sudo yum install ansible
  • Mac:
    The preferred way to install Ansible on a Mac is via pip
    or use Brew if you have that installed.

2. Downloading the Control and DB2 role from Ansible Galaxy ☁️

To download the role we use the ansible-galaxy command:

$ ansible-galaxy install olemyk.ansible_spectrum_control
$ ansible-galaxy install olemyk.ansible_role_db2

This will then download the role from Ansible Galaxy and store it in
/Users/username/.ansible/roles

$ ansible-galaxy install olemyk.ansible_spectrum_control
- downloading role ‘ansible_spectrum_control’, owned by olemyk
- downloading role from https://github.com/olemyk/ansible_spectrum_control/archive/master.tar.gz
- extracting olemyk.ansible_spectrum_control to /Users/olemyk/.ansible/roles/olemyk.ansible_spectrum_control
- olemyk.ansible_spectrum_control (master) was installed successfully

3. Create the playbook Spectrum_Control_playbook.yml 📝

After downloading the Ansible role, we need to create an Ansible playbook.

The best is to create a playbook with an editor that supports yaml.
- IntelliJ IDEA, Atom IDE, SubLime, notepad++
Or just use $ vi spectrum_control_playbook.yml

Paste in one of the playbook examples below and change the parameters for your environment.

Note: List of all parameters and more playbooks examples:
Check out github readme for more example and parameters.

Ansible role variables for IBM Spectrum Control.

Jump to Examples if you are excited to start, and come back if more information is needed.

Default variables are defined in defaults/main.yml. You'll also find detailed documentation in that file. Define your own host variables in your inventory to override the defaults.

Spectrum Control binary
This controls how to send the SC binary to the remote hosts.

Define the sc_binary and set up the URL to download.
Variable ‘location’ define where should put SC on ansible machine
Variable ‘dest’ define where should decompress SC on a remote host

sc_binary:
url: A URL to download SC (don´t set this if you want to use a local copy)
location: A path to save the remote file or to get the file if URL wasn't defined
dest: Where the role should decompress SC on remote host.

sc_license_binary:
url: "http://1.1.1.1/IBM_SPM_CTL_ADV_V5.3.4_Lcns_UNIX.tar.gz"
location: "/download/installer/sc_license.tar.gz"
dest: "/download/installer/"

Default unarchive names
Default is 'sc_binary and sc_license'
sc_creates: sc_binary
sc_license_creates: sc_license

Delete Downloaded Binary from IBM Spectrum Control Host after installation

  • Default is 'true'
    sc_binary_download_delete: true

Temporary location for Silent installation file.

  • Default is /tmp
    sc_properties_location:'/tmp'

Silent Install Properties file

  • db2_home_directory: is home directory for your user:
  • license_accept: If the LICENSE_ACCEPTED has a value other than 'true' the installation will exit.
  • varSrvName: Specify the hostname of this local server machine where SC software will be installed. The hostname can be a fully qualified hostname
  • varCommonUsrID: Specify the common user ID. This user id will be used to install SC software. This user id needs to have administrative privileges for the server and the DB2 software.
  • varCommonUsrPW: Specify the valid password for the common user ID
sc_db2_home_directory: '/db2/db2inst1'
sc_properties:
license_accept: 'true'
varSrvName: 'lbs-sc.lbs.loc'
varCommonUsrID: 'db2inst1'
varCommonUsrPW: 'mypassword'

Default silent install properties

  • language: Specify the preferred installation language
    - The supported values are: cs, de, en, es, fr, it, ja, ko, pl, pt_BR, hu, ru, zh_CN, zh_TW
  • user_install_dir: Specify the directory where the SC software will be installed. In case of upgrade and resuming failed install scenarios, specify the directory where SC software is installed
  • varTPCPortRangeSP: Specify the range of the ports needed to install the SC software. SC needs 24 ports.
    - The default port range is 9549 to 9572. SC uses these default
  • VarFullRollback: Specify the type of rollback you would like the installer to perform in the event of a failure.
    - a) 0 = partial rollback(default value)
    - b) 1 = full rollback
  • varUseLicenseKeyOnImage: Specify whether to use the license key file present on the install image.
    - a) 0 = use license key present on the install image (default value)
    - b) 1 = provide the location of the license key file
  • varLicenseKeyFile: Specify the complete path for the license key file. if not using default.
sc_properties_default:
language: 'en'
user_install_dir: '/opt/IBM/TPC'
varTPCPortRangeSP: '9549'
varFullRollback: '0'
varUseLicenseKeyOnImage: '0'
varLicenseKeyFile:

SC Database advanced customization
Modify the silent variables below to further customize the SC Database component installation.

sc_properties_custom:
varDBAdmUsr:
varDBAdmPW:
varDBName: 'TPCDB'
varDBPath:
varDBLogPath:

IBM Spectrum Control Upgrade
To upgrade Existing IBM Spectrum Control.

  • Modify the silent variables below to Upgrade. you do this by setting the Variable SC_upgrade: to 'True'
sc_upgrade: false
sc_properties_upgrade:
license_accept: 'false'
confirm_replication_uninstall: 'false'
confirm_reports_uninstall: 'false'
varAlertKeystorePW: 'default'
varDeviceKeystorePW: 'default'
varWebKeystorePW: 'default'

Ansible variables for IBM DB2 Role

This Ansible role has been forked from bernardoValeansible_role_db2 , and Updated to work with newer DB2 versions and Spectrum Control.
Ansible_role_db2

You can use the default in the example below uses, just change the password.

Define the db2_binary and set up the URL to download.

  • Variable location define where should put db2 on ansible machine
  • Variable dest define where should decompress DB2 on remote host
db2_binary:
url: "http://1.1.1.1./DB2_AWSESRU_F_LIN_V11.1.4_F_SC.tar.gz"
location: "/download/installer/db2_11.1.4.tar.gz"
dest: "/download/installer"
db2_license_binary:
url: "http://1.1.1.1/DB2_AWSE_Restricted_Activation_11.1.zip"
location: "/download/installer/db2_license.tar.gz"
dest: "/download/installer"

Configure DB2 Instance

Password is plaintext and then it Hashed with ansible. example is “mypassword”

db2_instances:
- instance: "DB2INST"
name: "db2inst1"
group_name: "db2iadm1"
fenced_username: "db2fenc1"
fenced_group_name: "db2fadm1"
home_directory: "/db2/db2inst1"
fenced_home_directory: "/db2/db2fenc1"
password: "mypassword"
fenced_password: "mypassword"
uid: 11999
gid: 11987
fenced_uid: 11888
fenced_gid: 11876
options:
autostart: "YES"
start_during_install: "YES"
dbm_params:
intra_parallel: "YES"
numdb: "15"
SVCENAME: db2c_db2inst1
db2fcmcomm: "TCPIP4"
resp:
prod: "DB2_SERVER_EDITION"
file: "/opt/ibm/db2/V11.1"
lic_agreement: "ACCEPT" # ACCEPT or DECLINE
install_type: "TYPICAL" # TYPICAL, COMPACT, CUSTOM
install_tsamp: "NO"

DB2 Compressed Binary Name

On most DB2 compressed binary the tar.gz creates a file named server, but if your compressed file doesn’t. change this variable to the name of the folder that it creates. For the Spectrum Control it uses the values below:

For the IBM Spectrum Control DB2 binary package it uses 'server_t'
For the IBM Spectrum Control DB2 License package it uses 'awse_o'

db2_creates: 'server_t'
db2_license_creates: 'awse_o'

Examples playbooks: 📝

Example 1 — Install SC without DB2 Role

Example 2 — Install SC with IBM DB2 Role

Example 3 — Upgrade IBM Spectrum Control

Parameters:

Check out github readme for more example and parameters.

4. Create Host inventory file. 🚧

Then we need a host to run the playbook on.

$ vi hosts

Copy the example below.
The first line: is the Group [sc]
Second line: contains the name of the SC hosts and ip-address.

[sc]
lbs-sc ansible_host=10.10.10.167

5. SSH Connection. 🔓

The host needs to be up and running before we start the playbook, and we need to have passwordless ssh from your Ansible control host.
You can specify a password with option --ask-pass but this requires SSHPASS on your Ansible controller.

To setup passwordless ssh, copy your ssh-key from the Ansible control node to the IBM Spectrum Control host.

ssh-copy-id root@10.10.10.167
  • If you don’t have an SSH Key Generated on your Ansible Controller, create one $ ssh-keygen -t rsa
  • Test that you can SSH to the SC server/host without password:
    $ ssh root@10.10.10.167

6. Run the playbook 🏃

To be able to run the playbook, the command needs to include:
ansible-playbook (the name of the playbook) and the (host inventory file.)

ansible-playbook spectrum_control_playbook.yml -i hosts

When the playbook has completed, the recap outputs the tasks.
If there is failed task, look into the play to see detailed of the failed tasks.

For verbose output you can run the ansible-playbook command with the option: -vv

PLAY RECAP *******************************************************************************************************************************************************************************************************************************************
lbs-sc : ok=25 changed=3 unreachable=0 failed=0 skipped=39 rescued=0 ignored=0

NOTE: The last task wil also send out an information if the configuration and installation is finished or if there is errors.

TASK [olemyk.ansible_spectrum_control : Install SC | finalize installation] ***********************************************************************************************************************************************************
ok: [lbs-sc] => {
"msg": [
"#######################################################################",
" Configuration is finished installing and configuring IBM Spectrum Control",
" To access IBM Spectrum Control go to https://10.10.10.167:9569/srm/",
"#######################################################################"
]
}

Ta-da! 👏

The IBM Spectrum Control installation should now be completed.

Troubleshoot

If errors when installing: check the lax*-out.txt” & lax*-err.txt files in /tmp on the SC host.

Check that the version in your download folder is correct

"cat /download/installer/SC/version.txt"

--

--

Ole Kristian Myklebust
Possimpible

Nerd, Loves the mountains and all that come with it. IBMer that works for IBM Lab Services. My own Words and opinion.