[Ovirt] List VMs with its IP addresses, NIC details..etc using python/ovirt-sdk [Part 4]

Its a common use that we want to know the VM Ips and other NIC card details in an ovirt setup .. Most of the time if you got to know the VM IPs its pretty easy to manage those vms or pulling some data out of it.
Here is an example program which can be used to list the nic details, ip address ..etc of ovirt VMs.

Please note that you need guest agent package installed in the Vm to correctly fetch VMs ips.
Below program version may be not properly intended, so download the program from github ..

The Sample output would like this:

3 Replies to “[Ovirt] List VMs with its IP addresses, NIC details..etc using python/ovirt-sdk [Part 4]”

    1. Hi Deepesh,
      It should be easy,

      vmsList = api.vms.list(max=500)
      for instance in vmsList:
      In “instance” you have the VM, just list the properties of this ‘instance’ wrt vcpu and v memory , you should be able to make it.

      For ex:
      instance.get_guest_info():

      Please let me know if you need help.

Leave a Reply

Your email address will not be published. Required fields are marked *