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:
- Download the sample file by issuing the following command and
update with necessary parameters for CSI
2.5.x:
https://raw.githubusercontent.com/IBM/ibm-spectrum-scale-csi/v2.5.1/driver/examples/version1/volume/staticprovisioning/static_pv.yaml
- 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 must be in the format 0;[Volume type];[Cluster ID];[Filesystem UUID];;[Fileset name];[Path to the directory or fileset linkpath].
For statically provisioned PV, 1st field is
0
and 5th field is always empty. For directory based volume, fileset name is always empty. Volume type is0
for directory based volume,1
for dependent fileset based volume and2
for independent fileset based volume.clusterID The 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 the directory to be provisioned. Note: mmlsfs <filesystem name> --uid command displays the file system UID.path The 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 https://raw.githubusercontent.com/IBM/ibm-spectrum-scale-csi/v2.5.0/tools/generate_static_provisioning_yamls.sh. - Issue this command to create a PV:
kubectl apply -f pv.yaml