This is a cache of https://docs.openshift.com/rosa/virt/storage/virt-configuring-storage-profile.html. It is a snapshot of the page at 2024-11-30T03:31:21.566+0000.
Configuring storage profiles - Storage | Virtualization | Red Hat OpenShift Service on AWS
×

A storage profile provides recommended storage settings based on the associated storage class. A storage profile is allocated for each storage class.

The Containerized Data Importer (CDI) recognizes a storage provider if it has been configured to identify and interact with the storage provider’s capabilities.

For recognized storage types, the CDI provides values that optimize the creation of PVCs. You can also configure automatic settings for the storage class by customizing the storage profile. If the CDI does not recognize your storage provider, you must configure storage profiles.

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 Interface (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 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
  • 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
  1. Edit the storage profile. In this example, the provisioner is not recognized by CDI.

    $ oc edit storageprofile <storage_class>
    Example storage profile
    apiVersion: cdi.kubevirt.io/v1beta1
    kind: StorageProfile
    metadata:
      name: <unknown_provisioner_class>
    # ...
    spec: {}
    status:
      provisioner: <unknown_provisioner>
      storageClass: <unknown_provisioner_class>
  2. Provide the needed attribute values in the storage profile:

    Example storage profile
    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 The accessModes that you select.
    2 The volumeMode that you select.

    After you save your changes, the selected values appear in the storage profile status element.

Setting a default cloning strategy using a storage profile

You can use storage profiles to set a default cloning method for a storage class, creating a cloning strategy. Setting cloning strategies can be helpful, for example, if your storage vendor only supports certain cloning methods. It also allows you to select a method that limits resource usage or maximizes performance.

Cloning strategies can be specified by setting the cloneStrategy attribute in a storage profile to one of these values:

  • snapshot is used by default when snapshots are configured. The CDI will use the snapshot method if it recognizes the storage provider and the provider supports Container Storage Interface (CSI) snapshots. This cloning strategy uses a temporary volume snapshot to clone the volume.

  • copy uses a source pod and a target pod to copy data from the source volume to the target volume. Host-assisted cloning is the least efficient method of cloning.

  • csi-clone uses the CSI clone API to efficiently clone an existing volume without using an interim volume snapshot. Unlike snapshot or copy, which are used by default if no storage profile is defined, CSI volume cloning is only used when you specify it in the StorageProfile object for the provisioner’s storage class.

You can also set clone strategies using the CLI without modifying the default claimPropertySets in your YAML spec section.

Example storage profile
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  name: <provisioner_class>
# ...
spec:
  claimPropertySets:
  - accessModes:
    - ReadWriteOnce (1)
    volumeMode:
      Filesystem (2)
  cloneStrategy: csi-clone (3)
status:
  provisioner: <provisioner>
  storageClass: <provisioner_class>
1 Specify the access mode.
2 Specify the volume mode.
3 Specify the default cloning strategy.
Table 1. Storage providers and default behaviors
Storage provider Default behavior

rook-ceph.rbd.csi.ceph.com

Snapshot

openshift-storage.rbd.csi.ceph.com

Snapshot

csi-vxflexos.dellemc.com

CSI Clone

csi-isilon.dellemc.com

CSI Clone

csi-powermax.dellemc.com

CSI Clone

csi-powerstore.dellemc.com

CSI Clone

hspc.csi.hitachi.com

CSI Clone

csi.hpe.com

CSI Clone

spectrumscale.csi.ibm.com

CSI Clone

rook-ceph.rbd.csi.ceph.com

CSI Clone

openshift-storage.rbd.csi.ceph.com

CSI Clone

cephfs.csi.ceph.com

CSI Clone

openshift-storage.cephfs.csi.ceph.com

CSI Clone