Icon Rufen Sie uns an
+49 441.309197-69 +49 441.309197-69
 
EN

Manage CloudStack instances with Foreman

Posted by Daniel Rauer on Tuesday, September 22, 2015

Foreman and CloudStack/Citrix CloudPlatform

Logo of Citrix CloudPlatform

Some time ago our colleague Hauke Behrens blogged about 'the Foreman'. It is our tool of choice for managing all the virtual machines running on various KVM-based virtualization hosts. During close communication with IT service provider ennit server GmbH, located in Kiel, we developed the idea to bring the Foreman and CloudStack (or in this special case: Citrix CloudPlatform) together more closely.

The starting point

The Foreman can easily be adapted by various plugins, and there was even one existing that integrates CloudStack into the Foreman. Well, at least there was some code providing a basic integration. But only a couple of features were implemented, installation required a lot of manual work, and it was not compatible with version 1.7 of the Foreman. Anyways - it was a very good starting point, so we forked the project and decided to improve, enhance and update this code to make it a shiny piece of software.

Getting it done

Some of the major steps that were necessary, and the main features we implemented:

  • Create a working and easy-install plugin for the Foreman: Foreman/CCP Plugin at GitHub
  • Adapt the parameter handling to the current API
  • Implement CloudStack zone selector on the user interface
  • Implement hypervisor type selector
  • Implement selector of service offerings
  • Implement selector of disk offerings
  • Implement selector of templates and ISOs for the images
  • Store the IP and MAC address, returned by CloudStack, into the Foreman host

Obstacles to overcome

Our general plan was to repair and improve the current plugin, ideally together with the author. But he did not answer our requests, so we had the hope of forking this project, implement the changes and features, and create a pull-request so the auther can merge the improvements back to the original work. That way the name of the plugin and the RubyGem as well as all references to the original work would have been kept. But we also received no answer to our proposal and pull request as well... In the end we created our own plugin and RubyGem and got it listed on the plugin overview by the Foreman: List of Foreman plugins

A small feature request turned out to become a total blocker: Passing the hypervisor as a parameter to CloudStack. At first glance the Foreman source code base was flexible enough to get this patched in quickly. At second glance this still seemed true. But after digging deeper it became clear why CloudStack did not reflect the hypervisor and the problem turned visible: The Foreman is communicating with CloudStack (and other cloud platforms like EC2 or VMWare) via a common API named fog. And this API does not allow to pass such a parameter to the cloud provider. Together with some of the core developers of the Foreman workarounds were thought through, but non of them were feasible. So this small idea will result in a long process of proposing a patch to the fog development team, waiting for it to get accepted and integrated into a stable version, and after that waiting for it to be integrated into a future version of the Foreman.

Summary

That has been a very interesting and manifold project giving us some mysteries but also very good results. I always like breaking down features into small steps, see these steps slowly building a whole new function and bringing a project to a higher level. Also the positive feedback from the community is something you cannot enjoy enough.

Logo of ennit server GmbH Working together with ennit always was a pleasure! They provided a test environment with a Foreman installation and a Citrix CloudPlatform next to it so we could implement the plugin on a real setup. They like the result, it helps them a lot on their daily work with managing a huge pile of virtual machines. The ennit server GmbH sponsored the development of this plugin as part of our contract work for them. Thanks on behalf of the foreman community.

"ennit wanted the maximum benefit from CloudStack (Citrix CloudPlatform) and foreman together, and also give something back to the community. So we looked out for help and with bytemine found an experienced company nearby. They were able to implement the challenges at a reasonable price."
Uwe Kastens, member of management at ennit server GmbH

Links