1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/hcp-virt-image-caching.adoc
2024-09-03 17:55:47 +00:00

38 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-manage/hcp-manage-virt.adoc
:_mod-docs-content-type: PROCEDURE
[id="hcp-virt-image-caching_{context}"]
= Enabling KubeVirt VM image caching
You can use KubeVirt VM image caching to optimize both cluster startup time and storage usage. KubeVirt VM image caching supports the use of a storage class that is capable of smart cloning and the `ReadWriteMany` access mode. For more information about smart cloning, see _Cloning a data volume using smart-cloning_.
Image caching works as follows:
. The VM image is imported to a PVC that is associated with the hosted cluster.
. A unique clone of that PVC is created for every KubeVirt VM that is added as a worker node to the cluster.
Image caching reduces VM startup time by requiring only a single image import. It can further reduce overall cluster storage usage when the storage class supports copy-on-write cloning.
.Procedure
* To enable image caching, during cluster creation, use the `--root-volume-cache-strategy=PVC` argument by running the following command:
+
[source,terminal]
----
$ hcp create cluster kubevirt \
--name <hosted_cluster_name> \ <1>
--node-pool-replicas <worker_node_count> \ <2>
--pull-secret <path_to_pull_secret> \ <3>
--memory <memory> \ <4>
--cores <cpu> \ <5>
--root-volume-cache-strategy=PVC <6>
----
+
<1> Specify the name of your hosted cluster, for instance, `example`.
<2> Specify the worker count, for example, `2`.
<3> Specify the path to your pull secret, for example, `/user/name/pullsecret`.
<4> Specify a value for memory, for example, `8Gi`.
<5> Specify a value for CPU, for example, `2`.
<6> Specify a strategy for image caching, for example, `PVC`.