#!/bin/bash
# Proxmox VM inventory exporter
OUTPUT="proxmox_inventory.csv"
# Write CSV header
echo "VMID,Name,Type,Node,Status,CPU,Mem_Used,Mem_Max,Disk_Used,Disk_Max" > $OUTPUT
# Fetch VM list from cluster and format as CSV
pvesh get /cluster/resources --type vm \
| jq -r '.[] | [.vmid, .name, .type, .node, .status, .cpu, .mem, .maxmem, .disk, .maxdisk] | @csv' \
>> $OUTPUT
echo "Inventory written to $OUTPUT"
Yes. At scale the cleanest approach is to query the PVE REST API and either consume it directly or wrap it with a small script. The one-call overview endpoint is “pvesh get /cluster/resources –type vm”, which returns every VM and container across the whole cluster with VMID, name, node (host it’s on), status, uptime, CPU, memory and disk; on any node you can turn that into a quick CSV with something liketry this:
We use essential cookies to make this site work, and optional cookies to enhance your experience.