OKD is capable of provisioning persistent volumes (PVs) using the Container Storage Interface (CSI) driver for oVirt.

Familiarity with persistent storage and configuring CSI volumes is recommended when working with a Container Storage Interface (CSI) Operator and driver.

To create CSI-provisioned PVs that mount to oVirt storage assets, OKD installs the oVirt CSI Driver Operator and the oVirt CSI driver by default in the openshift-cluster-csi-drivers namespace.

  • The oVirt CSI Driver Operator provides a default StorageClass object that you can use to create Persistent Volume Claims (PVCs).

  • The oVirt CSI driver enables you to create and mount oVirt PVs.

About CSI

Storage vendors have traditionally provided storage drivers as part of Kubernetes. With the implementation of the Container Storage Interface (CSI), third-party providers can instead deliver storage plug-ins using a standard interface without ever having to change the core Kubernetes code.

CSI Operators give OKD users storage options, such as volume snapshots, that are not possible with in-tree volume plug-ins.

The oVirt CSI driver does not support snapshots.

oVirt CSI driver storage class

OKD creates a default object of type StorageClass named ovirt-csi-sc which is used for creating dynamically provisioned persistent volumes.

To create additional storage classes for different configurations, create and save a file with the StorageClass object described by the following sample YAML:

apiVersion: storage.k8s.io/v1
kind: StorageClass
  name: <storage-class-name>  (1)
    storageclass.kubernetes.io/is-default-class: "false"  (2)
provisioner: csi.ovirt.org
  storageDomainName: <rhv-storage-domain-name> (3)
  thinProvisioning: "true"  (4)
  csi.storage.k8s.io/fstype: ext4 (5)
1 Name of the storage class.
2 Set to false if the storage class is the default storage class in the cluster. If set to true, the existing default storage class must be edited and set to false.
3 oVirt storage domain name to use.
4 Disk must be thin provisioned.
5 File system type to be created.

Creating a persistent volume on RHV

When you create a PersistentVolumeClaim (PVC) object, OKD provisions a new persistent volume (PV) and creates a PersistentVolume object.

  • You are logged in to a running OKD cluster.

  • You provided the correct oVirt credentials in ovirt-credentials secret.

  • You have installed the oVirt CSI driver.

  • You have defined at least one storage class.

  • If you are using the we console to dynamically create a persistent volume on oVirt:

    1. In the OKD console, click StoragePersistent Volume Claims.

    2. In the persistent volume claims overview, click Create Persistent Volume Claim.

    3. Define the required options on the resulting page.

    4. Select the appropriate StorageClass object, which is ovirt-csi-sc by default.

    5. Enter a unique name for the storage claim.

    6. Select the access mode. Currently, RWO (ReadWriteOnce) is the only supported access mode.

    7. Define the size of the storage claim.

    8. Select the Volume Mode:

      Filesystem: Mounted into pods as a directory. This mode is the default.

      Block: Block device, without any file system on it

    9. Click Create to create the PersistentVolumeClaim object and generate a PersistentVolume object.

  • If you are using the command-line interface (CLI) to dynamically create a oVirt CSI volume:

    1. Create and save a file with the PersistentVolumeClaim object described by the following sample YAML:

      apiVersion: v1
      kind: PersistentVolumeClaim
        name: pvc-ovirt
        storageClassName: ovirt-csi-sc (1)
          - ReadWriteOnce
          storage: <volume size>  (2)
        volumeMode: <volume mode> (3)
      1 Name of the required storage class.
      2 Volume size in GiB.
      3 Supported options:
      • Filesystem: Mounted into pods as a directory. This mode is the default.

      • Block: Block device, without any file system on it.

    2. Create the object you saved in the previous step by running the following command:

      $ oc create -f pvc-ovirt.yaml
    3. To verify that the volume was created and is ready, run the following command:

      $ oc get pvc pvc-ovirt

      The pvc-ovirt shows that it is Bound.