fix(xo-server): fix _editVm memory limits - #10285
Open
b-Nollet wants to merge 1 commit into
Open
Conversation
spacotte-vates
approved these changes
Aug 21, 2026
MathieuRA
reviewed
Aug 31, 2026
MathieuRA
left a comment
Member
There was a problem hiding this comment.
Except the side effect, LGTM
| set(memory, vm) { | ||
| return vm.$call('set_memory_limits', vm.memory_static_min, memory, memory, memory) | ||
| const staticMin = Math.min(vm.memory_static_min, memory) | ||
| return vm.$call('set_memory_limits', staticMin, memory, memory, memory) |
Member
There was a problem hiding this comment.
Side effect during VM creation
Previously, if a user attempted to create a VM with an amount of RAM lower than the minimum defined in the template, an error was throw.
Now, VM creation is accepted, even with a very low value (e.g., 1 KiB).
this may be acceptable, but it is important to ensure this is the intended behavior. If we accept this change, in a another PR we probably need to handle the XAPI error when attempting to start a VM with insufficient memory (so that a more explicit error message can be displayed to users)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When creating a VM, if both
templateandmemorywere in the parameters and the memory value was lower than the template's static memory minimum, XO would try to respect these values, which violates the memory inequality that must be respected: static min <= dynamic min <= dynamic max <= static max and makes the XAPI error with MEMORY_CONSTRAINT_VIOLATION_ORDERSee https://chat.vates.tech/#/room/!OheqIrkcrqFOUEkYRY:vates.tech/$pVyQEjtZR3oo97gYO7yRpKbWd4A4Q1B70IqhPI5RcPY?via=vates.tech
Not worth a changelog entry IMO
Checklist
Fixes #007,See xoa-support#42,See https://...)Introduced byCHANGELOG.unreleased.mdReview process
If you are an external contributor, you can skip this part. Simply create the pull request, and we'll get back to you as soon as possible.
Notes: