Overview

The createStorageAllNodes.sh (noi-local-storage-create-0.4.0.zip) script helps you set up Kubernetes local volume StorageClasses and PersistentVolumes (PVs), which are required by Netcool Operations Insight running on Red Hat OpenShift. The script generates PVs using local storage, which are mapped volumes that are mapped to directories off the root file system on the parent node. Local storage volumes are only intended for proof of concept (PoC) or demonstration environments and should not be used in production. For production systems, consult with your system administrator for a file system with the required performance, scale, and redundancy requirements.

Before you begin

Please ensure the following:

  • You are logged into a master node of your cluster.
  • The Alpine Linux image is available.
  • You are using the default namespace.

See the troubleshooting section if you experience problems.

Creating local storage volumes

  • Create storage classes.

The script creates the following storage classes:

[release]-local-storage-cassandra
[release]-local-storage-cassandra-bak
[release]-local-storage-kafka
[release]-local-storage-zookeeper
[release]-local-storage-couchdb
[release]-local-storage-db2
[release]-local-storage-impactgui
[release]-local-storage-ncobackup
[release]-local-storage-ncoprimary
[release]-local-storage-openldap
[release]-local-storage-scala
[release]-local-storage-nciserver

  • Create PVs.

The script creates the following PVs for each node:

[release]-local-storage-cassandra-[node]
[release]-local-storage-cassandra-bak-[node]
[release]-local-storage-kafka-[node]
[release]-local-storage-zookeeper-[node]
[release]-local-storage-couchdb-[node]
[release]-local-storage-db2-[node]
[release]-local-storage-impactgui-[node]
[release]-local-storage-ncobackup-[node]
[release]-local-storage-ncoprimary-[node]
[release]-local-storage-openldap-[node]
[release]-local-storage-scala-[node]
[release]-local-storage-nciserver-[node]

  • Create directories.

On each worker node the script creates directories under the root directory:

[root]/[release]/cassandra
[root]/[release]/cassandra-bak
[root]/[release]/kafka
[root]/[release]/zookeeper
[root]/[release]/couchdb
[root]/[release]/db2
[root]/[release]/impactgui
[root]/[release]/ncoprimary
[root]/[release]/ncobackup
[root]/[release]/openldap
[root]/[release]/scala
[root]/[release]/nciserver

The script can either automatically create required storage classes, PVs, and directories. Or, the script can output a YAML template, which can be used with the kubectl create -f command.

Deleting local volumes

In addition to creating local storage artifacts, the script also outputs a delete script called deleteStorageAllNodes.sh, which removes all artifacts created by the createStorageAllNodes.sh script.

Create script usage

%> ./createStorageAllNodes.sh -h
This script will create local Storage Classes, Persistent Volumes and Directories required by Netcool Operations Insight
Usage: ./createStorageAllNodes.sh [-dnryh] [-d base directory path] [-n nodes] [-r release name] [-y yaml output only] [-s silent mode] [-h help]

Examples

Create storage on all worker nodes

The following example creates storage for a Netcool Operations Insight release called noi with a root directory path on each worker node of the /home/netcool/ibm-netcool/prod path. A deleteStorageAllNodes.sh delete script is also created.
%> ./createStorageAllNodes.sh -d /home/netcool/ibm-netcool-prod

Create storage on a specified node

The following example creates storage for a Netcool Operations Insight release called noi with a root directory path on each worker node of the /home/netcool/ibm-netcool/prod path. A deleteStorageAllNodes.sh delete script is also created.
%> ./createStorageAllNodes.sh -n "10.2.3.4 10.2.3.5"

Create YAML template

The following example outputs a YAML template file noi-storage.yaml, which can be used with the kubectl create -f command to create storage for a Netcool Operations Insight release called noi with a root directory of /root/ibm-netcool-prod. No delete script is created, instead the storage artifacts can be removed by running the kubectl delete -f noi-storage.yaml command.

Note: This example does not remove the storage directories on the nodes. They must be removed manually.

%> ./createStorageAllNodes.sh -y > noi-storage.yaml

Delete script usage

./deleteStorageAllNodes.sh -h
This script will delete PVCs, PVs, Storage Classes and directories created by ./createStorageAllNodes.sh
Usage:  ./deleteStorageAllNodes.sh [-sy]
 [ -s silent mode ]
 [ -y yaml only ]
 [ -h help ]

Troubleshooting

Default namespace

The script is intended to run in the default namespace. When running in a different namespace, ensure the namespace has the correct privileges in order to create the following Kubernetes artifacts:

  • Storage classes
  • PVs
  • Directories

Alpine linux

The script requires the alpine image in order to create directories on worker nodes. If the cluster does not have a connection to docker hub, the createStorageAllNodes.sh script hangs:

Script hangs when deleting PVs

Firstly, check that there are no PVCs bound to the PV, as these prevent the PV from being deleted.
Secondly, editing the PV and removing the finalizer allows the PVC to be deleted, for example:

kubectl patch pv [name] -p '{"metadata":{"finalizers":null}}'

Multiple PVs can be deleted with the following command:

kubectl get pv | cut -f1 -d' ' | grep [release] | grep -v NAME | xargs kubectl patch pv -p '{"metadata":{"finalizers":null}}'

noi-local-storage-create-0.4.0.zip

Released: 31 Oct 2019
Updated: 16 July 2020
Version: N/A
Cost: No Charge
Support: Not Supported
Download License: L-JROZ-72S5LA

Resources

Requirements

  • IBM Netcool Operations Insights V1.6.1 on Red Hat OpenShift

Support

This package is subject to the License terms included, along with those displayed upon download.

To report a problem with deploying this entry, entitled customers may contact the country specific IBM support channel, reference the IBM Worldwide Directory.

5 comments on"Local storage script"

  1. Some steps provided in this link are not correct and is confusing
    https://developer.ibm.com/itom/2019/06/28/local-storage-script/

    1. In step 1 – NOI 1.6 is now installed using ICP GUI. Editing values.yaml file is old way. In order to get values.yaml file, we have to untar NOI_V1.6_OM_FOR_ICP.tar.gz, then in charts directory, untar ibm-netcool-prod-2.1.0.tgz, which is not needed at all when installing NOI 1.6. Besides, the mentioned storage class name for each microservice are the default one in helm chart. We don’t need modify values.yaml file at all.

    2. In step 2 – Using this command ./createStorageAllNodes.sh -a -f sshscript.sh to generate sshscript.sh. sshscript.sh file is empty. Nothing is in it. After running createStorageAllNodes.sh , PV and local directories are created.

    3. In step 3, the output of ‘kubectl get pods -o wide’ commands doesn’t appear from NOI. NOI doesn’t have these pods.

  2. Thanks for the feedback, Bin Tang. The information and procedure has been updated.

  3. the reference to the createStorageAllNodes.sh (createStorageAllNodes.zip) at the top is wrong.
    clicking here gives you a zip file with HTML content 🙂

  4. Thanks Mario, the file has been updated.

  5. Hi, looks like the issue mario mentioned is still present in the file linked in the Overview paragraph text as “createStorageAllNodes.sh (noi-local-storage-create-0.2.0.zip)” as this contains html content. However the link on the right as “noi-local-storage-create-0.2.0.zip” is working as expected and provides a zip of the script.

Join The Discussion

Your email address will not be published. Required fields are marked *