ProxMox RAM usage problem for Zabbix

ducarpit

New Member
Nov 11, 2024
3
0
1
Hi all,
i have a ProxMox server with some VMs and one of these has 4GB of RAM assigned.
The ProxMox GUI shows over 90% of RAM used, but most is cached:

1731313088010.png

1731313148963.png

I read this is due to Balloning function: https://pve.proxmox.com/wiki/Dynamic_Memory_Management#Ballooning

That's not a problem for me, but it's a problem for the Zabbix monitoring: i installed the Zabbix agent on the VE to monitor the server and the VMs on it, but it always send an alert to report an high RAM utilization about this VM, and this is a wrong alert:

1731313256997.png
Is there a way to configure the Zabbix agent or the ProxMox VE to show/send only the effective RAM used by a VM?
Thanks in advance,
Christian
 
Check that you have the QEMU Guest Agent installed and running; this might be helpful. Refer to the following guide for more information: https://pve.proxmox.com/wiki/Qemu-guest-agent Note that ProxmoxVE will display combined usage, which includes both used memory and buffers. which seems correct in your case.
Hi, yes i installed the qemu guest agent in all VMs and it is running normally.
"Note that ProxmoxVE will display combined usage, which includes both used memory and buffers", that's the problem, it show the total memory so Zabbix report this as an high RAM usage (but the most is cached)....
 
We also using Zabbix and the Zabbix Proxmox Template and we have the same problem.

Because I do not want to disable the memory checks and I do not want to rework the Proxmox template the only solution for me to solve the problem is to give more memory to the VMs :-(.

In the configs for our VMs I have no parameter regarding ballooning, so in my case ballooning should be disabled. Or is it enabled by default?

Did you find a propper solution already thats better the mine :-)?
 
We also using Zabbix and the Zabbix Proxmox Template and we have the same problem.

Because I do not want to disable the memory checks and I do not want to rework the Proxmox template the only solution for me to solve the problem is to give more memory to the VMs :-(.

In the configs for our VMs I have no parameter regarding ballooning, so in my case ballooning should be disabled. Or is it enabled by default?

Did you find a propper solution already thats better the mine :)?
At the moment no :(
I don't want to change or rework the Proxmox official template, me too, i think it is very great with the dinamically discovery function.
A possibile solution could be to install the Zabbix agent on the VMs instead of on the VE and use the standard template for Linux system....in that case we need to install an agent for each VM and configure the host on Zabbix Server, it's not a difficult work but i loved the idea to have a single Zabbix Agent...but probably, ath the moment, there isn't a better solution!
 
Hmm, we are using zabbix-agent2 on our vms already. Disabling the memory check for the template and only monitor the memory usage by the agent might be the solution. There are also other doubble checks, e.g. the uptime. This could be deactivated also.

TBH I use the Proxmox template only because there are some checks about the cluster status IIRC.

Maybe I really should deactivate all things in the template that are monitored by the zabbix agent already... Will take a look
 
I'd love to see a way to modify the memory reporting in proxmox, so that it reports Available RAM, not free RAM.
IMO a system should be using as much of its RAM as possible, so it's normal behavior to have close to 0% free RAM, but that should not mean the underlying system is unhealthy. This is used for caching and can be reclaimed easily by the system if needed.

Increasing RAM just to make the monitoring happy, when the system actually uses 40% Maximum of it RAM is not a very good solution, unless you have so much RAM you do not know what to do with :)

I found that qemu can get the actual available memory from the ballooning device :
https://www.qemu.org/docs/master/interop/virtio-balloon-stats.html

From the Qemu monitor :
Code:
qm> qom-get /machine/peripheral/balloon0 guest-stats
{
    "stats": {
        "stat-htlb-pgalloc": 0,
        "stat-swap-out": 1816567808,
        "stat-available-memory": 6489800704,
        "stat-htlb-pgfail": 0,
        "stat-free-memory": 519331840,
        "stat-minor-faults": 1019265493,
        "stat-major-faults": 140131,
        "stat-total-memory": 8326447104,
        "stat-swap-in": 1078312960,
        "stat-disk-caches": 5884764160
    },
    "last-update": 1731441929
}

Maybe is there a way to modify the PVE reporting tool to use "stat-available-memory" instead of "stat-free-memory" ?
 
Last edited:
I found a way to query qemu monitor from the API, and with a bit of cleanup I can have the actual available value :

With the the pvesh command from one of the nodes (to easily query the API) :

Code:
# pvesh create /nodes/<pve_node_name>/qemu/<VMID>/monitor --command 'qom-get /machine/peripheral/balloon0 guest-stats' | grep 'stat-available-memory' | awk '{print $2}' | tr -d ','
6445203456

As a workaround, it should be possible to use this base to change the monitoring checks in Zabbix
 
no it doesn't. Or if it does then all of my VMs are broken somehow.

[EDIT] that is assuming you mean the Ballooning checkbox under RAM on the VM.
 
Last edited:
I found a way to query qemu monitor from the API, and with a bit of cleanup I can have the actual available value :

With the the pvesh command from one of the nodes (to easily query the API) :

Code:
# pvesh create /nodes/<pve_node_name>/qemu/<VMID>/monitor --command 'qom-get /machine/peripheral/balloon0 guest-stats' | grep 'stat-available-memory' | awk '{print $2}' | tr -d ','
6445203456

As a workaround, it should be possible to use this base to change the monitoring checks in Zabbix
This code is good who wants to know only vm internal usage from PVE not the external usage of VM on PVE.
 
Yes ballon service on windows.
I was really hoping this was it, but the VMs in question are Linux. Also, I did check my Windows VM that has somewhat the same issue, and the Ballooning service is running.

[EDIT]So the Windows thing appears that it is because I have a GPU pass through on the unit I am testing, and Ballooning won't work with pass-through.
[EDIT]Still not sure why it isn't working in Linux right now. One of them is just a file server, so in theory it shouldn't take much RAM, but I have increased it to 12 GB to see if that helps.
 
Last edited: