I've been spending a lot of time lately building a management interface for Xen VMs inside a Rails application. The current state of Xen's APIs is poorly documented, which makes implementation... let's say *character-building*. The best comparison I've been able to find comes from Ewan Mellor on the Xen mailing list:
> - **xend-http-server:** Very old and totally broken HTML interface and legacy, generally working SXP-based interface, on port 8000.
> - **xend-unix-server:** Ditto, using a Unix domain socket.
> - **xend-unix-xmlrpc-server:** Legacy XML-RPC server, over HTTP/Unix, the recommended way to access Xend in 3.0.4.
> - **xend-tcp-xmlrpc-server:** Ditto, over TCP, on port 8006.
> - **xen-api-server:** All new, all shiny Xen-API interface, available in preview form now, and landing for 3.0.5.
>
> -- Ewan Mellor, 2007-01-24
As far as I can tell, if you're running Xen 3.0.4 or earlier, your best bet is the [Ruby-Xen gem](http://ruby-xen.rubyforge.org/) which wraps the legacy XML-RPC API. If you're on Xen 3.0.5 or later, the preferred approach is the new Xen API -- which, at the time of writing, has virtually no documentation and no existing Ruby client.
A useful paper discussing the Xen API is available [here](http://research.iu.hio.no/theses/pdf/master2007/ingard.pdf), which suggests the new API also uses XML-RPC under the hood.
Over the coming weeks I'm hoping to set up some modern Xen dom0s and start documenting exactly what's needed to get the Xen API running and accessible from another host on the same network.
Update, 2008-03-15
I found a draft specification of the new XML-RPC API on the XenSource Wiki. A huge cake awaits anyone who writes a BSD or MIT licensed Ruby client against that spec.