Howdy folks!
So I've been working on a qpid interface to libvirt. Here's the description
I've come up with:
libvirt-qpid provides an interface with libvirt using QMF (qpid modeling
framework) which utilizes the AMQP protocol. The Advanced Message Queuing
Protocol (AMQP) is an open standard application layer protocol providing
reliable transport of messages.
QMF provides a modeling framework layer on top of qpid. This interface
allows you to manage hosts, domains, pools etc. as a set of objects with
properties and methods.
The source code repo:
http://git.et.redhat.com/?p=libvirt-qpid.git;a=summary
So I'd like to hear any feedback you guys might have. This file in particular
describes the API that is used to interact with libvirt.
http://git.et.redhat.com/?p=libvirt-qpid.git;a=blob_plain;f=src/libvirt-s...
My TODO list looks like this:
- Not sure on camel case or underscores. Original libvirt API uses
camel case, I went with underscores as I was originally basing it off
the ruby bindings.
- Need rc scripts, daemonization, better reconnect/error handling for
both qpid and libvirt. I think it should attempt to reconnect until
successful whenever it gets disconnected. We may need an extra status
property for this state as well.
- Return libvirt error codes? (it's just text msgs right now with error
status bit).
- Make it less chatty, but log stuff
If you wish to try it out, I've made rpms for fedora 9 x86_64 and i386.
They are in the ovirt repo, which you can add to yum using:
rpm -ivh
http://ovirt.org/repos/ovirt/9/ovirt-release-LATEST.fc9.noarch.rpm
Once you have that set up, 'yum install libvirt-qpid python-qpid', and then
run (each in their own terminals):
qpidd --auth no
libvirt-qpid (as root to auth with libvirt)
qpid-tool
qpid-tool provides an interface to qpid and allows you to view/manipulate the
qpid models/objects. Here is an example of how it looks using qpid-tool:
$ qpid-tool
Management Tool for QPID
qpid: list
Management Object Types:
ObjectType Active Deleted
============================================
com.redhat.libvirt:domain 2 0
com.redhat.libvirt:node 1 0
qpid: list node
Objects of type com.redhat.libvirt:node
ID Created Destroyed Index
=================================
101 00:02:00 -
qpid: show 101
Object of type com.redhat.libvirt:node: (last sample time: 17:47:54)
Type Element 101
==============================================
property hostname
vpro.mains.net
property uri qemu:///system
property libvirt_version 0.4.5
property api_version 0.4.5
property hypervisor_version 0.9.1
property hypervisor_type QEMU
qpid: list domain
Objects of type com.redhat.libvirt:domain
ID Created Destroyed Index
=================================
102 00:02:05 - 101
103 00:02:05 - 101
qpid: show 102
Object of type com.redhat.libvirt:domain: (last sample time: 17:48:09)
Type Element 102
=================================================================
property uuid 662958f8-12c5-baad-2252-4d2126e0971f
property name ovirt-appliance
property node 101
property state shutoff
property num_vcpus 1
property active false
statistic maximum_memory 786432
statistic memory 786432
statistic cpu_time 0
qpid: call 102 create
Call Result: create 0 (OK) {}
qpid: show 102
Object of type com.redhat.libvirt:domain: (last sample time: 17:48:24)
Type Element 102
=================================================================
property uuid 662958f8-12c5-baad-2252-4d2126e0971f
property name ovirt-appliance
property node 101
property state running
property num_vcpus 1
property active true
statistic maximum_memory 786432
statistic memory 786432
statistic cpu_time 0
qpid: