Using IBM Spectrum Scale for storage in IBM Cloud Private

IBM Spectrum Scale

Deepak Ghuge
IBM Cloud
10 min readNov 27, 2017

--

IBM Spectrum Scale is a flexible software-defined storage that can be deployed as high performance file storage or a cost optimized large-scale content repository. IBM Spectrum Scale is deployed at the most demanding enterprises in the world for both high performance and high scale. Refer to https://www-03.ibm.com/systems/storage/spectrum/scale/ for more details. Features that make Spectrum Scale suitable for persistent volume storage include: performance, scalability, information lifecycle management, quota, encryption, compression, availability, and snapshots.

Storage for Containers

One of the main resources inside any cluster is storage. Before you can deploy most Kubernetes-based applications, you must first create storage from the underlying infrastructure. This provisioned storage allows for persistence of an application’s data. However, for an application to consume this storage, you must also create a volume. Volumes are used to make requests on behalf of an application to the provisioned storage. You can create volumes from Spectrum Scale that are used as persistent storage for applications.

This post describes how to configure IBM Spectrum Scale as a storage backend for POD volumes in IBM Cloud Private clusters. While there are multiple ways to use a persistent volume from IBM Spectrum Scale as a POD’s volume in IBM Cloud Private, this post describes how to use the Hostpath and NFS drivers.

Before you begin

In both scenarios(Hostpath and NFS), you need a IBM Spectrum Scale cluster and a persistent volume. You can also create the custom application used in this post using following steps.

  1. Create a IBM Spectrum Scale cluster and designate several nodes as IBM Cloud Private worker nodes. In this example, dghostrhel2, dghostrhel3 and dghostrhel4 are IBM Cloud Private worker nodes

2. Create a volume on the gpfs0 filesystem and mount it on the /gpfs/gpfs0 path.

3. Create the custom application. The parameter values and file names that are used in this example are also used in later steps.

3a. Create a directory named alpine4gpfs.

3b. Create the application script in the alpine4gpfs directory. The script creates a directory in the Docker container and generates random number of files in it. Name the file number_generator.sh

Note : The above script checks for /gpfs/thisisgpfs file inside the container before generating data. Hence create the file ‘thisisgpfs’ inside fileset or nfs export which will be used as persistent volume for the sample application.

3c. Create the dockerfile in the alpine4gpfs directory.

3d. Create the custom application. From the alpine4gpfs directory, run these commands:

Note : The above command upload the image 'alpine4gpfs' in the 'admin' namespace. In case 'admin' namespace does not exist, The image upload fails with the error message ’unauthorized: authentication required’. One will need to create the required namespace for successfully uploading the image.
Steps to create the ‘admin’ namespace :
Login to IBM Cloud Private >>Manage>>Namespaces>>Click on “Create Namespace” then Create namespace with name ‘admin’

Using Storage from Spectrum Scale with IBM Cloud Private via the Hostpath driver

Prerequisites for this example:

  • IBM Spectrum Scale Cluster
  • IBM Cloud Private V2.1.0

You can choose to use some or all IBM Spectrum Scale client nodes as a IBM Cloud Private worker nodes. If not all IBM Cloud Private worker nodes are IBM Spectrum Scale clients, then you must use a node tag when you use volumes that you create from IBM Spectrum Scale. You can create volumes by using the directory or fileset commands from the IBM Spectrum Scale File system. Creating volumes by using fileset is beneficial because it lets you partition the file system to allow administrative operations at a finer granularity than the entire file system. For more information about fileset, see https://www.ibm.com/support/knowledgecenter/STXKQY_4.2.3/com.ibm.spectrum.scale.v4r23.doc/bl1adv_filesets.htm.

1. Create the fileset that the persistent volume uses

1a. Create a fileset that is named ScaleCfCHostpath:

The output looks like this:

1b. Link the fileset to the volume:

The output looks like this:

1c. Display the fileset details:

The output looks like this:

The fileset ScaleCfCHostpath is mounted on the /gpfs/gpfs0/ScaleCfCHostpath path. This path is used to create the volume in IBM Cloud Private.

2. Create the Persistent volume

2a. Log in to the IBM Cloud Private management console.

2b. From the menu, click Platform > Storage.

2c. Click Create PersistentVolume.

2d. Enter the Persistent volume details. For this example, use the following values:

You can provide these values by using the fields and lists in the Create New PersistentVolume window as shown in these images:

