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 From the OpenShift AI dashboard, click Data Science Projects . The Data Science Projects page opens. Click the name of the project that you want to add the cluster storage to. A project details page opens. Click the Cluster storage tab. Click Add cluster storage . The Add cluster storage dialog opens. In the Name field, enter a unique name for the cluster storage. Optional: In the Description field, enter a description for the cluster storage. 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. In the Persistent storage size section, specify a new size in gibibytes or mebibytes. Optional: If you want to connect the cluster storage to an existing workbench: From the Connected workbench list, select a workbench. In the Mount folder name field, enter the name of storage directory. 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 From the OpenShift AI dashboard, click Data Science Projects . The Data Science Projects page opens. Click the name of the project whose storage you want to update. A project details page opens. Click the Cluster storage tab. Click the action menu ( ... ) beside the storage that you want to update and then click Edit storage . The Update cluster storage page opens. Optional: Edit the Name field to change the display name for your storage. Optional: Edit the Description field to change the description of your storage. 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. Optional: If you want to connect the cluster storage to a different workbench: From the Connected workbench list, select the workbench. In the Mount folder name field, enter the name of storage directory. 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 Stop the workbench with the storage class that you want to change. From the OpenShift AI dashboard, click Data Science Projects . The Data Science Projects page opens. 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. Click the Workbenches tab. In the Status column for the relevant workbench, click Stop . Wait until the Status column for the relevant workbench changes from Running to Stopped . Add a new cluster storage instance that uses the needed storage class. Click the Cluster storage tab. Click Add cluster storage . The Add cluster storage dialog opens. Enter a name for the cluster storage. Optional: Enter a description for the cluster storage. Select the needed storage class for the cluster storage. Under Persistent storage size , enter a size in gibibytes or mebibytes. Under Connected workbench , select the workbench with the storage class that you want to change. Under Mount folder name , enter a new storage directory for the cluster storage to mount to. For example, backup . Click Add storage . Copy the data from the existing cluster storage instance to the new cluster storage instance. Click the Workbenches tab. In the Status column for the relevant workbench, click Start . When the workbench status is Running , click Open to open the workbench. In JupyterLab, click File New Terminal . Copy the data to the new storage directory. Replace <mount_folder_name> with the storage directory of your new cluster storage instance. For example: After the data has finished copying, log out of JupyterLab. Stop the workbench. Click the Workbenches tab. In the Status column for the relevant workbench, click Stop . Wait until the Status column for the relevant workbench changes from Running to Stopped . Remove the original cluster storage instance from the workbench. Click the Cluster storage tab. Click the action menu ( ... ) beside the existing cluster storage instance, and then click Edit storage . Under Existing connected workbenches , remove the workbench. Click Update . Update the mount folder of the new cluster storage instance by removing it and re-adding it to the workbench. On the Cluster storage tab, click the action menu ( ... ) beside the new cluster storage instance, and then click Edit storage . Under Existing connected workbenches , remove the workbench. Click Update . Click the Workbenches tab. Click the action menu ( ... ) beside the workbench and then click Edit workbench . In the Cluster storage section, under Use existing persistent storage , select the new cluster storage instance. Click Update workbench. Restart the workbench. Click the Workbenches tab. In the Status column for the relevant workbench, click Start . Optional: The initial cluster storage that uses the 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. 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 From the OpenShift AI dashboard, click Data Science Projects . The Data Science Projects page opens. Click the name of the project that you want to delete the storage from. A project details page opens. Click the Cluster storage tab. Click the action menu ( ... ) beside the storage that you want to delete and then click Delete storage . The Delete storage dialog opens. Enter the name of the storage in the text field to confirm that you intend to delete it. 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.

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