https://github.com/aglitke/vdsm-rest/
Today I am releasing a proof of concept implementation of a REST API for vdsm.
You can find the code on github. My goal is to eventually replace the current
xmlrpc interface with a REST API. Once completed, ovirt-engine could switch to
this new API. The major advantages to making this change are: 1) VDSM will gain
a structured API that conceptually, structurally, and functionally aligns with
the ovirt-engine REST API, 2) this new API can be made public, thus providing an
entry point for direct virtualization management at the node level.
Status:
-------
The REST API currently lives outside of VDSM in its own tree. It maps the
current vdsm python bindings into a resource hierarchy and exposes it using
CherryPy. The existing vdsm API is not fully implemented yet in the REST API.
I made the decision to release now in order to gauge interest and gain some
feedback. There are three main issues that I would like to get some comments
on:
The storage API is undergoing some major changes but this API still uses the old
API. I will make the necessary changes in tandem. Once finished, I think this
code could be run from a thread inside vdsm (similar to the way xmlrpc is done
today).
To support a standalone VDSM use case, the current code makes use of a storage
mechanism to persist virtual machine definitions. At present, this is
implemented as a SQLite database that stores blobs. We also use this DB to
store information about configured storage pools (since disconnected storage
pools are not known to vdsm). This system does not make sense for a vdsm that
is connected to ovirt-engine. In that case, storage pools and virtual machines
are managed by the management server and "pushed" to vdsm. To accomodate both
use cases we will need to support a configuration option that determines if
local storage of objects is to be used. By default this will be disabled and
only active VM and storage pool resources will be represented by the API.
ovirt-engine wants to subscribe to asynchronous events. REST APIs do not
typically support async events and instead rely on polling of resources. I am
investigating what options are available for supporting async events via REST.
Getting started:
----------------
Please check out the source and https://github.com/aglitke/vdsm-rest/wiki/HOWTO
for quick start instructions. You will need to install a back-level version of
vdsm and apply a small patch. Of course this is temporary.
I look forward to your comments!
--
Adam Litke <agl(a)us.ibm.com>
IBM Linux Technology Center