[GH-ISSUE #38] Qemu listing empty #17

Closed
opened 2026-02-27 15:45:59 +03:00 by kerem · 9 comments
Owner

Originally created by @d4vydm on GitHub (Oct 8, 2020).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/38

pvesh returns a list of vms under qemu:

pvesh get /nodes/<node>/qemu
┌─────────┬──────┬──────┬──────┬────────────┬───────────┬─────────────────┬───────┬───────────┬
│ status  │ vmid │ cpus │ lock │    maxdisk │    maxmem │ name            │   pid │ qmpstatus │
╞═════════╪══════╪══════╪══════╪════════════╪═══════════╪═════════════════╪═══════╪═══════════╪
│ running │ 1100 │    1 │      │  10.00 GiB │  1.00 GiB │ vmname          │  1321 │           │
├─────────┼──────┼──────┼──────┼────────────┼───────────┼─────────────────┼───────┼───────────┼
...

With proxmoxer the list is empty:

>>> proxmox.nodes.get('<node>')
[{u'name': u'ceph'}, {u'name': u'disks'}, {u'name': u'apt'}, {u'name': u'version'}, {u'name': u'syslog'}, {u'name': u'journal'}, {u'name': u'status'}, {u'name': u'wakeonlan'}, {u'name': u'subscription'}, {u'name': u'report'}, {u'name': u'tasks'}, {u'name': u'rrd'}, {u'name': u'rrddata'}, {u'name': u'replication'}, {u'name': u'vncshell'}, {u'name': u'termproxy'}, {u'name': u'spiceshell'}, {u'name': u'time'}, {u'name': u'dns'}, {u'name': u'services'}, {u'name': u'scan'}, {u'name': u'storage'}, {u'name': u'qemu'}, {u'name': u'lxc'}, {u'name': u'vzdump'}, {u'name': u'network'}, {u'name': u'aplinfo'}, {u'name': u'startall'}, {u'name': u'stopall'}, {u'name': u'netstat'}, {u'name': u'firewall'}, {u'name': u'certificates'}, {u'name': u'config'}, {u'name': u'hosts'}]

>>> proxmox.nodes.get('<node>','qemu')
[]

Version:

>>> proxmox.version.get()
{u'release': u'6.2', u'version': u'6.2-4', ... }

Remark <node> should be replaced with your node name

Originally created by @d4vydm on GitHub (Oct 8, 2020). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/38 pvesh returns a list of vms under qemu: ``` pvesh get /nodes/<node>/qemu ┌─────────┬──────┬──────┬──────┬────────────┬───────────┬─────────────────┬───────┬───────────┬ │ status │ vmid │ cpus │ lock │ maxdisk │ maxmem │ name │ pid │ qmpstatus │ ╞═════════╪══════╪══════╪══════╪════════════╪═══════════╪═════════════════╪═══════╪═══════════╪ │ running │ 1100 │ 1 │ │ 10.00 GiB │ 1.00 GiB │ vmname │ 1321 │ │ ├─────────┼──────┼──────┼──────┼────────────┼───────────┼─────────────────┼───────┼───────────┼ ... ``` With proxmoxer the list is empty: ``` >>> proxmox.nodes.get('<node>') [{u'name': u'ceph'}, {u'name': u'disks'}, {u'name': u'apt'}, {u'name': u'version'}, {u'name': u'syslog'}, {u'name': u'journal'}, {u'name': u'status'}, {u'name': u'wakeonlan'}, {u'name': u'subscription'}, {u'name': u'report'}, {u'name': u'tasks'}, {u'name': u'rrd'}, {u'name': u'rrddata'}, {u'name': u'replication'}, {u'name': u'vncshell'}, {u'name': u'termproxy'}, {u'name': u'spiceshell'}, {u'name': u'time'}, {u'name': u'dns'}, {u'name': u'services'}, {u'name': u'scan'}, {u'name': u'storage'}, {u'name': u'qemu'}, {u'name': u'lxc'}, {u'name': u'vzdump'}, {u'name': u'network'}, {u'name': u'aplinfo'}, {u'name': u'startall'}, {u'name': u'stopall'}, {u'name': u'netstat'}, {u'name': u'firewall'}, {u'name': u'certificates'}, {u'name': u'config'}, {u'name': u'hosts'}] >>> proxmox.nodes.get('<node>','qemu') [] ``` Version: ``` >>> proxmox.version.get() {u'release': u'6.2', u'version': u'6.2-4', ... } ``` Remark \<node\> should be replaced with your node name
Author
Owner

@jhollowe commented on GitHub (Oct 8, 2020):

What python version and proxmoxer version are you using?

<!-- gh-comment-id:705610783 --> @jhollowe commented on GitHub (Oct 8, 2020): What python version and proxmoxer version are you using?
Author
Owner

@jhollowe commented on GitHub (Oct 8, 2020):

Also, have you tested this using proxmoxer with the ssh backend (it uses pvesh under the hood)?

<!-- gh-comment-id:705611605 --> @jhollowe commented on GitHub (Oct 8, 2020): Also, have you tested this using proxmoxer with the ssh backend (it uses pvesh under the hood)?
Author
Owner

@d4vydm commented on GitHub (Oct 8, 2020):

proxmoxer 1.1.1
Python 3.7.3

<!-- gh-comment-id:705613006 --> @d4vydm commented on GitHub (Oct 8, 2020): proxmoxer 1.1.1 Python 3.7.3
Author
Owner

@d4vydm commented on GitHub (Oct 8, 2020):

Also, have you tested this using proxmoxer with the ssh backend (it uses pvesh under the hood)?

>>> proxmox = ProxmoxAPI('<hostip>', user='<user@authbackend>', backend='ssh_paramiko', private_key_file="<link to key>") 

I get an auth failure, maybe doing something wrong, what is the right syntax for this using proxmoxer? I get 'private key is encrypted' when passing the key.

<!-- gh-comment-id:705620529 --> @d4vydm commented on GitHub (Oct 8, 2020): > Also, have you tested this using proxmoxer with the ssh backend (it uses pvesh under the hood)? ``` >>> proxmox = ProxmoxAPI('<hostip>', user='<user@authbackend>', backend='ssh_paramiko', private_key_file="<link to key>") ``` I get an auth failure, maybe doing something wrong, what is the right syntax for this using proxmoxer? I get 'private key is encrypted' when passing the key.
Author
Owner

@jhollowe commented on GitHub (Oct 8, 2020):

hrm, well that is interesting.

<!-- gh-comment-id:705625241 --> @jhollowe commented on GitHub (Oct 8, 2020): hrm, well that is interesting.
Author
Owner

@jhollowe commented on GitHub (Oct 8, 2020):

I figured out the original problem:
the filtering of the nodes happens at the nodes level rather than the get level.
So it would be proxmox.nodes('<node>').get('qemu')

Feel free to close this issue if this works for you.

<!-- gh-comment-id:705625783 --> @jhollowe commented on GitHub (Oct 8, 2020): I figured out the original problem: the filtering of the nodes happens at the `nodes` level rather than the `get` level. So it would be `proxmox.nodes('<node>').get('qemu')` Feel free to close this issue if this works for you.
Author
Owner

@d4vydm commented on GitHub (Oct 8, 2020):

Same result:

>>> proxmox.nodes('<node>').get('qemu')
[]

I can get info on a specific vm:

>>> proxmox.nodes('<node>').get('qemu','<vmid>')
[{'subdir': 'config'}, {'subdir': 'pending'}, {'subdir': 'status'}, {'subdir': 'unlink'}, {'subdir': 'vncproxy'}, {'subdir': 'termproxy'}, {'subdir': 'migrate'}, {'subdir': 'resize'}, {'subdir': 'move'}, {'subdir': 'rrd'}, {'subdir': 'rrddata'}, {'subdir': 'monitor'}, {'subdir': 'agent'}, {'subdir': 'snapshot'}, {'subdir': 'spiceproxy'}, {'subdir': 'sendkey'}, {'subdir': 'firewall'}]
<!-- gh-comment-id:705643193 --> @d4vydm commented on GitHub (Oct 8, 2020): Same result: ``` >>> proxmox.nodes('<node>').get('qemu') [] ``` I can get info on a specific vm: ``` >>> proxmox.nodes('<node>').get('qemu','<vmid>') [{'subdir': 'config'}, {'subdir': 'pending'}, {'subdir': 'status'}, {'subdir': 'unlink'}, {'subdir': 'vncproxy'}, {'subdir': 'termproxy'}, {'subdir': 'migrate'}, {'subdir': 'resize'}, {'subdir': 'move'}, {'subdir': 'rrd'}, {'subdir': 'rrddata'}, {'subdir': 'monitor'}, {'subdir': 'agent'}, {'subdir': 'snapshot'}, {'subdir': 'spiceproxy'}, {'subdir': 'sendkey'}, {'subdir': 'firewall'}] ```
Author
Owner

@jhollowe commented on GitHub (Oct 8, 2020):

Hrm, proxmox.nodes('<node>').get('qemu') works for me. I'm on version 6.2-11 so you might try updating? This seems to be a weird error with PVE's API.

can you try testing with the HTML api access (https://<ip>:<port>/api2/html) to see if it shows the data there?

<!-- gh-comment-id:705656713 --> @jhollowe commented on GitHub (Oct 8, 2020): Hrm, `proxmox.nodes('<node>').get('qemu')` works for me. I'm on version `6.2-11` so you might try updating? This seems to be a weird error with PVE's API. can you try testing with the HTML api access (https://\<ip\>:\<port\>/api2/html) to see if it shows the data there?
Author
Owner

@d4vydm commented on GitHub (Oct 8, 2020):

@jhollowe you nailed it. Testing the HTML api also returned empty list.

It's not a proxmoxer problem, but API permissions.

At the botom of the page https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu it is mentioned:
Only list VMs where you have VM.Audit permissons on /vms/.

So I fixed the permissions of the user.

I'll close this, not a bug.

Thanks!

<!-- gh-comment-id:705826644 --> @d4vydm commented on GitHub (Oct 8, 2020): @jhollowe you nailed it. Testing the HTML api also returned empty list. It's not a proxmoxer problem, but API permissions. At the botom of the page https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu it is mentioned: **Only list VMs where you have VM.Audit permissons on /vms/<vmid>.** So I fixed the permissions of the user. I'll close this, not a bug. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmoxer#17
No description provided.