IBM Support

Cloud Storage solutions for i - Using CPYTOCLD & CPYFRMCLD to copy data to and from the cloud

How To


Summary

This document shows you how to set up a cloud resource and copy data to and from the cloud.

Steps

Create the cloud resource:
You must create the cloud resource by using the CRTS3RICC command.  This example uses IBM Cloud Object Storage as the cloud provider:
CRTS3RICC RSCNM(IBMCOS)                                     
          RSCDSC('IBM Cloud Object Storage')                
          KEYID(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)           
          SECRETKEY(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)                               
          BUCKET(xxxxxxxxxxx)                               
          RSCURI('s3.us-east.cloud-object-storage.appdomain.cloud')                                   
 
The information for the KEYID, SECRETKEY, BUCKET, and RSCURI must come from your cloud provider.

For the resource URI, use the public endpoint. The direct endpoint or private endpoint requires a VPN or proxy, which is not covered in this document.  Setting up the proxy or VPN is done outside of Cloud Storage Solutions for i.  Information on using a proxy with Cloud Storage Solutions for i.

Use the WRKCFGICC command to see the resource you created.
Copy file to the cloud:
Now you are ready to copy an IFS file to the cloud.  Cloud Storage Solutions for i only works with IFS files.  This includes virtual tape or optical files.

First, start the subsystem:
  STRSBS QICC/QICCSBS

Copy to the cloud:
CPYTOCLD RESOURCE(IBMCOS)               
         LOCALFILE('/icctestfile.txt')  
         CLOUDFILE(icctestfile.txt)    

Use the WRKSTSICC *ALL *ALL command to check the status of your transfer:
image 9908
Note the status is successful. If it was still in progress, it would have a status of active, and show the percent complete. Check your bucket on your cloud provider and make sure the file is there.
Copy the file from the cloud:
Copy the file back from the cloud by using the CPYFRMCLD command:
 CPYFRMCLD RESOURCE(IBMCOS)                 
           CLOUDFILE(icctestfile.txt)        
           LOCALFILE('/iccFromCloud.txt')   

Check the status by using WRKSTSICC *ALL *ALL:
image 9909
Use WRKLNK to see the new file exists:
image 9910
You successfully created a resource, and copied a file to and from the cloud.
 

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.3.0"}]

Document Information

Modified date:
14 May 2021

UID

ibm16452285