[Xen-API] ocaml bindings to xenapi

2012-09-20 Thread Anil Madhavapeddy
Hi, we'd like to use the OCaml bindings to the XAPI XML-RPC layer in a research 
project.  Is there any way to get these separately of XAPI itself?  

We just need a simple client library (analogous to XenAPI.py) rather than the 
whole lot.  I can rip the bindings out of XAPI if there's no other solution...

cheers,
Anil
___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


Re: [Xen-API] various questions

2012-09-20 Thread Dave Scott
Hi,

[cc:d xen-api@lists.xen.org where xen-api/xen-api-libs are developed]

Charalampos Rotsos wrote:

> Hi all, 

> As a quick intro, over  summer I have been working on getting mirage
> to work as a network simulation and emulation platform. I have developed
> so far an ns3 backend tha allow to run applications as event driven
> simulations and a mechanism to bootstrap distributed xen-based emulation
> using the xapi interface. Also, because this work was focused to develop
> a tool that allow to understand the impact of sdn network architectures,
> I have develop a number of openflow and traffic generation libraries. So
> far the work is done on the old mirage tree and I will try to port my
> work into the main mirage-platform tools in the near future. 

This sounds really interesting!

> I am currently trying to get a first cut of the xen emulation task and I
> have a couple of question over various things: 

> 1) In order to install the xapi libraries, I need to install a number of
> libraries, that they are different from the libraries distributed by opam.
> The problem is that some of the libraries use some very weird installation
> mechanisms. The xen people have solved the problem by distributed a hacked
> version of these libraries through https://github.com/xen-org/xen-api-libs/.
> How can I introduce an opam recipe in the opam repo that will notify the
> installation mechanism that the libraries are available through this repo
> and override the default recipes for the specific libraries? I tries also
> to rewrite the default recipes for some libraries but I got stuck on
> finding a way to generate a custom META file and I gave up. 

The long-term plan for xen-api-libs is to use the upstream packages instead
of entirely custom ones. For example, now that "ocaml-rpc" is available
through opam I'd like to remove the custom fork "xen-api-libs/rpc-light".

Some of the code in "xen-api-libs" is a (not very high quality IMHO) custom
"standard library". I think we should probably switch to a better alternative,
such as (Jane Street) Core. However in the short term we could probably just
opam-package what we have.

Which particular packages are you having trouble with? I could take a quick
look and see if I could help.

Also, if you're running debian you might be able to just use "apt" to fetch
the build dependencies of xapi in your opam "system" compiler.

> 2) For the ocaml-pcap library is there some example code and the device
> configurations I need in order to get it working as a network capture
> mechanism for a xen vm? 

The extra pieces are:

1. mirage-net netif support for capture

https://github.com/mirage/mirage-net/pull/5

(I just made the pull request)

2. a bit of glue to read the captured frames and write them to a block
device. I'm half-way through a bit of refactoring -- I'll send you a link
when I'm done.

> 3) I have written some code that allows to generate network topologies and
> boot vm over xapi and I have tested and verified the code on a debian vm.
> This unfortunately is constrained on testing the network throttling
> configurations. Is there any xapi configured machine I could get access to
> to verify the runtime correctnesss of the code? 

When you say "network throttling" do you mean netback VIF rate limiting? If
so there is a bug against the xen-api master branch and a fix in a pull
request.

Cheers,
Dave


___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


Re: [Xen-API] ocaml bindings to xenapi

2012-09-20 Thread Dave Scott

Anil wrote:
> Hi, we'd like to use the OCaml bindings to the XAPI XML-RPC layer in a
> research project.  Is there any way to get these separately of XAPI
> itself?
> 
> We just need a simple client library (analogous to XenAPI.py) rather
> than the whole lot.  I can rip the bindings out of XAPI if there's no
> other solution...

I think you're in luck! Jon (cc:d) has started the process of extracting
the bindings from the main repo.

https://github.com/jonludlam/xen-api-client

It's a start :-) but it needs a bit of a tidy up. We need to ruthlessly
rip out any server-related code which may have accidentally been copied
across.

Jon has already functorised it so it should work with Lwt, Async and
regular threads.

Looking at it I don't think Jon's included the actual code generator (yet)
but that's clearly one of the next steps.

So I reckon we need to:
1. oasis it up
2. add some test cases (using either lwt or async?)
3. add an interesting example (could use the xen-api/ocaml/graph one?)
4. declare version 0.1 and add to opam
5. bask in the awesomeness of utop with tab-completion + xen-api

What do you think?

BTW this version of the bindings targets the xapi in the master branch,
but for basic stuff there should be no problem talking to older releases.

