diff --git a/modules/ovirt-csi-driver-storage-class.adoc b/modules/ovirt-csi-driver-storage-class.adoc new file mode 100644 index 000000000000..1db6d53fa1b8 --- /dev/null +++ b/modules/ovirt-csi-driver-storage-class.adoc @@ -0,0 +1,30 @@ +// Module included in the following assemblies: +// +// * storage/container_storage_interface/persistent-storage-csi-ovirt.adoc + +[id="ovirt-csi-driver-storage-class_{context}"] += oVirt CSI driver storage class + +{product-title} 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: + +[source,yaml] +---- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: <1> + annotations: + storageclass.kubernetes.io/is-default-class: "false" <2> +provisioner: csi.ovirt.org +parameters: + storageDomainName: <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> {rh-virtualization} storage domain name to use. +<4> Disk must be thin provisioned. +<5> File system type to be created. diff --git a/modules/persistent-storage-rhv.adoc b/modules/persistent-storage-rhv.adoc new file mode 100644 index 000000000000..fcbfe04fd68e --- /dev/null +++ b/modules/persistent-storage-rhv.adoc @@ -0,0 +1,69 @@ +[id="persistent-storage-rhv_{context}"] += Creating a persistent volume on RHV + +When you create a `PersistentVolumeClaim` (PVC) object, {product-title} provisions a new persistent volume (PV) and creates a `PersistentVolume` object. + +.Prerequisites +* You are logged in to a running {product-title} cluster. +* You provided the correct {rh-virtualization} credentials in `ovirt-credentials` secret. +* You have installed the oVirt CSI driver. +* You have defined at least one storage class. + +.Procedure + +* If you are using the we console to to dynamically create a persistent volume on {rh-virtualization} : ++ +. In the {product-title} 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 is `ovirt-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. +. Define the size of the storage claim. +. 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 ++ +. 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 {rh-virtualization} CSI volume: ++ +. Create and save a file with the `PersistentVolumeClaim` object described by the following sample YAML: ++ +.pvc-ovirt.yaml +[source,yaml] +---- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-ovirt +spec: + storageClassName: ovirt-csi-sc <1> + accessModes: + - ReadWriteOnce + resources: + requests: + storage: <2> + volumeMode: <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. ++ +. Create the object you saved in the previous step by running the following command: ++ +---- +$ oc create -f pvc-ovirt.yaml +---- ++ +. 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. diff --git a/storage/container_storage_interface/persistent-storage-csi-ovirt.adoc b/storage/container_storage_interface/persistent-storage-csi-ovirt.adoc index 44eaca96fe66..dceb9413fc0b 100644 --- a/storage/container_storage_interface/persistent-storage-csi-ovirt.adoc +++ b/storage/container_storage_interface/persistent-storage-csi-ovirt.adoc @@ -1,5 +1,5 @@ [id="persistent-storage-csi-ovirt"] -= Red Hat Virtualization (oVirt) CSI Driver Operator += Red Hat Virtualization CSI Driver Operator include::modules/common-attributes.adoc[] :context: persistent-storage-csi-ovirt @@ -7,17 +7,20 @@ toc::[] == Overview -{product-title} is capable of provisioning persistent volumes (PVs) using the Container Storage Interface (CSI) driver for Red Hat Virtualization (oVirt). +{product-title} is capable of provisioning persistent volumes (PVs) using the Container Storage Interface (CSI) driver for {rh-virtualization-first} ({rh-virtualization}). Familiarity with xref:../../storage/understanding-persistent-storage.adoc#understanding-persistent-storage[persistent storage] and xref:../../storage/container_storage_interface/persistent-storage-csi.adoc#persistent-storage-csi[configuring CSI volumes] is recommended when working with a Container Storage Interface (CSI) Operator and driver. -To create CSI-provisioned PVs that mount to Red Hat Virtualization (oVirt) storage assets, {product-title} installs the oVirt CSI Driver Operator and the oVirt CSI driver by default in the `openshift-cluster-csi-drivers` namespace. +To create CSI-provisioned PVs that mount to {rh-virtualization-first} ({rh-virtualization}) storage assets, {product-title} 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 storage class that you can use to create PVCs. +* 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. include::modules/persistent-storage-csi-about.adoc[leveloffset=+1] +include::modules/ovirt-csi-driver-storage-class.adoc[leveloffset=+1] +include::modules/persistent-storage-rhv.adoc[leveloffset=+1] .Additional resources * xref:../../storage/container_storage_interface/persistent-storage-csi.adoc#persistent-storage-csi[Configuring CSI volumes] +* xref:../../storage/container_storage_interface/persistent-storage-csi.adoc#csi-dynamic-provisioning_persistent-storage-csi[Dynamic Provisioning]