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 by issuing the following command and update with necessary parameters:
    https://raw.githubusercontent.com/IBM/ibm-spectrum-scale-csi/v2.4.0/driver/examples/static/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: 7118073361626808055;09762E69:5D36FE8D;fileset=2;path=/ibm/gpfs0/staticdir
    Field Name Description
    volumeHandle This must be in the [clusterID];[Filesystem UID];path=[Path to the directory] format. To create a snapshot volume from an independent fileset, the format to be used is [clusterID];[Filesystem UID];fileset=[Fileset ID];path=[Fileset linkpath].
    clusterID ID of the primary cluster
    Note: mmlscluster command displays the current configuration including the cluster ID.
    Filesystem UID This is the UID of the filesystem that consists of directory to be provisioned.
    Note: mmlsfs <filesystem name> --uid command displays the file system UID.
    path Complete path of the directory to be provisioned.
    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 Start of changehttps://raw.githubusercontent.com/IBM/ibm-spectrum-scale-csi/v2.4.0/tools/generate_static_provisioning_yamls.shEnd of change.
  3. Issue this command to create a PV:
    kubectl apply -f pv.yaml