Allocate maximum memory to VM on boot with balloon device

magician

New Member
Dec 24, 2024
5
0
1
I use Proxmox VE for VPS hosting and am trying to make use of memory overcommitment like other hosting providers do. However, when I set the minimum memory for a VM lower than its "Memory", the VM boots with the minimum memory and has its total RAM increased only gradually.

This has led to many clients opening support requests as they see less RAM than they have ordered, even though there is plenty of free RAM on the host machine. Only 45% of the total memory of the host machine is used, so there is no reason for balloon inflation to occur.

total used free shared buff/cache available
Mem: 125Gi 57Gi 5.7Gi 56Mi 63Gi 68Gi


Also, this behavior causes some scripts with minimum memory requirements to fail as they do not see enough memory installed in the VM.


Is this memory allocation behavior normal for Proxmox VE, and is there a way to allocate the full memory to the VM on boot when there is enough memory on the host machine for all VMs?
 
Last edited:
It sounds you want some help to scam your customers? Funny!
Just allocate the memory to the VMs as your clients ordered. They're paying for.
 
This came from a misunderstanding I previously had. I thought that if VMs had Min memory = (Max) memory, the max memory would always be allocated at the time of the boot of the guest and would be unavailable for any other VMs. That is why I thought using memory ballooning was a "fallback" mechanism where the host recovers some unused memory from VMs when there is insufficient physical memory on the host. Now, I understand that memory allocation happens lazily.
 
Last edited:
It sounds you want some help to scam your customers? Funny!
Just allocate the memory to the VMs as your clients ordered. They're paying for.
This was not my intention. My goal is to just optimize memory use so that unused memory of VMs doesn't go "to waste" but is used efficiently by other VMs. I thought memory overcommitment wouldn't be possible without memory ballooning (please see my previous reply). I want the VMs to always be able to use their maximum memory unless the host has insufficient memory (in an edge case).
 
Last edited:
Overcommitting CPU is absolute fine and it won't happen anything if all cores are used. But overcommitting memory is not a great idea (at least for me). What if your host runs out of memory to due your clients need those memory? The OOM killer will hard stop the VM with the highest memory usage...
 
  • Like
Reactions: UdoB
Overcommitting CPU is absolute fine and it won't happen anything if all cores are used. But overcommitting memory is not a great idea (at least for me). What if your host runs out of memory to due your clients need those memory? The OOM killer will hard stop the VM with the highest memory usage...
I monitor the maximum and average memory use on the host over a long period of time, and I ensure that not many additional VMs get created on the same host in a short period of time. This makes it very unlikely that it runs out of memory, especially when there is plenty of memory available on the host (e.g., 55% available).
 
Last edited:
All VMs with ballooning enabled will get all of their memory until the Proxmox host gets to 80% (which is hard-coded) memory use. Proxmox will then start taking away memory (ballooning) from the VMs based on the shares. Proxmox will not looks at how much the VM uses or needs. nor will it negotiate with the operating system inside the VM. If you set min too low, you will get problems inside the VM. For more details see the manual: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory