API disk, diskread, diskwrite report '0'

Davis

New Member
Dec 14, 2017
2
0
1
124
Hi, I am gathering stats from Proxmox 3.x and 4.x hosts using the JSON API (api2). However, all my VMs have 'diskread', 'diskwrite', and 'disk' reporting '0'.

I have confirmed it's not just my API client either, as running `pvesh` and doing a `get /nodes/{node}/qemu` also shows those properties as '0'.

When I do a `qm status {vmid} --verbose`, I can see the correct diskread and diskwrite values.

Is there a reason these would be reporting 0? I've looked through the existing Proxmox API documentation, and other forum posts, but have found nothing.
 
Last edited:
we only get those stats with a full status call
which is (for each single vm)
/nodes/<NODENAME>/qemu/<VMID>/status/current

or for all vms (but beware of the performance implications)
/nodes/<NODENAME/qemu
with parameter 'full 1'
so e.g. with pvesh

pvesh get /nodes/NODE/qemu --full 1

this is a costly operation since it connects to the qemu monitor several times for each vm
 
What is this 'costly' in terms of--the API, the VMs, only time...?
i mean it is time consuming(the process has to connect to every qemu process of every vm on that node, which may take a "while", compared to the rest of the api call), so it is not the default
 

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!