> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scitix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Dynamic Volumes

> Use StorageClass to automatically create PVs based on PVC capacity and access requirements, and provide storage volumes for workloads.

Dynamic volume provisioning is suitable for scenarios where PVs need to be automatically created based on workload storage requests. You must first prepare a StorageClass, then create a PVC that references the StorageClass. The storage plugin creates and binds a PV according to the PVC configuration.

## Pre-Operation Confirmation

* The CKS cluster has installed the CSI driver or storage plugin for the target storage backend.
* When creating a GPFS StorageClass on the **Volume Template** tab, ensure that `scitix-csi-plugin` is installed on the cluster and that an available GPFS file system exists.

## Create or Select a StorageClass

If the cluster already has a StorageClass that meets your requirements, note its name and continue creating the PVC. When creating a new StorageClass for GPFS, use a volume template whenever possible. Create a StorageClass manually only if you have obtained the CSI driver and all its parameters.

### Create a GPFS StorageClass Using a Volume Template

1. Log in to the [GPU Cloud console](https://console.scitix.ai/gpu-cloud/home) and go to the **Clusters** page.

2. On the **Clusters** page, click the target cluster name to open the cluster workspace.

3. In the left navigation pane, go to the **Storage** page and switch to the **Volume Template** tab.

4. Click **Create GPFS StorageClass** to configure the StorageClass.

   ![Create a GPFS StorageClass Using a Volume Template](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/cluster/media/cluster-create-gpfs-storageclass.png?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=7a1906bb42af205cb0e8fd759210ebfa)

   | Parameter | Description |
   | - | - |
   | **File system** | Select the GPFS file system used to create dynamic storage volumes. |
   | **FS path** | Specify the path in the file system for creating storage volumes, for example, `/gpfs/data`. |
   | **StorageClass name** | Specify the StorageClass name. When creating a PVC, use this name in `storageClassName`. |
   | **Reclaim policy** | Select how dynamically provisioned PVs are reclaimed after a PVC is deleted. Before selecting **Delete**, confirm that the backend data is no longer needed. After selecting **Retain**, an administrator must further handle the retained PVs and data. |
   | **Archive when deleted** | Select whether to archive data upon deletion based on data retention requirements. Before enabling this option, confirm the archive location and recovery method. |

5. Click **Create**.

### Create a Custom StorageClass

Creating a custom StorageClass is suitable when you have obtained a complete configuration from the storage administrator or CSI plugin documentation. If the parameters are incomplete, use a volume template to avoid creating a StorageClass that cannot create storage volumes properly.

1. Log in to the [GPU Cloud console](https://console.scitix.ai/gpu-cloud/home) and go to the **Clusters** page.

2. On the **Clusters** page, click the name of the target cluster to open the cluster workspace.

3. In the left navigation pane, go to the **Storage** page, switch to the **StorageClass** tab, and click **Create**.

   ![Manually Create StorageClass](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/cluster/media/cluster-create-storageclass.png?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=2ebfd767b8bfd35ed7561e55694cfbf8)

4. Set **Name** and enter the StorageClass configuration in **Spec (YAML)**.

   The following YAML shows the basic structure of a StorageClass. Replace the placeholders with the actual values required by the CSI driver, and add parameters as needed.

   ```yaml theme={null}
   provisioner: <CSI_PROVISIONER_NAME>
   parameters:
     <PARAMETER_NAME>: <PARAMETER_VALUE>
   reclaimPolicy: Retain
   mountOptions: []
   volumeBindingMode: Immediate
   ```

5. Click **Create**.

## Create a PVC

1. On the **Storage** page, switch to the **PVC** tab and click **Create**.

   ![Create Dynamic Volume PVC](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/cluster/media/cluster-create-pvc.png?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=ecb2219ea3b6ec47eaefec977002a24e)

2. Configure the PVC.

   | Parameter | Description |
   | - | - |
   | **Name** | Set the PVC name. Workloads reference the PVC by this name. |
   | **Namespace** | Select the namespace to which the PVC belongs. The PVC and the workloads that reference it must be in the same namespace. |
   | **Spec (YAML)** | Enter the PVC's `metadata` and `spec`. Do not enter `apiVersion` or `kind`. |

   Replace `storageClassName` with the name of the StorageClass selected or created in the previous step, and adjust the capacity and access mode as needed.

   ```yaml theme={null}
   metadata:
     labels: {}
     annotations: {}
   spec:
     accessModes:
       - ReadWriteOnce
     resources:
       requests:
         storage: 50Gi
     storageClassName: gpfs-dynamic
     volumeMode: Filesystem
   ```

3. Click **Create**.

4. Return to the **PVC** tab and confirm that the PVC status changes to `Bound`.

   After the status changes to `Bound`, it indicates that the storage plugin has created a PV and that the PV has been bound to the PVC.

## Next Actions

After the PVC status becomes `Bound`, you can [mount persistent storage to a workload](https://docs.scitix.ai/gpu-cloud/cluster/mount-persistent-storage-to-workload.md). When you no longer need the PVC or PV, see [Clean up persistent storage resources](https://docs.scitix.ai/gpu-cloud/cluster/cleanup-persistent-storage-resources.md).

## Frequently Asked Questions

> **What should I do if a PVC remains in Pending status for an extended period?**
>
> Ensure that the StorageClass corresponding to `storageClassName` exists, and check whether the CSI driver or storage plugin is installed and functioning properly. If GPFS is used, also ensure that the target file system and the path for creation are available.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.