[SOLVED] Unable to list VMs using API or CLI

vikas027

New Member
May 27, 2019
7
4
3
40
I have a VM in running state, but some how API or pvesh command does not shows it. Not sure, what am I missing here.

Code:
root@proxmox:~# qm list | grep -i running
       105 myrke2-node1         running    8096              20.00 12594     
root@proxmox:~#


root@proxmox:~# pvesh get /nodes
┌─────────┬────────┬───────┬───────┬────────┬───────────┬──────────┬─────────────────────────────────────────────────────────────────────────────────────────────────┬────────┐
│ node    │ status │   cpu │ level │ maxcpu │    maxmem │ mem      │ ssl_fingerprint                                                                                 │ uptime │
├─────────┼────────┼───────┼───────┼────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────────────────────────────┼────────┤
│ proxmox │ online │ 1.10% │       │     32 │ 62.84 GiB │ 5.73 GiB │ 87:51:BD:BA:A4:44:92:CC:64:3B:F1:EF:DD:AF:5D:B1:B2:0A:44:14:49:A2:A0:AC:11:95:D7:1E:1C:50:00:BD │ 54m 9s │
└─────────┴────────┴───────┴───────┴────────┴───────────┴──────────┴─────────────────────────────────────────────────────────────────────────────────────────────────┴────────┘
root@proxmox:~#

~/.../ansible (dev) $ curl -s -k https://proxmox/api2/json/nodes -b "PVEAuthCookie=$TOKEN" | jq -r '.data[].node'
proxmox
~/.../ansible (dev) $
 
Ah, please ignore this. I had to do this

Code:
pvesh get /nodes/proxmox/qemu

I think something has changed in the API recently, my python script is not giving me the correct list of VMs now. I use to get the list of VMs like this earlier
Code:
proxmox_api.node_qemu(node)
 
I have figured it out, the issue was due to variable version which is equal to 6.0-4 now and the script was expecting 6.0.

Here is the python script.
 

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!