Entries in cloudstack_ruby_client (2)


Prototype Ops Dashboard for CloudStack

I've been thinking about the Apache CloudStack UI's experience for operators, and although it's great in small environments, I believe that there could be significant improvement in the way that operators review and manage larger clouds. The layout of the native CloudStack UI is more focused on a graphical experience that helps explain the internal structure to the viewer. With a larger environment, the operator is (most likely) less interested in visually seeing relationships between the various infrastructure bits. What they want, is a dashboard view into their capacity (all available aspects), with drilldowns. They also need a much cleaner way to review the event stream that's generated by the system. To those ends, I started working on a project to create a prototype that might be one way to meet these needs. As with most of my postings these days, this is a fairly incomplete project at the moment so YMMV quite a bit.

If I get the viewing of data to the point where I'm happy, the next phase would be to consider how a large scale operator might want to perform and / or track changes to the platform itself. That's a long ways off though.

The Screenshots

The initial screenshot below will eventually be the zone listing page, who's goals should be to easily view the capacity and status of each zone. It really needs to be multi-region aware, but it's not yet.

Drilling into an example zone, the zone properties and current capacity are the first elements visible. I'm not quite sure that the properties should be as prominant, but that's what I started with. Below these bits, are trends for the capacity (go figure, trending helps in doing capacity planning!).

I've also got a very raw view into the event stream from the management server started as well:

Technical Summary

I'll readily admit that I picked Ruby and Ruby on Rails purely because I wanted to get some hands on experience with Rails (and to get a little better at core Ruby). The prototype code is on github in my cs-operator-dashboard repo.

The project is broken up into three parts:


  1. cs-operator-dash: contains the Rails UI
  2. cs_eventconsumer: a gem that can run a daemon process to pull CloudStack events out of a RabbitMQ broker and push them into MongoDB
  3. cs_capacityretriever: a gem that can run a daemon process to periodically pull various capacity information from a CloudStack management server via my cloudstack_ruby_client gem, again pushing that data into MongoDB


Obviously this requires a running CloudStack management server (configured with the RabbitMQ event handler). It also requires MongoDB to store the data from the 2 daemon processes.

The basic concept is that the cs-operator-dash Rails app is largely read-only, and works with data being populated into MongoDB via the two daemon processes. cs-operator-dash uses the Mongoid ORM to map the appropriate models to the collections being created by the back-end processes.

One of the main benefits to using a "collector > datastore < UI" architecture is that it allows the data to be stored as a historical record (that's how I get the trend lines).

You can dig through the code if you're interested, and feel free to poke me with pull requests and / or github issues if you want to see something else. Remember though...  it's just a prototype. ;-)


CloudStack Ruby Client Gem

I'm happy to announce that I just pushed out a Ruby binding for the Apache CloudStack API: cloudstack_ruby_client.

You can get the source bits on GitHub, or simply "gem install cloudstack_ruby_client" to get the gem from rubygems.org.

Extra special thanks to Quentin Pleplé for the origional cloudstack-client-generator and Jason Hancock for keeping his fork of the generator updated (and for accepting my pull request to add Ruby support to it).

Here's a simple example of listing the network offerings provided by a CloudStack installation:

require 'cloudstack_ruby_client'

URL = '' APIKEY = 'yy0sfd...Tq8YFw' SECKEY = 'Pse4fq...lJFZVw'

client = CloudstackRubyClient::Client.new(URL, APIKEY, SECKEY, false) puts client.listNetworkOfferings()

See, easy!

It's built against the Apache CloudStack 4.0.0-incubating release, but should work for most CloudStack 3.x versions (pre-Apache), as well as against future Apache releases in the 4.x line. We're using Semantic Versioning for CloudStack release numbering, so you'll know when backward compatibility breaks by the major version number.

Use the Apache CloudStack API docs to understand each available method.