Export VM Details to Excel

Apr 20, 2023
4
0
1
Hello,

We are fairly new to the Proxmox environment, coming from VMware previously.
We are using a Proxmox Cluster to host VMs for our customers use, and we bill our customers after their used VM resources.

It there an easy way to export a list of all VM and their associated VM resources (CPU core count, RAM, Disk total amount), preferably xlsx or csv.

Thanks alot!
Have a great day everyone!
 
Not sure im really following, where would i access the API and how, via one of the PVE hosts?
Any recommended command syntax for that to begin with?
Haven´t used this kind of protocol / access before.
 
see the second link - you can access the API using bindings in various languages (most commonly you'd use an API token, also explained on the same page).

alternatively, you can also read the guest configs directly, or use pct/qem CLI tools to script.
 
Code:
pvesh get cluster/resources --type vm -o json|jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv'



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
That command didnt work, syntax error, but i managed to export all VM info to a JSON file, then converted to excel with excel.
pvesh get cluster/resources --type vm --human-readable 1 -o json > report.json

It isn´t perfect but i solves the problem at the moment, we will look into integrating PVE via API to our PSA in the near future for report automation.
 
That command didnt work, syntax error, but i managed to export all VM info to a JSON file, then converted to excel with excel.
works fine for me, perhaps you have older software or lost a quote..
Code:
root@proxmox7-nvme1:~# qm create 199
root@proxmox7-nvme1:~# qm create 299
root@proxmox7-nvme1:~# qm create 399
root@proxmox7-nvme1:~# qm create 499
root@proxmox7-nvme1:~# pvesh get cluster/resources --type vm -o json|jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv'
"cpu","disk","diskread","diskwrite","id","maxcpu","maxdisk","maxmem","mem","name","netin","netout","node","status","template","type","uptime","vmid"
0,0,0,0,"qemu/199",1,0,536870912,0,"VM 199",0,0,"proxmox7-nvme1","stopped",0,"qemu",0,199
0,0,0,0,"qemu/299",1,0,536870912,0,"VM 299",0,0,"proxmox7-nvme1","stopped",0,"qemu",0,299
0,0,0,0,"qemu/399",1,0,536870912,0,"VM 399",0,0,"proxmox7-nvme1","stopped",0,"qemu",0,399
0,0,0,0,"qemu/499",1,0,536870912,0,"VM 499",0,0,"proxmox7-nvme1","stopped",0,"qemu",0,499


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!