This repository has been archived by the owner on Feb 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Obtaining the IP address of an vm #2
Comments
Hi MaTiZ, In opennebula version 2.0 and higher information about network is stored in template. For example to get all VM ips You can run: [i.ip for i in list(vmpool)[0].template.nics] but as already you know in Opennebula 1.4 there is no 'Template' element so I don't know how to get IP. Can you send me output of: from xml.etree import ElementTree
ElementTree.tostring(list(vmpool)[-1].xml) |
Hello Lukaszo, The output of 'list(vmpool)[-1].xml' is:
So no template or IP information there, but if I use the one.vm.info() function the template element is included:
Thanks! |
You may workaround this by running something like this: for i in vmpool:
i.info() then you should be avle to get ip address: [i.ip for i in list(vmpool)[0].template.nics] But as you can see it's very inefficient. I don't see another way to do this in OpenNebula 1.4. |
If there is no more comments I'm closing this ticket. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
How can I get the IP address of a virtual machine?
It is not listed as one of the attributes:
list(vmpool)[-1].xml.getchildren()
The text was updated successfully, but these errors were encountered: