Chapter 4. Configuring cluster storage


4.1. Adding cluster storage to your data science project

For data science projects that require data to be retained, you can add cluster storage to the project. Additionally, you can also connect cluster storage to a specific project’s workbench.

Prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • If you are using OpenShift AI groups, you are part of the user group or admin group (for example, rhoai-users or rhoai-admins) in OpenShift.
  • You have created a data science project that you can add cluster storage to.

Procedure

  1. From the OpenShift AI dashboard, click Data science projects.

    The Data science projects page opens.

  2. Click the name of the project that you want to add the cluster storage to.

    A project details page opens.

  3. Click the Cluster storage tab.
  4. Click Add cluster storage.

    The Add cluster storage dialog opens.

  5. In the Name field, enter a unique name for the cluster storage.
  6. Optional: In the Description field, enter a description for the cluster storage.
  7. Optional: From the Storage class list, select the type of cluster storage.

    Note

    You cannot change the storage class after you add the cluster storage to the project.

  8. In the Persistent storage size section, specify a new size in gibibytes or mebibytes.
  9. Optional: If you want to connect the cluster storage to an existing workbench:

    1. From the Connected workbench list, select a workbench.
    2. In the Mount folder name field, enter the name of storage directory.
  10. Click Add storage.

Verification

  • The cluster storage that you added appears on the Cluster storage tab for the project.
  • A new persistent volume claim (PVC) is created with the storage size that you defined.
  • The persistent volume claim (PVC) is visible as an attached storage on the Workbenches tab for the project.

4.2. Updating cluster storage

If your data science work requires you to change the identifying information of a project’s cluster storage or the workbench that the storage is connected to, you can update your project’s cluster storage to change these properties.

Note

You cannot directly change the storage class for cluster storage that is already configured for a workbench or project. To switch to a different storage class, you need to migrate your data to a new cluster storage instance that uses the required storage class. For more information, see Changing the storage class for an existing cluster storage instance.

Prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • If you are using OpenShift AI groups, you are part of the user group or admin group (for example, rhoai-users or rhoai-admins) in OpenShift.
  • You have created a data science project that contains cluster storage.

Procedure

  1. From the OpenShift AI dashboard, click Data science projects.

    The Data science projects page opens.

  2. Click the name of the project whose storage you want to update.

    A project details page opens.

  3. Click the Cluster storage tab.
  4. Click the action menu () beside the storage that you want to update and then click Edit storage.

    The Update cluster storage page opens.

  5. Optional: Edit the Name field to change the display name for your storage.
  6. Optional: Edit the Description field to change the description of your storage.
  7. Optional: In the Persistent storage size section, specify a new size in gibibytes or mebibytes.

    Note that you can only increase the storage size. Updating the storage size restarts the workbench and makes it unavailable for a period of time that is usually proportional to the size change.

  8. Optional: If you want to connect the cluster storage to a different workbench:

    1. From the Connected workbench list, select the workbench.
    2. In the Mount folder name field, enter the name of storage directory.
  9. Click Update.

If you increased the storage size, the workbench restarts and is unavailable for a period of time that is usually proportional to the size change.

Verification

  • The storage that you updated appears on the Cluster storage tab for the project.

4.3. Changing the storage class for an existing cluster storage instance

When you create a workbench with cluster storage, the cluster storage is tied to a specific storage class. Later, if your data science work requires a different storage class, or if the current storage class has been deprecated, you cannot directly change the storage class on the existing cluster storage instance. Instead, you must migrate your data to a new cluster storage instance that uses the storage class that you want to use.

Prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • You have created a workbench or data science project that contains cluster storage.

