Red Hat Virtualization CSI Driver Operator
Familiarity with persistent storage and 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 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.
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.
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:
When you create a PersistentVolumeClaim
(PVC) object, OKD provisions a new persistent volume (PV) and creates a PersistentVolume
object.
Prerequisites
You are logged in to a running OKD cluster.
You provided the correct oVirt credentials in
ovirt-credentials
secret.You have defined at least one storage class.
Procedure
If you are using the we console to dynamically create a persistent volume on oVirt:
In the OKD console, click Storage → Persistent Volume Claims.
In the persistent volume claims overview, click Create Persistent Volume Claim.
Define the required options on the resulting page.
Select the appropriate
StorageClass
object, which isovirt-csi-sc
by default.Enter a unique name for the storage claim.
Select the access mode. Currently, RWO (ReadWriteOnce) is the only supported access mode.
Select the Volume Mode:
Filesystem
: Mounted into pods as a directory. This mode is the default.Click Create to create the
PersistentVolumeClaim
object and generate aPersistentVolume
object.
If you are using the command-line interface (CLI) to dynamically create a oVirt CSI volume:
Create and save a file with the
PersistentVolumeClaim
object described by the following sample YAML:pvc-ovirt.yaml
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.
Create the object you saved in the previous step by running the following command:
To verify that the volume was created and is ready, run the following command:
The
pvc-ovirt
shows that it is Bound.
Additional resources