Virtualization: Setting Minimum Memory Size on Guest: (Not) Working as intended?

probain

Patron
Joined
Feb 25, 2023
Messages
211
So I'm experimenting with my VM's. All of which are Ubuntu Servers. And I'm trying/experimenting with ways to trim away on hard allocated RAM. My understanding here was that setting Memory Size along with Minimum Memory Size. Would allow for dynamic memory allocation between these two values, depending on the Guests needs.

Minimum Memory Size


When not specified, guest system is given fixed amount of memory specified above. When minimum memory is specified, guest system is given memory within range between minimum and fixed as needed.
Host: Check signature for Server spec

Guest VM settings/specs:
Memory Size: 12GiB
Minimum Memory Size: 1GiB
Boot Method: UEFI
GuestOS: Ubunutu Server 22.04.3, 6.2.0-33-generic #33~22.04.1-Ubuntu (Fully updated)
qemu-guest-agent: installed and up to date

If my assumption is correct, then the guest should be allocated 1GiB *fixed* memory on the host. And the remaining 11GiB would be available to the guest, but wouldn't be allocated host-side before actual needed. The GuestOS would still *see* it as 12GiB total RAM.

However. What I'm seeing is the following on my test-server when doing 'free -h' is
total used free shared buff/cache available
Mem: 675Mi 387Mi 141Mi 0.0Ki 146Mi 62Mi
Swap: 2.0Gi 206Mi 1.8Gi

Leaving the Minimum value empty, allocates all of the intended RAM to the Guest as expected.

Ideas and/or corrections? I'm more than happy to be wrong, as long as I learn in the mean time.
 
Last edited:

probain

Patron
Joined
Feb 25, 2023
Messages
211
I still believe that this isn't working as intended, and therefore have filed a Jira. Or at the minimum, it's not working as described, in the way I'm interpreting the description.
 
Joined
Jul 4, 2023
Messages
6
It looked like they closed that as working as intended which i dont agree with as I was seeing this same thing as well and wondering whats going on. would be great to be able to have memory ballooning if this is what this setting is meaning. i moved my VMs off of truenas because of this, did you run those commands they were referencing?
 

probain

Patron
Joined
Feb 25, 2023
Messages
211
It looked like they closed that as working as intended which i dont agree with as I was seeing this same thing as well and wondering whats going on. would be great to be able to have memory ballooning if this is what this setting is meaning. i moved my VMs off of truenas because of this, did you run those commands they were referencing?
I did run those commands. But in the mean time I've also upgraded to 23.10.0. And I believe that the issues I was seeing, has been fixed behind the scenes. If I set a minimum RAM-amount for my VMs. They will list the Maximum as available.
So whether those commands actually show the correct values, is hard to test.

What I do know, is that I was intentionally filling up RAM before. And it always, consistently, gave "Out of Memory"-errors when reaching the roof of the minimum value.

But again. I believe that this is fixed. As all of my VMs are giving more sane values.
 
Top