Hi, 

Im currently making a script using the Python SDK to retrieve a list of VM 
names + their MAC address.
I currently came up with this

 17 vm = api.vms.list()
 18                                                                             
 19 
 20 for item in vm:
 21         hostname = item.get_name()
 22         nic = api.vms.get(name=hostname).nics.list()
 23         for net in nic:
 24                 nicname = net.mac.get_address()
 25         print "%s" % hostname
 26         print "%s" % nicname

I've noticed that retrieving the nic list during the iteration does a logon 
each time which slows thing down dramatically.
Is there a better way to get the NICs from a list of VMs?

Regards,
Vincent

_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users

Reply via email to