mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
69 lines
1.7 KiB
Plaintext
69 lines
1.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * /virt/managing_vms/advanced_vm_management/virt-NUMA-topology.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="virt-disable-CPU-VM-hotplug_{context}"]
|
|
= Adjusting or disabling the CPU hot plug by VM
|
|
|
|
[role="_abstract"]
|
|
As a VM owner, you can adjust or disable the CPU hot plug for individual VMs.
|
|
This is the simplest solution for large, performance-critical VMs where you want to ensure a fixed CPU allocation from the start.
|
|
|
|
.Prerequisites
|
|
|
|
* You have installed the {oc-first}.
|
|
|
|
.Procedure
|
|
|
|
. Modify the `VirtualMachine` custom resource (CR) for the VM that you want to configure to add a `maxSockets` and `sockets` spec:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: kubevirt.io/v1
|
|
kind: VirtualMachine
|
|
metadata:
|
|
name: large-numa-vm
|
|
spec:
|
|
template:
|
|
spec:
|
|
domain:
|
|
cpu:
|
|
maxSockets: 10
|
|
sockets: 10
|
|
cores: 1
|
|
threads: 1
|
|
----
|
|
+
|
|
By explicitly setting `maxSockets` and `sockets` to a value of 10 or higher, you are specifying that additional capacity is not reserved for hot plugging, which ensures that the entire requested cores are the actual cores allocated.
|
|
|
|
. Apply the changes to the `VirtualMachine` CR by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <filename>.yaml
|
|
----
|
|
|
|
.Verification
|
|
|
|
. Check that you have configured the `maxSockets` and `sockets` values correctly, by running the following commands:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get vmi -o jsonpath='{.spec.domain.cpu.maxSockets}'
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get vmi -o jsonpath='{.spec.domain.cpu.sockets}'
|
|
----
|
|
+
|
|
If the configuration was successful, the outputs are the `maxSockets` and `sockets` values that you set in the previous procedure:
|
|
+
|
|
*Example output*
|
|
+
|
|
[source,terminal]
|
|
----
|
|
10
|
|
----
|