Jump to: navigation, search


< Sahara‎ | PluggableProvisioning
Revision as of 15:41, 7 March 2014 by Sergey Lukjanov (talk | contribs) (Sergey Lukjanov moved page Savanna/PluggableProvisioning/PluginAPI to Sahara/PluggableProvisioning/PluginAPI: Savanna project was renamed due to the trademark issues.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Plugin API


Returns all versions of Hadoop that could be used with the plugin. It is responsibility of the plugin to make sure that all required images for each hadoop version are available, as well as configs and whatever else that plugin needs to create the Hadoop cluster.
Returns: list of strings - Hadoop versions
Example return value: (“Apache Hadoop 1.1.1”, “CDH 3”, “HDP 1.2”)


Lists all configs supported by plugin with descriptions, defaults and targets for which this config is applicable.
Returns: list of configs
Example return value: ((“jobtracker heap size”, "JobTracker heap size, in MB", "int", “512”, true, “service:mapreduce”, "node"))


Returns all supported services and node processes for a given Hadoop version. Each node process belongs to a single service and that relationship is reflected in the returned dict object. See example for details.
Returns: dictionary having entries (service -> list of processes)
Example return value: {"mapreduce": ["tasktracker", "jobtracker"], "hdfs": ["datanode", "namenode"]}

convert(cluster, file)

Provides plugin with ability to create cluster based on plugin-specific config. Savanna expects plugin to fill in all the required fields. See “Cluster Lifecycle for Config File Mode” section below for clarification.


Validates a given cluster object. Returns empty list if it is correct. Otherwise for each incorrect field the method should return validation_error with meaningful content.
Returns: list of validation_errors
Example return value: ((“heap size”), (“Heap size is a required field and must be specified”), (“mapred.task.timeout”, “The parameter must be int”))


Plugin has a chance to change cluster description here. Specifically, plugin
  • must specify image for VMs
  • could change VMs specs in any way it needs.
For instance, plugin can ask for additional VMs for the management tool.
Returns: None


Configures cluster on provisioned by savanna VMs. In this function plugin should perform all actions like adjusting OS, installing required packages (including Hadoop, if needed), configuring Hadoop, etc.
Returns: None


Start already configured cluster. This method is guaranteed to be called only on cluster which was already prepared with configure_cluster(...) call.
Returns: None

scale_cluster(cluster, remaining_vm_specs, new_vm_specs, delete_vm_specs)

To be changed
Scales cluster - adds/removes nodes to/from active cluster. This function should configure new nodes and attach them to cluster. Additionally here plugin can make some cleanup on VMs that will be deleted.
Returns: None


When user terminates cluster, Savanna simply shuts down all the cluster VMs. This method is guaranteed to be invoked before that, allowing plugin to do some clean-up.
Returns: None

Object Model

Here is a description of all the objects involved in the API. Notes:

  • cluster and node_group have ‘extra’ field allowing plugin to persist any complementary info about the cluster.
  • node_process is just a process that runs at some node in cluster. Example list of node processes:
  1. jobtracker
  2. namenode
  3. tasktracker
  4. datanode
  • Each plugin may have different names for the same processes.


That object represents a single parameter in Hadoop or VM configuration. Plugin can add fields to this object for its own purposes: it is guarantied that controller returns the config object back to plugin untouched.

Name Type Constraints Description
name string
description string
config_type enum possible values are: 'string', 'integer', 'boolean', 'enum'
config_values list only applicable if config_type=enum, possible value is: ['a', 'b', 'c']
default_value same as 'type'
is_optional boolean
applicable_target string The target could be either a service returned by get_node_processes(...) call in form of 'service:<service name>', or 'general'
scope string could be either 'node' or 'cluster'


Value provided by user for a specific config.

Name Type Constraints Description
config config a config object for which this user_input is provided
value string a value provided by the user for the config


An instance created for the cluster

Name Type Constraints Description
id string
ip string


Specifies group of nodes within a cluster.

Name Type Constraints Description
name string helps uniquely identify the node_group
image string image ID from Glance. All instances from this node_group are launched from this image
flavor string OpenStack’s flavor which is applied to all instances from this node_group
node_processes list of strings list of node processes which run on all nodes of this node_group
node_configs list of user_inputs list of configs provided by user. 'general' configs target the whole node. Configs targeting a service affect processes which belong to these services. For example if config targets 'service:mapreduce', it affects process 'jobtracker'.
anti_affinity_group that parameter will be used to control node placement for DN nodes. TBD
count int number of instances in that group
instances list of instances list of created instances


Contains all relevant info about cluster. This object is is provided to the plugin for both cluster creation and scaling. The “Cluster Lifecycle” section below further specifies which fields are filled at which moment

Name Type Constraints Description
name string
plugin string
hadoop_version string
default_image string Glance image ID specified by user. Plugin could use it as a base image for cluster nodes
cluster_configs list of user_inputs list of cluster-wide configs
node_groups list of node_groups


Describes what is wrong with one of the values provided by user.

Name Type Constraints Description
config config
error_message string