Monitoring of LXC Mount Point Metrics via API

Sep 16, 2022
2
0
1
Hi there,

Is there a way to monitor an LXC's mount point metrics (disk IO, size, usage) via the API? From our testing, all that is made available is the rootfs.

Is possible to append this data (when applicable) to the follow calls? ...unless someone has a solution already :)

Desired Additional LXC Metrics:

{ {{normal output}} "mp[0-255]": { "diskread": {{mount-point-diskread}}, "diskwrite": {{mount-point-diskwrite}}, "disk": {{mount-point-disk-usage}}, "maxdisk": {{mount-point-maxdisk}} }, },

_____________________________________________________________

API Option 1: /api2/json/cluster/resources

{ "node": "{{node-id}}", "maxcpu": 2, "disk": 715259904, "status": "running", "vmid": {{container-id}}, "uptime": 16952, "id": "lxc/{{container-id}}", "diskread": 0, "diskwrite": 0, "name": "{{container-name}}", "netout": 1578700325, "cpu": 0.0395441522727254, "template": 0, "mem": 368377856, "netin": 29339461622, "maxmem": 8589934592, "type": "lxc", "maxdisk": 17179869184 },

_____________________________________________________________

API Option 2: /api2/json/nodes/{{node-id}}/lxc/{{container-id}}/status/current

{ "data": { "netout": 1535700797, "status": "running", "disk": 714997760, "diskread": 0, !! <-- rootfs disk read "swap": 0, "name": "{{container-name}}", "cpu": 0.0370043910295161, "uptime": 16192, "netin": 27769327908, "pid": 1809491, "vmid": {{container-id}}, "cpus": 2, "maxdisk": 17179869184, "type": "lxc", "maxmem": 8589934592, "maxswap": 1073741824, "mem": 368381952, "ha": { "managed": 0 }, "diskwrite": 0 !! <-- rootfs disk write } }
 
Last edited:
AFAICS, the option 2 should sum all reads across the container, not only the root disk

better splitting would be good, i don't know if that's feasible for containers
you can open a feature request here (or check if there already is one there): https://bugzilla.proxmox.com
 
Hi Dominik,

Thanks for the response.

We have raised Bug ID 4253 for this request.

Unfortunately option 2 does not behave as you have described (at least in our testing).

We loaded up a LXC w/ 13 2-8MP H265 streams recording at max frame rate to an attached 3TB mount point. There were no changes to disk metrics under both API options.

Scenario 1.

rootfs: 16GB
mp0: 3000GB
____________
netin avg/30min: 44Mbps
expected diskwrite: 720,896 (44Mbs to B)
____________

Option 2 Output w/ Scenario 1:

{ "data": { "diskwrite": 0, "diskread": 0, "maxdisk": 17179869184, "disk": 871890944, } }

Cheers,
Leon
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!