Creating a persistent volume (PV)

A persistent volume (PV) is the storage that is statically provisioned by an administrator or dynamically provisioned by using the storage classes.

To create a PV, do the following steps:
  1. Download the sample file and update with the necessary parameters.
    For CSI 2.10.x, issue the following command:
    curl -O https://raw.githubusercontent.com/IBM/ibm-spectrum-scale-csi/v2.10.4/driver/examples/version1/volume/staticprovisioning/static_pv.yaml
  2. Configure persistent volume (PV) manifest file with a volumeHandle as described in this example.
    
    # cat pv.yaml 
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: static-scale-static-pv
    spec:
      capacity:
        storage: 1Gi
      accessModes:
        - ReadWriteMany
      csi:
        driver: spectrumscale.csi.ibm.com
        volumeHandle: 0;2;7171748422707577770;13280B0A:61F4048E;;fset2;/ibm/fs1/fset2
    Field Name Description
    volumeHandle

    This input must follow this format: 0;[Volume type];[Cluster ID];[Filesystem UUID];;[Fileset name];[Path to the directory or fileset linkpath].

    For statically provisioned PV, the first field is 0 and the fifth field is always empty. For directory based volume, fileset name is always empty. Volume type is 0 for directory based volume, 1 for dependent fileset based volume and 2 for independent fileset based volume.

    clusterID The ID of the primary cluster.
    Note: The mmlscluster command displays the current configuration, including the cluster ID.
    Filesystem UID This identifier is the UID of the file system that consists of the directory to be provisioned.
    Note: The mmlsfs <filesystem name> --uid command displays the file system UID.
    path The complete path of volume directory in OpenShift or Kubernetes cluster.
    Fileset ID The Fileset ID field must be used if you want to create a snapshot volume from an independent fileset.
    Note: This manifest file can be auto-generated by using the generate_static_provisioning_yamls.sh tool.
    For more information, see Static provisioning YAML file.
  3. Issue this command to create a PV:
    kubectl apply -f pv.yaml