File and Object Storage

 View Only

Using IBM Storage Scale Data Access Services (DAS) along with AFM

By Madhu Punjabi posted Wed June 28, 2023 04:12 AM

  

Authors: @Madhu Punjabi  @RAVI KUMAR KOMANDURI 

IBM Storage Scale Data Access Services (DAS) provides remote access to data which is stored in IBM Storage Scale filesystems using the S3 protocol. IBM Storage Scale DAS S3 access protocol enables clients to access data stored in IBM Storage Scale file systems as objects. IBM Storage Scale DAS extends IBM Storage Scale container native and seamlessly integrates in IBM Storage Scale's existing configuration and management mechanisms.

IBM Storage Scale has an asynchronous caching mechanism, Active File Management (AFM), which can be used to implement multisite use cases. Currently for using an AFM fileset with IBM Storage Scale DAS, the AFM fileset can be exported as a bucket. This will ensure that data in the fileset will be used as is.

Let us see how to use an AFM fileset with IBM Storage Scale DAS when running stateful applications on Kubernetes or Red Hat OpenShift.

Architecture: IBM Storage Scale DAS cluster accessing IBM Storage Scale as backend storage cluster having filesets configured for AFM

Deploying the IBM Storage Scale Data Access Services (DAS)

To install the IBM Storage Scale Data Access Services v5.1.7.0 GA, please check the IBM Documentation at https://www.ibm.com/docs/en/ssdas?topic=spectrum-scale-data-access-services-517

Deploying the IBM Storage Scale AFM
To install AFM with IBM Storage Scale v5.1.7-0, please check the IBM Documentation at https://www.ibm.com/docs/en/storage-scale/5.1.7?topic=reference-active-file-management-afm

Let's Get Started !

Let us create sample filesets for AFM at IBM Storage Scale cluster. These filesets would be referred further in IBM Storage Scale bucket creation examples.

Creating a sample AFM target fileset

$ mmcrfileset fs2 afm-target --inode-space new
Fileset afm-target created with id 11 root inode 3670019.

$ mmlinkfileset fs2 afm-target -J /ibm/fs2/afm-target
Fileset afm-target linked at /ibm/fs2/afm-target     

$ mmafmconfig enable /ibm/fs2/afm-target

Creating a sample AFM cache fileset

Before creating an AFM cache fileset, set one of the nodes in the IBM Storage Scale cluster as gateway node.

$ mmchnode --gateway -N mt-node-1.fyre.ibm.com
Wed Mar 23 01:55:08 PDT 2022: mmchnode: Processing node mt-node-1.fyre.ibm.com
mmchnode: Propagating the cluster configuration data to all
affected nodes. This is an asynchronous process.


Create a sample AFM cache fileset

$ mmcrfileset fs1 afm-cache --inode-space new -p afmtarget=gpfs:///ibm/fs2/afm-target -p afmmode=sw 
Fileset afm-cache created with id 140 root inode 16252931.

$ mmlinkfileset fs1 afm-cache -J /ibm/fs1/afm-cache
Fileset afm-cache linked at /ibm/fs1/afm-cache

Verify the the relationship between the AFM cache and target filesets

$ mmafmctl fs1 getstate 
Fileset Name Fileset Target Cache State Gateway Node Queue Length Queue numExec
------------ -------------- ------------- ------------ ------------ -------------
afm-cache gpfs:///ibm/fs2/afm-target Active mt-node-1 0 2

Set the user permissions for AFM filesets
At the IBM Storage Scale cluster, set the permissions and user for the AFM cache and target filesets. If SELinux is enabled on the storage cluster, then set the SELinux MCS labels for the filesets as recommended in IBM Storage Scale DAS documentation at steps 2 and 5 at https://www.ibm.com/docs/en/ssdas?topic=installing-configuring-verifying-installation-prerequisites

$ chmod 770 /ibm/fs1/afm-cache /ibm/fs2/afm-target/
$ chown 1602:1996 /ibm/fs1/afm-cache /ibm/fs2/afm-target/
$ chcon system_u:object_r:container_file_t:s0:c111,c234 /ibm/fs1/afm-cache /ibm/fs2/afm-target/

Create a directory and sample file under the AFM cache fileset and read it from the AFM target fileset.

$ mkdir /ibm/fs1/afm-cache/afm-s3-dir
$ echo "This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster." > /ibm/fs1/afm-cache/afm-s3-dir/sample
$ cat /ibm/fs2/afm-target/afm-s3-dir/sample
This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster.


Creating a bucket for using AFM fileset with IBM Storage Scale DAS

After deploying IBM Storage Scale DAS on a Redhat Openshift cluster, create the S3 service by following the procedure described in section "Create an IBM Spectrum Scale DAS S3 object service instance" at https://www.ibm.com/docs/en/ssdas?topic=administering-managing-s3-object-service-instance
In addition create a S3 account by following the procedure described in section 'Create an IBM Spectrum Scale DAS S3 object user account' at https://www.ibm.com/docs/en/ssdas?topic=administering-managing-accounts-s3-object-access

