How to get network interface with API if the VM has guest agent disabeled

rareness

New Member
Oct 18, 2023
3
0
1
I have an python code using proxmoxer to get the network-interfaces from VM, however it fails with an exception if guest agent is turned off for the VM. Is there any other way to get an network-interfaces information with API, having guest agent turned off


Code:
interface_info = node.qemu(vm_id).agent.get('network-get-interfaces')['result']
 
I am not aware of another API endpoint which could be used.
Another approach would be to connect with python to the VM via SSH and execute a command to obtain information about the network-interfaces.
Something like this:

Code:
ssh = paramiko.SSHClient()
ssh.connect(server, username=username, password=password)
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(cmd_to_execute)
 

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!