[virt-tools-list] Add oVirt support to remote-viewer

Christophe Fergeau cfergeau at redhat.com
Wed Jun 13 12:23:08 UTC 2012

Lately I've been hacking on making it possible for remote-viewer to connect
to a VM managed through oVirt/RHEV.
Theses patches add an ovirt:// uri scheme, ovirt://hostname/vmname will
access 'vmname' located on the oVirt manager at 'hostname'

This is done by using the REST API provided by oVirt, accessible at
http://hostname/api. For now you have to know the admin login/password to
use this, but it's being improved so that normal users can use it too.
These patches uses the REST API to find the UUID associated with vmname,
and then to get the parameters to use (IP, port, ..) to connect to this VM.
Then a ticket is generated through this API, and we create a
VirtViewerSessionSpice object to handle the connection.

There are currently a few limitations:
* on most setups, you'll need to get the certificate at
  http://hostname/ca.crt and pass it to remote-viewer with --spice-ca-file
* it's SPICE only even if supporting VNC as well shouldn't be hard
* it currently generates a spice://hostname?password=ticket URI because I
  couldn't find a better way of passing the ticket to
  VirtViewerSessionSpice (this would probably require a bit of changes).
  This triggers a spice-gtk warning of being possibly unsecure, and this
  fails when the ticket contains some special characters (for example '/'
  breaks spice-gtk URI parser)
* librest from git (d8db409a6) + the patches from
  https://bugzilla.gnome.org/show_bug.cgi?id=658937 are needed for 19/20

The series can be divided in 2 parts. First 01/20 to 14/20 (included) add
new Ovirt* classes which use librest and are used to interact with oVirt
REST API. I've split these commits in case it's easier to review, but it
may be more convenient to review just the end result. These classes are
independant from remote-viewer and can be reused in other projects. I'll
probably put them in a library at some point.

Then 15/20 to 20/20 implement a VirtViewerSessionOvirt object which uses
the Ovirt* classes to implement the actual logic of going from vmname to a
SPICE connection.

I've tested this code with 2 RHEV instances and it's working very nicely
for me, so it should be good to go in after reviews and after the librest
API lands in git (and possibly in a release)


More information about the virt-tools-list mailing list