Cheers,
Dave

___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


Re: [Xen-API] ocaml bindings to xenapi

2012-09-20 Thread Anil Madhavapeddy
On 20 Sep 2012, at 10:12, Dave Scott  wrote:

> 
> Anil wrote:
>> Hi, we'd like to use the OCaml bindings to the XAPI XML-RPC layer in a
>> research project.  Is there any way to get these separately of XAPI
>> itself?
>> 
>> We just need a simple client library (analogous to XenAPI.py) rather
>> than the whole lot.  I can rip the bindings out of XAPI if there's no
>> other solution...
> 
> I think you're in luck! Jon (cc:d) has started the process of extracting
> the bindings from the main repo.
> 
> https://github.com/jonludlam/xen-api-client
> 
> It's a start :-) but it needs a bit of a tidy up. We need to ruthlessly
> rip out any server-related code which may have accidentally been copied
> across.
> 
> Jon has already functorised it so it should work with Lwt, Async and
> regular threads.
> 

Awesome! I've started OASIS'ing it up in my fork:
https://github.com/avsm/xen-api-client

I haven't quite figured out the runes to run it optionally through pa_js
yet, but need to do that anyway.

Looks like doing a Cohttp_lwt_unix version should be very straightforward,
but I need a XAPI box to try it on.  I guess a Fusion installation is the way
to go here, unless there is a fakeserver that still works?

> Looking at it I don't think Jon's included the actual code generator (yet)
> but that's clearly one of the next steps.
> 
> So I reckon we need to:
> 1. oasis it up
> 2. add some test cases (using either lwt or async?)
> 3. add an interesting example (could use the xen-api/ocaml/graph one?)
> 4. declare version 0.1 and add to opam
> 5. bask in the awesomeness of utop with tab-completion + xen-api
> 
> What do you think?
> 
> BTW this version of the bindings targets the xapi in the master branch,
> but for basic stuff there should be no problem talking to older releases.

All sounds good!

-a

___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


Re: [Xen-API] various questions

2012-09-20 Thread Anil Madhavapeddy
On 20 Sep 2012, at 10:03, Dave Scott  wrote:

>> 2) For the ocaml-pcap library is there some example code and the device
>> configurations I need in order to get it working as a network capture
>> mechanism for a xen vm? 
> 
> The extra pieces are:
> 
> 1. mirage-net netif support for capture
> 
> https://github.com/mirage/mirage-net/pull/5
> 
> (I just made the pull request)
> 
> 2. a bit of glue to read the captured frames and write them to a block
> device. I'm half-way through a bit of refactoring -- I'll send you a link
> when I'm done.

This conflicts slightly with some changes we've made to expose promiscuous
interfaces from Mirage-net directly.  Would it better to put the Mirage
pcap code back into ocaml-pcap (beside the Lwt code), now that those
functions are exposed properly?

-anil

___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


Re: [Xen-API] various questions

2012-09-20 Thread Anil Madhavapeddy
On 20 Sep 2012, at 10:03, Dave Scott  wrote:

>> 1) In order to install the xapi libraries, I need to install a number of
>> libraries, that they are different from the libraries distributed by opam.
>> The problem is that some of the libraries use some very weird installation
>> mechanisms. The xen people have solved the problem by distributed a hacked
>> version of these libraries through https://github.com/xen-org/xen-api-libs/.
>> How can I introduce an opam recipe in the opam repo that will notify the
>> installation mechanism that the libraries are available through this repo
>> and override the default recipes for the specific libraries? I tries also
>> to rewrite the default recipes for some libraries but I got stuck on
>> finding a way to generate a custom META file and I gave up. 
> 
> The long-term plan for xen-api-libs is to use the upstream packages instead
> of entirely custom ones. For example, now that "ocaml-rpc" is available
> through opam I'd like to remove the custom fork "xen-api-libs/rpc-light".
> 
> Some of the code in "xen-api-libs" is a (not very high quality IMHO) custom
> "standard library". I think we should probably switch to a better alternative,
> such as (Jane Street) Core. However in the short term we could probably just
> opam-package what we have.
> 
> Which particular packages are you having trouble with? I could take a quick
> look and see if I could help.
> 
> Also, if you're running debian you might be able to just use "apt" to fetch
> the build dependencies of xapi in your opam "system" compiler.

I think that Haris only needs all this stuff in order to compile the client
bindings, and hopefully the other thread on xen-api-client will be all he
needs to integrate his simulator with a real XCP installation.  Correct me if
wrong, Haris!

-anil
___
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api