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.

Note

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

  1. 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-name is the name of the device class that you provided in the LVMCluster of the policy YAML. For example, if the deviceClass has the name as vg1, then the storageClass name is odf-lvm-vg1.

  2. Save the following YAML to a file with a name such as odf-lvm-storage-class.yaml to 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-vg1
  3. Create the policy by running the following command:

    # oc create -f odf-lvm-storage-class.yaml -ns lvm-policy-ns

    The PVCs that are created will remain in pending state until you deploy the pods that use them.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top