Procedure

  1. Stop the workbench with the storage class that you want to change.

    1. From the OpenShift AI dashboard, click Data science projects.

      The Data science projects page opens.

    2. Click the name of the project with the cluster storage instance that uses the storage class you want to change.

      The project details page opens.

    3. Click the Workbenches tab.
    4. In the Status column for the relevant workbench, click Stop.

      Wait until the Status column for the relevant workbench changes from Running to Stopped.

  2. Add a new cluster storage instance that uses the needed storage class.

    1. Click the Cluster storage tab.
    2. Click Add cluster storage.

      The Add cluster storage dialog opens.

    3. Enter a name for the cluster storage.
    4. Optional: Enter a description for the cluster storage.
    5. Select the needed storage class for the cluster storage.
    6. Under Persistent storage size, enter a size in gibibytes or mebibytes.
    7. Under Connected workbench, select the workbench with the storage class that you want to change.
    8. Under Mount folder name, enter a new storage directory for the cluster storage to mount to. For example, backup.
    9. Click Add storage.
  3. Copy the data from the existing cluster storage instance to the new cluster storage instance.

    1. Click the Workbenches tab.
    2. In the Status column for the relevant workbench, click Start.
    3. When the workbench status is Running, click Open to open the workbench.
    4. In JupyterLab, click File New Terminal.
    5. Copy the data to the new storage directory. Replace <mount_folder_name> with the storage directory of your new cluster storage instance.

      rsync -avO --exclude='/opt/app-root/src/__<mount_folder_name>__' /opt/app-root/src/ /opt/app-root/src/__<mount_folder_name>__/

      For example:

      rsync -avO --exclude='/opt/app-root/src/backup' /opt/app-root/src/ /opt/app-root/src/backup/
    6. After the data has finished copying, log out of JupyterLab.
  4. Stop the workbench.

    1. Click the Workbenches tab.
    2. In the Status column for the relevant workbench, click Stop.

      Wait until the Status column for the relevant workbench changes from Running to Stopped.

  5. Remove the original cluster storage instance from the workbench.

    1. Click the Cluster storage tab.
    2. Click the action menu () beside the existing cluster storage instance, and then click Edit storage.
    3. Under Existing connected workbenches, remove the workbench.
    4. Click Update.
  6. Update the mount folder of the new cluster storage instance by removing it and re-adding it to the workbench.

    1. On the Cluster storage tab, click the action menu () beside the new cluster storage instance, and then click Edit storage.
    2. Under Existing connected workbenches, remove the workbench.
    3. Click Update.
    4. Click the Workbenches tab.
    5. Click the action menu () beside the workbench and then click Edit workbench.
    6. In the Cluster storage section, under Use existing persistent storage, select the new cluster storage instance.
    7. Click Update workbench.
  7. Restart the workbench.

    1. Click the Workbenches tab.
    2. In the Status column for the relevant workbench, click Start.
  8. Optional: The initial cluster storage that uses the previous storage class still appears on the Cluster storage tab. If you no longer need this cluster storage (for example, if the storage class is deprecated), you can delete it.
  9. Optional: You can delete the mount folder of your new cluster storage instance (for example, the backup folder).

Verification

  • On the Cluster storage tab for the project, the new cluster storage instance appears with the needed storage class in the Storage class column and the relevant workbench in the Connected workbenches column.
  • On the Workbenches tab for the project, the new cluster storage instance appears for the workbench in the Cluster storage section and has the mount path: /opt/app-root/src.

4.4. Deleting cluster storage from a data science project

You can delete cluster storage from your data science projects to help you free up resources and delete unwanted storage space.

Prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • If you are using OpenShift AI groups, you are part of the user group or admin group (for example, rhoai-users or rhoai-admins ) in OpenShift.
  • You have created a data science project with cluster storage.

Procedure

  1. From the OpenShift AI dashboard, click Data science projects.

    The Data science projects page opens.

  2. Click the name of the project that you want to delete the storage from.

    A project details page opens.

  3. Click the Cluster storage tab.
  4. Click the action menu () beside the storage that you want to delete and then click Delete storage.

    The Delete storage dialog opens.

  5. Enter the name of the storage in the text field to confirm that you intend to delete it.
  6. Click Delete storage.

Verification

  • The storage that you deleted is no longer displayed on the Cluster storage tab for the project.
  • The persistent volume (PV) and persistent volume claim (PVC) associated with the cluster storage are both permanently deleted. This data is not recoverable.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.