Persistent volume creation 1/3
Persistent volume creation 2/3
Persistent volume creation 3/3

2e. Click Create.

2f. From the PersistentVolume tab, review the status of the new persistent volume. Before you can use the persistent volume, its status must be Available.

Persistent volume details

3. Create the Persistent volume claim

3a. Click the PersistentVolumeClaim tab.

3b. Click Create PersistentVolumeClaim.

3c. Enter the volume details. For this example, use the following values:

3d. Click Create.

3e. From the PersistentVolumeClaim tab, review the status of the new persistent volume claim. The persistent volume claim should have a status of Bound, which means that the persistent volume claim is bound to the persistent volume that contains the label storage=spectrumscale and meets its storage request requirements.

Persistent volume claim details

Click PersistentVolume and review the changes to the persistent volume ‘spectrumscalestorage.

Persistent volume details

You can see that the persistent volume claim ‘ spectrumscalevolume’ is bound to the persistent volume ‘spectrumscalestorage’. The persistent volume claim ‘spectrumscalevolume’ is available to an application or pod.

4. Deploy an application that uses the new volume claim
A container is created for each instance of the application. Each container has a storage volume, and the volume contains a directory that stores the script’s random data.

4a. From the IBM Cloud Private console, click the menu and then click Workloads.

4b. From the Workloads page, click Jobs > Batch jobs.

4c. Click Create Job.

4d. Enter the job details. You must provide values for several parameters:

On the General tab, specify the job name and number of instances:

On the Container Settings tab, specify the container Name and the Image to use.

On the Volumes tab, specify the following values:

4e. Review the workloadwithalpine job details. The workloadwithalpine application with an attached volume should be running.

Batch Job details
Workload details

If you click the application name, you can see that instances of the workloadwithalpine application is created.

Pod details
Container details

Each instance of the application creates a directory of the same name in attached volume. Data generated by the applications is visible on Spectrum Scale clients, as shown in the following example:

Using Storage from Spectrum Scale with IBM Cloud Private via the NFS driver

Prerequisites for this example:

  • IBM Spectrum Scale Cluster with NFS enabled protocol nodes
  • IBM Cloud Private V2.1.0

When you use this configuration method, you can use a IBM Cloud Private worker that is different than the IBM Spectrum Scale client node. IBM Spectrum Scale file systems can be exported via NFS in a highly available manner, and you can use NFS exports via Cluster Export Services (CES) as storage volumes. You can export either a directory or fileset from IBM Spectrum Scale File system via NFS. If you use load balancing, you can use DNS instead of an individual CES IP address. You should use DNS for load balancing. For more information about using CES with Spectrum Scale, see https://www.ibm.com/support/knowledgecenter/STXKQY_4.2.0/com.ibm.spectrum.scale.v4r2.adv.doc/bl1adv_ces.htm.

Before you begin, confirm that NFS is running on a host:

Also obtain the list of CES IP addresses in Spectrum Scale:

1. Create the Spectrum Scale NFS export that the persistent volume uses

1a. Create a fileset that is named scaleCFCnfs.

The output looks like this:

1b. Link the fileset to the volume:

The output looks like this:

1c. Display the fileset details:

The output looks like this:

1d. Create the NFS export.

The output looks like this:

1e. Display the export details.

The output looks like this:

2. Create the Persistent volume

2a. Log in to the IBM Cloud Private management console.

2b. From the navigation menu, click Platform> Storage.

2c. Click Create PersistentVolume.

2d. Enter the persistent volume details. For this example, use the following values:

Persistent volume creation 1/3
Persistent volume creation 2/3
Persistent volume creation 3/3

2e. Click Create.

2f. From the PersistentVolume tab, review the status of the new volume. Before you can use the storage, its status must be Available.

Persistent volume details

3. Create the Persistent volume claim.
Follow the steps to create a persistent volume claim in the “Using Storage from IBM Spectrum Scale with IBM Cloud Private via Hostpath driver” section
Note: Use name=spectrumscalenfsvolume and Label ’storage=spectrumscalenfs’

Persistent volume claim details

4. Deploy the application
Follow the steps to deploy an application in the “Using Storage from IBM Spectrum Scale with IBM Cloud Private via Hostpath driver” section.
Note : Use volumename=spectrumscalenfsvolume

You can view the new batch job on the Batch page.

Batch Job details
Pod details
Container details

The data generated by applications is visible on the IBM Spectrum Scale nodes.

--

--