An example of DAS S3 service creation and S3 account creation is shown in points 1 and 3 at https://www.ibm.com/docs/en/ssdas?topic=installing-example-configuration-spectrum-scale-das. For example DAS account with name 'project1' can be created as follows, along with an alias for the account.

$ mmdas account create project1 --uid 1602 --gid 1996
Account is created successfully. The secret and access keys are as follows.
Secret Key                               Access Key
----------                               -----------
czAjbq8/CzyMHJfKWvGi50nTRrS4/Id3DA/P3Hau P71YOPyNAYCdfmIjIuv4

$ alias s3p1='AWS_ACCESS_KEY_ID=P71YOPyNAYCdfmIjIuv4 AWS_SECRET_ACCESS_KEY=czAjbq8/CzyMHJfKWvGi50nTRrS4/Id3DA/P3Hau aws --endpoint https://192.0.2.12 --no-verify-ssl s3'

Create a S3 bucket based on AFM cache fileset
From a node configured to work with the OCP cluster, create an S3 export by making the AFM cache fileset accessible as an S3 bucket. For example if IBM Storage Scale file system with path "/ibm/fs1" is mounted at path "/mnt/remote-sample" in CNSA setup then a sample command would be as follows:

$ mmdas export create project1-bucket --filesystemPath /mnt/remote-sample/afm-cache/afm-s3-dir
Export is successfully created

Now AFM fileset is ready to be used as a bucket. Try writing data to the bucket by following step 3 in section "Using S3 buckets and S3 objects" at https://www.ibm.com/docs/en/ssdas?topic=installing-example-configuration-spectrum-scale-das#task_z1t_kzy_frb__title__2 

Use Case 1: Read and update the data at S3 bucket (based on the AFM cache fileset)

Below commands use the 's3p1' alias which was created in previous steps when 'project1' account was created.

$ s3p1 cp s3://project1-bucket/sample sample-copy # Read the sample file as an object
copy: s3://project1-bucket/sample to sample-copy

$ cat sample-copy
This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster.

# Append a line to sample-copy
$ echo "This line was added at S3 bucket." >> sample-copy
$ cat sample-copy
This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster.
This line was added at S3 bucket.

$ s3p1 cp sample-copy s3://project1-bucket/sample # Update the sample file upload: sample-copy to s3://project1-bucket/sample

Create a new S3 object

$ echo "This line was written to a new object created inside a S3 bucket." > new-object
$ cat new-object
This line was written to a new object created inside a S3 bucket.

$ s3p1 cp new-object s3://project1-bucket # Upload the new object upload: new-object to s3://project1-bucket/new-object

Use Case 2: Read and update the data at AFM cache fileset (mapped to S3 bucket) 

Follow below steps at the IBM Storage cluster:

$ ls /ibm/fs1/afm-cache/afm-s3-dir #shows the new-obj created at the S3 bucket
new-obj sample

$ ls /ibm/fs1/afm-target/afm-s3-dir
new-obj sample

$ cat /ibm/fs1/afm-cache/afm-s3-dir/sample
This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster.
This line was added at S3 bucket.
$ cat /ibm/fs2/afm-target/afm-s3-dir/sample
This line was written at AFM cache fileset at filesystem fs1 on Storage Scale cluster.
This line was added at S3 bucket.

$ cat /ibm/fs1/afm-cache/afm-s3-dir/new-object
This line was written to a new object created inside a S3 bucket.
$ cat /ibm/fs1/afm-cache/afm-s3-dir/new-object
This line was written to a new object created inside a S3 bucket.

$ echo "This line was added at AFM cache fileset on Storage Scale cluster." >> /ibm/fs1/afm-cache/afm-s3-dir/new-object
$ cat /ibm/fs1/afm-cache/afm-s3-dir/new-object
This line was written to a new object created inside a S3 bucket.
This line was added at AFM cache fileset on Storage Scale cluster.

Now verify by reading the updated object at S3 bucket (mapped to AFM cache fileset) at S3 client

$ s3p1 cp s3://project1-bucket/new-obj new-obj-copy # Read the new-obj file as an object
copy: s3://project1-bucket/new-obj to new-obj-copy

$ cat new-obj-copy
This line was written to a new object created inside a S3 bucket.
This line was added at AFM cache fileset on Storage Scale cluster.

Conclusion:

The above use cases show the data at IBM Storage Scale AFM cache and target filesets could be read and updated as S3 object. Similarly, new S3 objects could be read and updated at AFM cache and target filesets on the IBM Storage Scale cluster.

Note: At the time of writing this blog, performance measurement of IBM Storage Scale Data Access Services (DAS) along with AFM was not carried out.

References:

1. IBM Storage Scale Data Access Services Documentation https://www.ibm.com/docs/en/ssdas?topic=spectrum-scale-data-access-services-517
2. IBM Storage Scale AFM Documentation https://www.ibm.com/docs/en/storage-scale/5.1.7?topic=reference-active-file-management-afm
3. IBM Storage Scale Container Native Documentation https://www.ibm.com/docs/en/scalecontainernative?topic=spectrum-scale-container-native-storage-access-517


#Featured-area-2
#Featured-area-2-home
#Highlights
#Highlights-home
0 comments
895 views

Permalink