Skip to content

Commit 9fc12a5

Browse files
authored
Merge pull request #87835 from sbeskin-redhat/CNV_55143_Fix_machine_configuration
CNV-55143: Fix machine configuration and add explicit warning about usage of resources.requests.memory
2 parents 8704b52 + 9f5ce08 commit 9fc12a5

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

modules/virt-using-wasp-agent-to-configure-higher-vm-workload-density.adoc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The `wasp-agent` component facilitates memory overcommitment by assigning swap r
1313
Swap resources can be only assigned to virtual machine workloads (VM pods) of the `Burstable` Quality of Service (QoS) class. VM pods of the `Guaranteed` QoS class and pods of any QoS class that do not belong to VMs cannot swap resources.
1414
1515
For descriptions of QoS classes, see link:https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/[Configure Quality of Service for Pods] (Kubernetes documentation).
16+
17+
Using `spec.domain.resources.requests.memory` in the VM manifest disables the memory overcommit configuration. Use `spec.domain.memory.guest` instead.
1618
====
1719

1820
.Prerequisites
@@ -76,21 +78,34 @@ spec:
7678
[Unit]
7779
Description=Provision and enable swap
7880
ConditionFirstBoot=no
79-
81+
ConditionPathExists=!/var/tmp/swapfile
82+
8083
[Service]
8184
Type=oneshot
8285
Environment=SWAP_SIZE_MB=5000
8386
ExecStart=/bin/sh -c "sudo dd if=/dev/zero of=/var/tmp/swapfile count=${SWAP_SIZE_MB} bs=1M && \
8487
sudo chmod 600 /var/tmp/swapfile && \
8588
sudo mkswap /var/tmp/swapfile && \
8689
sudo swapon /var/tmp/swapfile && \
87-
free -h && \
88-
sudo systemctl set-property --runtime system.slice MemorySwapMax=0 IODeviceLatencyTargetSec=\"/ 50ms\""
89-
90+
free -h"
91+
9092
[Install]
9193
RequiredBy=kubelet-dependencies.target
9294
enabled: true
9395
name: swap-provision.service
96+
- contents: |
97+
[Unit]
98+
Description=Restrict swap for system slice
99+
ConditionFirstBoot=no
100+
101+
[Service]
102+
Type=oneshot
103+
ExecStart=/bin/sh -c "sudo systemctl set-property --runtime system.slice MemorySwapMax=0 IODeviceLatencyTargetSec=\"/ 50ms\""
104+
105+
[Install]
106+
RequiredBy=kubelet-dependencies.target
107+
enabled: true
108+
name: cgroup-system-slice-config.service
94109
----
95110
+
96111
To have enough swap space for the worst-case scenario, make sure to have at least as much swap space provisioned as overcommitted RAM. Calculate the amount of swap space to be provisioned on a node by using the following formula:
@@ -174,9 +189,9 @@ spec:
174189
- name: SWAP_UTILIZATION_THRESHOLD_FACTOR
175190
value: "0.8"
176191
- name: MAX_AVERAGE_SWAP_IN_PAGES_PER_SECOND
177-
value: "1000"
192+
value: "1000000000"
178193
- name: MAX_AVERAGE_SWAP_OUT_PAGES_PER_SECOND
179-
value: "1000"
194+
value: "1000000000"
180195
- name: AVERAGE_WINDOW_SIZE_SECONDS
181196
value: "30"
182197
- name: VERBOSITY

0 commit comments

Comments
 (0)