Skip to content

Conversation

SpiffyEight77
Copy link
Contributor

@SpiffyEight77 SpiffyEight77 commented Sep 7, 2025

Description

Test

Restricted project

incus project create restricted-project --config restricted=true
incus project switch restricted-project
incus launch images:ubuntu/22.04 restricted-vm --vm
incus list
+---------------+---------+------+------+-----------------+-----------+
|     NAME      |  STATE  | IPV4 | IPV6 |      TYPE       | SNAPSHOTS |
+---------------+---------+------+------+-----------------+-----------+
| restricted-vm | RUNNING |      |      | VIRTUAL-MACHINE | 0         |
+---------------+---------+------+------+-----------------+-----------+

incus config set restricted-vm limits.memory.oom_priority=100
Error: Failed checking if instance update allowed: Use of low-level config "limits.memory.oom_priority" on virtual-machine "restricted-vm" of project "restricted-project" is forbidden

Normal project

incus launch images:ubuntu/22.04 normal-container
Launching normal-container
incus launch images:ubuntu/22.04 normal-vm --vm
Launching normal-vm
incus ls
+------------------+---------+----------------------+------------------------------------------------+-----------------+-----------+
|       NAME       |  STATE  |         IPV4         |                      IPV6                      |      TYPE       | SNAPSHOTS |
+------------------+---------+----------------------+------------------------------------------------+-----------------+-----------+
| normal-container | RUNNING | 10.222.75.245 (eth0) | fd42:7a1c:a30e:915e:1266:6aff:fe45:893f (eth0) | CONTAINER       | 0         |
+------------------+---------+----------------------+------------------------------------------------+-----------------+-----------+
| normal-vm        | RUNNING |                      | fd42:7a1c:a30e:915e:1266:6aff:fe55:73fb (eth0) | VIRTUAL-MACHINE | 0         |
+------------------+---------+----------------------+------------------------------------------------+-----------------+-----------+

incus config set normal-container limits.memory.oom_priority=100
cat /proc/$(incus info normal-container | grep -i "pid:" | awk '{print $2}')/oom_score_adj
100

incus config set normal-container limits.memory.oom_priority=1000
cat /proc/$(incus info normal-container | grep -i "pid:" | awk '{print $2}')/oom_score_adj
1000

incus config set normal-vm limits.memory.oom_priority=100
cat /proc/$(incus info normal-vm | grep -i "pid:" | awk '{print $2}')/oom_score_adj
100

incus config set normal-vm limits.memory.oom_priority=1000
cat /proc/$(incus info normal-vm | grep -i "pid:" | awk '{print $2}')/oom_score_adj
1000

@SpiffyEight77 SpiffyEight77 force-pushed the feat/memory-oom-priority branch 2 times, most recently from 0f3ffdb to 3bfb612 Compare September 7, 2025 12:34
@github-actions github-actions bot added the Documentation Documentation needs updating label Sep 7, 2025
@SpiffyEight77 SpiffyEight77 force-pushed the feat/memory-oom-priority branch 3 times, most recently from 89a9a9f to 1b8f3b1 Compare September 14, 2025 13:36
@SpiffyEight77 SpiffyEight77 marked this pull request as ready for review September 14, 2025 15:52
@stgraber
Copy link
Member

Sorry for the delay, had a busy couple of weeks, going to be reviewing this one now.

@stgraber stgraber force-pushed the feat/memory-oom-priority branch from a434a1d to 346f8d7 Compare September 16, 2025 19:06
@github-actions github-actions bot added the API Changes to the REST API label Sep 16, 2025
@stgraber stgraber merged commit 4643e25 into lxc:main Sep 16, 2025
35 of 36 checks passed
@SpiffyEight77 SpiffyEight77 deleted the feat/memory-oom-priority branch September 16, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Development

Successfully merging this pull request may close these issues.

Allow for adjustable OOM score on instances
2 participants