1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-customizing-storage-profile.adoc
2025-05-21 18:36:05 +00:00

57 lines
2.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/storage/virt-configuring-storage-profile.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-customizing-storage-profile_{context}"]
= Customizing the storage profile
You can specify default parameters by editing the `StorageProfile` object for the provisioner's storage class. These default parameters only apply to the persistent volume claim (PVC) if they are not configured in the `DataVolume` object.
You cannot modify storage class parameters. To make changes, delete and re-create the storage class. You must then reapply any customizations that were previously made to the storage profile.
An empty `status` section in a storage profile indicates that a storage provisioner is not recognized by the Containerized Data Importer (CDI). Customizing a storage profile is necessary if you have a storage provisioner that is not recognized by CDI. In this case, the administrator sets appropriate values in the storage profile to ensure successful allocations.
If you are creating a snapshot of a VM, a warning appears if the storage class of the disk has more than one `VolumeSnapshotClass` associated with it. In this case, you must specify one volume snapshot class; otherwise, any disk that has more than one volume snapshot class is excluded from the snapshots list.
[WARNING]
====
If you create a data volume and omit YAML attributes and these attributes are not defined in the storage profile, then the requested storage will not be allocated and the underlying persistent volume claim (PVC) will not be created.
====
.Prerequisites
* You have installed the {oc-first}.
* Ensure that your planned configuration is supported by the storage class and its provider. Specifying an incompatible configuration in a storage profile causes volume provisioning to fail.
.Procedure
. Edit the storage profile. In this example, the provisioner is not recognized by CDI.
+
[source,terminal,subs="attributes+"]
----
$ oc edit storageprofile <storage_class>
----
+
. Specify the `accessModes` and `volumeMode` values you want to configure for the storage profile. For example:
+
.Example storage profile
[source,yaml]
----
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
name: <unknown_provisioner_class>
# ...
spec:
claimPropertySets:
- accessModes:
- ReadWriteOnce <1>
volumeMode: Filesystem <2>
status:
provisioner: <unknown_provisioner>
storageClass: <unknown_provisioner_class>
----
<1> Specify the `accessModes`.
<2> Specify the `volumeMode`.