1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/virt-configuring-guest-memory-overcommitment.adoc

57 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Module included in the following assemblies:
//
// * virt/virtual_machines/advanced_vm_management/virt-managing-guest-memory.adoc
[id="virt-configuring-guest-memory-overcommitment_{context}"]
= Configuring guest memory overcommitment
If your virtual workload requires more memory than available, you can
use memory overcommitment to allocate all or most of the hosts memory
to your virtual machine instances. Enabling memory overcommitment means
you can maximize resources that are normally reserved for the host.
For example, if the host has 32 GB RAM, you can use memory
overcommitment to fit 8 virtual machines with 4 GB RAM each. This allocation works under the
assumption that the virtual machines will not use all of their memory at the same
time.
.Procedure
. To explicitly tell the virtual machine instance that it has more memory available than
was requested from the cluster, edit the virtual machine configuration file and
set `spec.domain.memory.guest` to a higher value than
`spec.domain.resources.requests.memory`. This process is called memory
overcommitment.
+
In this example, `1024M` is requested from the cluster, but the virtual machine instance is
told that it has `2048M` available. As long as there is enough free memory
available on the node, the virtual machine instance will consume up to 2048M.
+
[source,yaml]
----
kind: VirtualMachine
spec:
template:
domain:
resources:
requests:
memory: 1024M
memory:
guest: 2048M
----
+
[NOTE]
====
The same eviction rules as those for pods apply to the virtual machine instance if
the node is under memory pressure.
====
. Create the virtual machine:
+
[source,terminal]
----
$ oc create -f <file name>.yaml
----