Red Hat OpenShift - Group home

Container Storage Interface volumes with IBM Z and IBM LinuxONE

By Gerald Hosch posted Wed June 07, 2023 11:03 AM


Author: Muhammad Adeel


Red Hat® OpenShift® Container Platform is using the Container Storage Interface (CSI) to interact with the backend storage devices without the need to know the underlying details regarding the storage infrastructure. The CSI driver for a storage device provide APIs, to create, delete, publish, and perform other complex operations on the underlying storage. In this blog we will discover the five special API calls which are provided by the CSI driver to perform volume snapshot, cloning, expansion, automatic migration, and inline ephemeral volumes creation. 


Red Hat OpenShift provides two types of storage, namely ephemeral and persistent, which are not installed by default and the user must install and configure them additionally. Ephemeral storage can be enabled by a simple configuration, while persistent storage can be used by installing a storage operator like Red Hat OpenShift Data Foundation on IBM® Z® and IBM® LinuxONE. Note, OpenShift Data Foundation has resource requirements; for details see the OpenShift Data Foundation installation document in the reference section below. 

Ephemeral storage

Ephemeral storage is a temporary storage which is only available during the lifecycle of a pod. It is a bind mount in pods to the root disk path /var/lib/kubelet/, which is a tmpfs mount on the worker nodes root disk. Pods can use the bind mount point, also known as volumes, to access temporary storage space on the root disk. To do so pods need to define following specification:




The downside of using ephemeral storage is, that pods can be evicted due to other pods filling the local storage, and that new pods cannot be admitted until sufficient storage has been reclaimed.

Persistent storage

Persistent storage is storage on an additional disk to the root disk. Red Hat OpenShift uses a pre-provisioned storage framework called Persistent Volumes (PV) to provision storage for application pods. The advantage of using a persistent storage is to keep data inside persistent volumes beyond lifecycle of a pod (permanent storage). In case of a root disk crash, the data inside persistent volumes exist on additional disks without any interference. A storage operator must be installed to use persistent storage. In this blog we assume OpenShift Data Foundation is installed on the Red Hat OpenShift cluster and the CSI driver is also available to perform volume snapshot, cloning, and expansion. There are also other storage operators available on IBM Z/IBM® LinuxONE, namely IBM block CSI storage and IBM Storage Scale (former IBM Spectrum® Scale). The automatic migration and inline ephemeral volumes are not supported on any IBM storage operator today.

CSI volume cloning

A volume clone is a duplicate of an existing persistent volume at a particular point in time. In the following example we will create a clone of an existing volume.

A clone of the “myclaim” volume can be created by applying the following yaml:

Here, ocs-storagecluster-cephfs storage class represents a OpenShift Data Foundation storage. To check whether the above clone is created:

CSI volume snapshot

A snapshot represents the state of the storage volume in a cluster at a particular point in time. Volume snapshots can be used to provision a new volume. In the following example we will create a volume snapshot and later create a new volume based on the snapshot on OpenShift Data Foundation storage.

We have following persistent volume claims (PVCs) available on the installed cluster:

Here, ocs-storagecluster-cephfs storage class represents a OpenShift Data Foundation storage. A snapshot for the above “myclaim” PVC can be created by applying the following yaml: To get information about the newly created snapshot:

To create new volume from the above created snapshot:

CSI volume expansion

A volume expansion can be performed on an existing volume when extra disk space is required. The volume must support the “allowVolumeExpansion” attribute in the storage class. The attribute is supported for OpenShift Data Foundation storage and is already set to true by default.

As an example, the above mentioned “myclaim” volume can be extended from 8 Gigabytes to 16 Gigabytes by editing the PVC definition as follows:

After the storage extension, the new volume size looks like:

The persistent volume claim “myclaim” has been extended from 8 Gigabytes to 16 Gigabytes.

Reference section