-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic memory control #211
Comments
Of course, VM from the above image is created using terraform and terraform-provider-xenorchestra. But in VM resource we can only set memory_max not memory_min limit. At least I haven't found a way. Please help me with this if possible. |
What's more than the above it seems either the newest XO API is broken or the provider, as setting memory_max does not necessery set this value in the VM. I've done multiple tests with setting this parameter from 0.5G to 16G of ram for a VM and the result was that VMs with less than 4GB of RAM assigned to them through this parameter always crashed during OS installation, the faster the more the difference between allocated memory and 4GB, VMs with more RAM, never crashed and always progressed with installation. It seems to have something to do with the fact that memory_max is setting also dynamic memory parameters and setting it lower than the 4GB limit (which is somehow automatically applied on the memory max side if that's the case), seems to crash the VM as it tries to address it and most probably is killed by hypervisor due to seg fault. Could this please be investigated? |
There isn't a @michal-rybinski can you please show some terraform code for the example(s) you've shown above? I'm not sure I understand what inputs create the outputs you shared. I was hoping to provide users a "memory" setting that didn't need to provide dynamic and static values for the simple case. We should definitely extend the provider to allow configuring all settings, but if it's possible I think it would be great if the simple case would work properly. |
sure, the vm code I use is as below:
The outputs are created by just uncommenting/commenting the memory_max lines. The problem occurs when the amount is lower than 4GB as you can see that static max is then set to 4GB regardless and it crashes the VM. Probably easiest solution would be to set the provioded value as all 4 values (but I am not sure what are other dependencies that need to be meet here) or just make sure no value is greater then the one provided. |
I've solved this by using xo-cli after the VM is created to modify memory_min |
Well, I can change the static max value from Xen Orchestra and that's what I did but I'd prefer to not have to do it every time I want to create a VM with less than 4GB or memory |
forgot to add, although not sure if that matters, riunning terraform from Intel based Mac with OSX 13.0.1 |
Out of curiosity run it from Ubuntu 22.10 laptop and got exactly same result so this should not matter |
Tried your config, got the same result regardless |
Okay, I will try to replicate tomorrow. Xen orchestra (Appliance on the stable channel, not updated for a few weeks)
Multiple hosts on
Shared storage on iscsi Terraform:
|
I have done some testing. I can reproduce the static_max value being set incorrectly to the value of the template when the vm has less memory than its template. (this is the rocky-1g vm) I have no idea where to look to fix this tho. |
Do you happen to have any updates on this issue? The RHEL and derivate distributions templates are affected by this issue, and creating a VM with memory_max < 4Gb using Terraform results in the OS installer (booted from iso attached to the VM) crashing and rebooting. Fixing the static_max value from XO UI fixes the issue. |
Hello, when I create a new VM with 16GB of ram, I get minimum of 2GB of ram as in the image below. I would like to be set to 16GB bith min and max ram. Is that possible to do in terraform code?
The text was updated successfully, but these errors were encountered: