[GH-ISSUE #133] Unable to get IP on RHEL9/OEL9/Rockly Linux 9 etc #65

Closed
opened 2026-02-27 15:46:15 +03:00 by kerem · 5 comments
Owner

Originally created by @riaanp78 on GitHub (Jan 24, 2023).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/133

Hi,

Not sure if this is bug. But with the qemu tools/agent running. I am unable to get the IP from a Linux host that is RHEL 9 based. Works perfect with others.

How can I help debug this issue?

Originally created by @riaanp78 on GitHub (Jan 24, 2023). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/133 Hi, Not sure if this is bug. But with the qemu tools/agent running. I am unable to get the IP from a Linux host that is RHEL 9 based. Works perfect with others. How can I help debug this issue?
kerem 2026-02-27 15:46:15 +03:00
Author
Owner

@jhollowe commented on GitHub (Jan 24, 2023):

What version of Proxmox VE are you using?
What version of proxmoxer are you using?
Does the IP appear in the web UI?

Please provide a code example of what you are trying to do.

<!-- gh-comment-id:1402738854 --> @jhollowe commented on GitHub (Jan 24, 2023): What version of Proxmox VE are you using? What version of proxmoxer are you using? Does the IP appear in the web UI? Please provide a code example of what you are trying to do.
Author
Owner

@riaanp78 commented on GitHub (Jan 25, 2023):

Proxmox Version: 7.2-3 / pve-manager/7.2-3/c743d6c
Proxmoxer 2.0.1 (via pip install)
The IP does appear in the WEB UI / Qemu Agent is running

Code Extract: (purpose is to get hostname and IP)
`# Get all nodes in cluster
for node in proxmox.nodes.get():
# print("{0}:".format(node['node']))

for vm in proxmox.nodes(node["node"]).qemu.get():
    if vm["status"] == 'running':

        conf = proxmox.nodes(node['node']).qemu(vm['vmid']).config.get()

        ipextracted = re.findall(
            '(?:\d{1,3}\.){3}\d{1,3}(?:\/\d\d?)?', str(conf.get("ipconfig0")))

        if ipextracted:

            ip = IPNetwork(ipextracted[0])

            f.write('{0:40} {1:10}'.format(
                vm["name"].strip(), 'ansible_host=' + str(ip.ip).strip() + '\n'))`

Found something interesting though. If i use the API direct via bash I also dont see the IP. So might be a proxmox issue
{ "data": { "description": "", "name": "tmpl-linux-RL9x", "cpu": "host", "boot": "order=scsi0;ide2;net0", "smbios1": "uuid=019b3bcb-b730-4288-96d7-acbab7f2cb70", "ostype": "l26", "memory": 16384, "scsi0": "datastore:159/vm-159-disk-1.qcow2,size=71G", "efidisk0": "datastore:159/vm-159-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K", "digest": "dc04ee4fac9baecae0204e09a4fe3f6eded4919a", "numa": 0, "net0": "virtio=C2:84:1E:04:30:55,bridge=vmbr1,firewall=1,tag=39", "balloon": 0, "ide2": "none,media=cdrom", "bios": "ovmf", "scsihw": "virtio-scsi-pci", "agent": "1", "cores": 2, "vmgenid": "c156a1ad-d654-4c82-bf38-941a06541947", "ide0": "datastore:159/vm-159-cloudinit.qcow2,media=cdrom", "meta": "creation-qemu=6.2.0,ctime=1663587543", "sockets": 1, "parent": "afterupdate" } }

<!-- gh-comment-id:1403190768 --> @riaanp78 commented on GitHub (Jan 25, 2023): Proxmox Version: 7.2-3 / pve-manager/7.2-3/c743d6c Proxmoxer 2.0.1 (via pip install) The IP does appear in the WEB UI / Qemu Agent is running Code Extract: (purpose is to get hostname and IP) `# Get all nodes in cluster for node in proxmox.nodes.get(): # print("{0}:".format(node['node'])) for vm in proxmox.nodes(node["node"]).qemu.get(): if vm["status"] == 'running': conf = proxmox.nodes(node['node']).qemu(vm['vmid']).config.get() ipextracted = re.findall( '(?:\d{1,3}\.){3}\d{1,3}(?:\/\d\d?)?', str(conf.get("ipconfig0"))) if ipextracted: ip = IPNetwork(ipextracted[0]) f.write('{0:40} {1:10}'.format( vm["name"].strip(), 'ansible_host=' + str(ip.ip).strip() + '\n'))` Found something interesting though. If i use the API direct via bash I also dont see the IP. So might be a proxmox issue `{ "data": { "description": "", "name": "tmpl-linux-RL9x", "cpu": "host", "boot": "order=scsi0;ide2;net0", "smbios1": "uuid=019b3bcb-b730-4288-96d7-acbab7f2cb70", "ostype": "l26", "memory": 16384, "scsi0": "datastore:159/vm-159-disk-1.qcow2,size=71G", "efidisk0": "datastore:159/vm-159-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K", "digest": "dc04ee4fac9baecae0204e09a4fe3f6eded4919a", "numa": 0, "net0": "virtio=C2:84:1E:04:30:55,bridge=vmbr1,firewall=1,tag=39", "balloon": 0, "ide2": "none,media=cdrom", "bios": "ovmf", "scsihw": "virtio-scsi-pci", "agent": "1", "cores": 2, "vmgenid": "c156a1ad-d654-4c82-bf38-941a06541947", "ide0": "datastore:159/vm-159-cloudinit.qcow2,media=cdrom", "meta": "creation-qemu=6.2.0,ctime=1663587543", "sockets": 1, "parent": "afterupdate" } }`
Author
Owner

@riaanp78 commented on GitHub (Jan 25, 2023):

I think/I know the problem is on my side. The proxmox forum showed me how to get the IP of the VM via CURL API. So it must be me doing something wrong

https://forum.proxmox.com/threads/proxmox-ve-api-via-proxmoxer.121524/

Dont think anything is wrong with proxmoxer :)

<!-- gh-comment-id:1403282552 --> @riaanp78 commented on GitHub (Jan 25, 2023): I think/I know the problem is on my side. The proxmox forum showed me how to get the IP of the VM via CURL API. So it must be me doing something wrong https://forum.proxmox.com/threads/proxmox-ve-api-via-proxmoxer.121524/ Dont think anything is wrong with proxmoxer :)
Author
Owner

@riaanp78 commented on GitHub (Jan 25, 2023):

So i found the correct method from the API, but unsure how to use it. (not your problem, will figure it out, new to python)

This does not work:
conf2 = proxmox.nodes(node['node']).qemu(vm['vmid']).agent.network-get-interfaces.get()

<!-- gh-comment-id:1403309223 --> @riaanp78 commented on GitHub (Jan 25, 2023): So i found the correct method from the API, but unsure how to use it. (not your problem, will figure it out, new to python) This does not work: `conf2 = proxmox.nodes(node['node']).qemu(vm['vmid']).agent.network-get-interfaces.get()`
Author
Owner

@jhollowe commented on GitHub (Jan 27, 2023):

The issue is the -'s in the network-get-interfaces part of the command. See the docs for how to work around this quirk of Python.

Feel free to reopen if you are still having issues with proxmoxer.

<!-- gh-comment-id:1407110958 --> @jhollowe commented on GitHub (Jan 27, 2023): The issue is the `-`'s in the `network-get-interfaces` part of the command. See [the docs](https://proxmoxer.github.io/docs/2.0/basic_usage/#invalid-names-in-python) for how to work around this quirk of Python. Feel free to reopen if you are still having issues with proxmoxer.
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#65
No description provided.