Setting the storage class for caching in Data Virtualization

Block storage in a persistent volume (PV) is the default storage type for data caching in Data Virtualization, but you can change the storage type to object storage.

Note:

The use of object storage for caching is available only as an early preview. Do not use this feature in production environments. In production environments, continue to use the default type, block storage in a persistent volume (PV), for data caching in Data Virtualization.

Before you begin

To complete this task, you must be the user that provisioned this service instance or have the Data Virtualization Admin role. For more information, see Managing users in Data Virtualization.

About this task

When you provision an instance of Data Virtualization, block storage in a persistent volume (PV) is the default storage type for caching event data. However, you can, use object storage, such as Amazon S3 storage or IBM Cloud Object Storage, instead.

You can change the storage type for caching on a running Data Virtualization instance at any time after the instance is provisioned or upgraded. When you use object storage for caching, you own and manage the object storage. For example, you create your own buckets for caches and you manage and rotate credentials if they need to be changed.

When you change the storage type, new caches are created and stored in the new storage class. Pre-existing caches that you created and that are enabled before you change the storage type are automatically migrated to the new storage class. Caches that are recommended, disabled, failed, or deleted are not migrated after you change the storage type. Caches that are created automatically through the use of the autocaching feature in Data Virtualization are not migrated.

Determining the current storage type for caching

Before you change the storage type, verify the type that is used by the caching pod:

  • Run the following command to find the storage type:
    oc describe pod -l role=dvcaching | grep -i
          object

    If the results show empty values for OBJECTSTORE_BUCKET and OBJECTSTORE_ENDPOINT, the storage type is block storage. If the values are not empty, then the storage type is object storage and the storage uses the bucket name and endpoint values that are specified.

    For example, in the following results, the empty values indicate that the storage type is block storage:
    oc describe pod -l role=dvcaching | grep -i object   
          OBJECTSTORE_BUCKET:                  
          OBJECTSTORE_ENDPOINT: 

Changing the type of object storage from another type of object storage or from block storage

Complete the following steps to change from one type of object storage to another type, or to change from block storage to object storage:
  1. Run the following command to edit the Big SQL Custom Resource (CR):
    oc edit bigsql db2u-dv
  2. Add the object storage credentials to the CR in the format that is shown in the following example for Amazon S3 object storage:
    dvCachingObjectStorageCredential:
      name: <ANY NAME>
      s3:
        accessKey:
          value: <ACCESS KEY>
        bucketName: <PRE EXISTING BUCKET NAME>
        disabledSSL: false
        endpoint: <END POINT>
        pathStyleAccess: true
        secretKey:
          value: <SECRET KEY>
  3. Save the changes and wait for the caching pod to restart.
Pre-existing caches are deleted and re-created. New caches use the object storage.

Changing to block storage from object storage

Complete the following steps to change back to block storage from object storage:
  1. Run the following command to edit the Big SQL Custom Resource (CR):
    oc edit bigsql db2u-dv
  2. Delete the dvCachingObjectStorageCredential section from the CR.
  3. Save the changes and wait for the caching pod to restart.
The object storage environment variables in the caching pod are now empty strings, indicating that block storage is used:
oc describe pod -l role=dvcaching | grep -i object   
      OBJECTSTORE_BUCKET:                  
      OBJECTSTORE_ENDPOINT: 
Pre-existing caches are deleted and re-created. New caches use block storage.