How to export all hard disk sizes and usage rates of all virtual machines in the cluster

pve51888

New Member
Oct 2, 2023
21
0
1
proxmox7.3.3
today i use "pvesh get /cluster/resources" to get vm information .
i can say many information about cpu ,memory,and max disk .
but ,
1.If each virtual machine has multiple hard disks, pvesh get will only display the maximum value of the first hard disk
2. Lack of hard disk usage information for each virtual machines
(For example, the hard drive of XX virtual machine uses 10%)
Kneel down and ask the boss to help me solve this problem~~
1703552086026.png
 
Last edited:
Hi,
you can use pvesh get /nodes/<your node name>/storage/<your storage ID>/content for each of your storages. Most thin provisioned storages should give you back a value for the actual usage, i.e. the used column too.

In general, if you want to do calculations with the result of pvesh, you can use --output-format json and a tool like jq to extract the values you want.