Code Monkey home page Code Monkey logo

Comments (4)

lukaszo avatar lukaszo commented on July 30, 2024

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)

from python-oca.

mdehollander avatar mdehollander commented on July 30, 2024

Hello Lukaszo,

The output of 'list(vmpool)[-1].xml' is:

<VM><ID>4635</ID><UID>75</UID><USERNAME>xxxxxx</USERNAME><NAME>Cloudman_Node</NAME><LAST_POLL>1308325540</LAST_POLL><STATE>3</STATE><LCM_STATE>3</LCM_STATE><STIME>1308322191</STIME><ETIME>0</ETIME><DEPLOY_ID>one-4635</DEPLOY_ID><MEMORY>1048576</MEMORY><CPU>0</CPU><NET_TX>0</NET_TX><NET_RX>0</NET_RX><LAST_SEQ>0</LAST_SEQ><HISTORY><SEQ>0</SEQ><HOSTNAME>node15-one</HOSTNAME><HID>51</HID><STIME>1308322217</STIME><ETIME>0</ETIME><PSTIME>1308322217</PSTIME><PETIME>1308322262</PETIME><RSTIME>1308322262</RSTIME><RETIME>0</RETIME><ESTIME>0</ESTIME><EETIME>0</EETIME><REASON>0</REASON></HISTORY></VM>

So no template or IP information there, but if I use the one.vm.info() function the template element is included:

Thanks!

from python-oca.

lukaszo avatar lukaszo commented on July 30, 2024

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.

from python-oca.

lukaszo avatar lukaszo commented on July 30, 2024

If there is no more comments I'm closing this ticket.

from python-oca.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.