[one-users] API method for getting all hosts info

Borja Sotomayor borja at borjanet.com
Wed Aug 6 00:44:42 PDT 2008


Hi,

> I'm in need for a new method in ONE's XML-RPC API, which would return
> information about all hosts added to ONE.
> I'm writing a code that needs to retrieve all hosts without knowing
> hosts ids in advance. To solve this requirement, one could consider
> two approaches: either to create a method that would return full
> information about all nodes in a single call or to create a method
> that would only return a list of host ids. In the later case, full
> information about all hosts would be obtained by successively calling
> 'one.hostinfo'.
> Is this viable? Or is there any other preferable way of getting that
> information?

The current approach used in "onehost list" and in the OpenNebula/Haizea 
integration is to access the ONE database directly. I believe the 
rationale for this was that (1) the physical host information is 
something you typically only need to know locally (e.g., admin commands, 
the Haizea scheduler, etc.) and not remotely and (2) polling for a 
(potentially large) host list through XMLRPC could be an expensive 
operation, so direct database access was used instead.

I can see how rationale (1) is not really valid if you want a 
third-party component (like VWS, which could be in a different machine) 
to access the host list, so it may make sense to add a new operation to 
the API to retrieve the host list (even if this operation is not used by 
"onehost list"; at least it would be available for other components to 
use). Could you create a ticket in the Trac so we can track the issue 
there?

Finally, as a workaround, you can access the ONE database directly for 
now (the only limitation is that VWS and ONE will have to be running on 
the same node; but this assumption can be easily removed when an API 
call for this becomes available). There are a number of options for 
accessing a SQLite database from Java: 
http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers. If you have any 
trouble parsing the ONE db, don't hesitate to ask here.

Cheers!
-- 
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Borja Sotomayor, University of Chicago
  Ph.D. Student, Department of Computer Science
  Ryerson 257-C, 1100 East 58th Street, Chicago, IL
Haizea: http://haizea.cs.uchicago.edu/
BorjaNet:  http://www.borjanet.com/
·····························································
          "Dis maschine vill run und run!"
                -- Kurt Gödel (on the Turing Machine)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



More information about the Users mailing list