Mapping KubeVirt CSI storage classes

You can map the infrastructure storage class to the hosted storage class during cluster creation.

Note

KubeVirt CSI supports mapping only an infrastructure storage class that is capable of ReadWriteMany (RWX) access.

The following table shows how volume and access mode capabilities map to KubeVirt CSI storage classes:

Table 18. Mapping KubeVirt CSI storage classes to access and volume modes
Infrastructure CSI capability Hosted cluster CSI capability VM live migration support Notes

RWX: Block or Filesystem

ReadWriteOnce (RWO) Block or Filesystem RWX Block only

Supported

Use Block mode because Filesystem volume mode results in degraded hosted Block mode performance. RWX Block volume mode is supported only when the hosted cluster is OpenShift Container Platform 4.16 or later.

RWO Block storage

RWO Block storage or Filesystem

Not supported

Lack of live migration support affects the ability to update the underlying infrastructure cluster that hosts the KubeVirt VMs.

RWO FileSystem

RWO Block or Filesystem

Not supported

Lack of live migration support affects the ability to update the underlying infrastructure cluster that hosts the KubeVirt VMs. Use of the infrastructure Filesystem volume mode results in degraded hosted Block mode performance.

Procedure
  • To map the infrastructure storage class to the hosted storage class, use the --infra-storage-class-mapping argument as shown in the following example:

    $ hcp create cluster kubevirt \
      --name my-hosted-cluster \
      --node-pool-replicas 2 \
      --pull-secret /user/name/pullsecret \
      --memory 8Gi \
      --cores 2 \
      --infra-storage-class-mapping=<infrastructure_storage_class>/<hosted_storage_class>
    • --name specifies the name of your hosted cluster.

    • --node-pool-replicas specifies the worker count.

    • --pull-secret specifies the path to your pull secret.

    • --memory specifies a value for memory.

    • --cores specifies a value for CPU.

    • --infra-storage-class-mapping specifies the storage class names for the infrastructure and hosted cluster. Replace <infrastructure_storage_class> with the infrastructure storage class name and <hosted_storage_class> with the hosted cluster storage class name. You can use the --infra-storage-class-mapping argument multiple times within the hcp create cluster command.

      After you create the hosted cluster, the infrastructure storage class is visible within the hosted cluster. When you create a Persistent Volume Claim (PVC) within the hosted cluster that uses one of those storage classes, KubeVirt CSI provisions that volume by using the infrastructure storage class mapping that you configured during cluster creation.