11.4. Reserving PVC space for file system overhead
When you create a DataVolume custom resource (CR) for a virtual machine (VM) by setting the spec.storage.volumeMode attribute to Filesystem, OpenShift Virtualization automatically accounts for file system overhead.
If you specify the storage type by using the spec.pvc attribute in the DataVolume CR, OpenShift Virtualization does not add any file system overhead and the requested size is passed directly to Kubernetes.
The default file system overhead value is 6%. For example, if you request a 10 GiB disk and the spec.storage.volumeMode attribute is set to FileSystem, Kubernetes provisions a PVC of approximately 10.6 GiB so that the VM has the full 10 GiB of space available.
| Requested virtual disk size | Calculated overhead (6%) | Total PVC space provisioned |
|---|---|---|
| 10 GiB | 0.6 GiB | 10.6 GiB |
| 100 GiB | 6 GiB | 106 GiB |
You can change the default file system overhead value by editing the HyperConverged CR.
11.4.1. Overriding the default file system overhead value リンクのコピーリンクがクリップボードにコピーされました!
Change the amount of persistent volume claim (PVC) space that the OpenShift Virtualization reserves for file system overhead by editing the spec.filesystemOverhead attribute of the HCO object.
Prerequisites
-
Install the OpenShift CLI (
oc).
Procedure
Open the
HCOobject for editing by running the following command:$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnvEdit the
spec.filesystemOverheadfields, populating them with your chosen values:# ... spec: filesystemOverhead: global: "<new_global_value>" storageClass: <storage_class_name>: "<new_value_for_this_storage_class>"-
spec.filesystemOverhead.globalspecifies the default file system overhead percentage used for any storage classes that do not already have a set value. For example,global: "0.07"reserves 7% of the PVC for file system overhead. -
spec.filesystemOverhead.storageClassspecifies the file system overhead percentage for the specified storage class. For example,mystorageclass: "0.04"changes the default overhead value for PVCs in themystorageclassstorage class to 4%.
-
-
Save and exit the editor to update the
HCOobject.
Verification
View the
CDIConfigstatus and verify your changes by running one of the following commands:To generally verify changes to
CDIConfig:$ oc get cdiconfig -o yamlTo view your specific changes to
CDIConfig:$ oc get cdiconfig -o jsonpath='{.items..status.filesystemOverhead}'