Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

This is the intro page to developing for CloudStack.  If you're looking for other topics on CloudStack, look a few pages further down on the site.

Design Goals

To start off with CloudStack development, you must first understand the design goals of CloudStack.  And, yes, we did have some design goals from the beginning.  We didn't plan on being a "five geeks in a garage operation" for very long!

...

To do this, CloudStack have three different sets of APIs: Platform API, Agent API and Plugin API.  The Platform API is the REST-like API through which end users and administrators controls CloudStack.  There are various client side bindings to this API and allows the caller to quickly put together scripts to automate processes within CloudStack.  However, this API must be very secure as the caller is not trusted.  The Agent API is used for CloudStack components to talk to the ServerResource, which then translates this API to what the hardware resource understands.  This API is JSON based so that the client can be written in any language and to run on any platform convenient to the developer.  The Plugin API allows one to insert code directly into CloudStack deployments to add to or modify behavior of CloudStack.  This is a Java API and there are a set of predefined functionality exposed through this API.

Integrating new hardware resources with Agent API

At its core, as the diagram below shows, CloudStack provides the capability to map virtual resources to various physical resources.  Note that it is only the "capability" and not the actual "mapping".  This is  key to the design principles of CloudStack.  The system administrator provides, controls, and monitors the actual mapping.  CloudStack is only the tool.  Use it for good or for evil. It's all up to that guy in the middle there.

...

  • Why isn't any JSON published?  Why are all of the agent API commands Java classes?
  • Why are all ServerResources written in Java?
  • Why are XenServer and VmWare ServerResources deployed within the management server and never as a remote agent?
  • Why is KVM only deployed as a remote agent but never within the management server?
  • The agent container code is fairly scant in features.  What about creating and destroying ServerResource, upgrading the code, etc in a automatic manner?  It is all manual process right now.
Integrating with CloudStack with the Platform API

API is the window to CloudStack's soul.  Since version 2.0, CloudStack has sported a flexible design for adding and modifying commands.  Since version 3.0, CloudStack supports third party vendors adding commands without modifying CloudStack's command list via the PluggableService interface.  CloudStack's API designs are as follows:

...

REST API is broken into two parts: End User API and OAM&P (Operations, Administration, Maintenance, and Provisioning) or basically Admin API.

...

End User Platform API

...

  • The End User REST API must always be backwards compatible.
  • The End User REST API must not leak any information about the physical resources underneath.

...

OAM&P Platform API

...

  • The OAM&P REST API must attempt to maintain backwards compatibility.  (WEAK....yes...Agreed)
Plugin API

Plugin API is where you can affect the most changes.  The following is a picture of the CloudStack software architecture.  Plugin APIs are defined by the Adapters which exposes the functionality required by CloudStack to implement cloud operations.  The details of how to affect this change is more complicated and is explained in 201.

Getting to the Code!

Now that you have an idea of the design principles behind CloudStack, let's take a look at the rest of the nitty gritty you should take a look at before writing code.

...

Setting up CloudStack Developer environment for Windows, Mac or Linux;

Fundamentals

Coding Conventions...(Snore but none the less important)

...

Data Access Layer

Locking (TODO)

Putting It Together

Putting CloudStack Together