Chapter 3. Provisioning storage using Logical Volume Manager Operator
You can provision persistent volume claims (PVCs) using the storage class that gets created during the operator installation. You can provision block and file PVCs, however, the storage is allocated only when a pod that uses the PVC is created.
The Red Hat OpenShift Data Foundation Logical Volume Manager Operator provisions PVCs in units of 1 GiB. The requested storage is rounded up to the nearest GiB.
Procedure
Identify the StorageClass that is created when Red Hat OpenShift Data Foundation Logical Volume Manager Operator is deployed.
The StorageClass name is in the format,
odf-lvm-<device-class-name>.device-class-nameis the name of the device class that you provided in the LVMCluster of the policy YAML. For example, if the deviceClass has the name asvg1, then the storageClass name isodf-lvm-vg1.Save the following YAML to a file with a name such as
odf-lvm-storage-class.yamlto create a PVC where the application requires storage.# Sample YAML to create a PVC # block pvc apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lvm-block-1 namespace: default spec: accessModes: - ReadWriteOnce volumeMode: Block resources: requests: storage: 10Gi storageClassName: odf-lvm-vg1 --- # file pvc apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lvm-file-1 namespace: default spec: accessModes: - ReadWriteOnce volumeMode: Filesystem resources: requests: storage: 10Gi storageClassName: odf-lvm-vg1Create the policy by running the following command:
# oc create -f odf-lvm-storage-class.yaml -ns lvm-policy-nsThe PVCs that are created will remain in pending state until you deploy the pods that use them.