Jump to: navigation, search

Difference between revisions of "Sahara/PluggableProvisioning/ClusterLifecycle"

(Created page with "===Cluster Lifecycle for Templates Mode=== The ‘cluster’ object is passed as an argument to several functions. It could be used to both get cluster configuration and chang...")
 
Line 20: Line 20:
 
| black || yes || - || -
 
| black || yes || - || -
 
|-
 
|-
| <span style="color:#778899"> grey </span> || - || - || -
+
| <span style="color:#c0c0c0"> grey </span> || - || - || -
 
|-
 
|-
 
| <u><span style="color:#1E90FF"> underlined blue </span></u> || yes || yes || -
 
| <u><span style="color:#1E90FF"> underlined blue </span></u> || yes || yes || -
Line 35: Line 35:
 
     name
 
     name
 
     plugin_name
 
     plugin_name
     <span style="color:#778899">default_image</span>
+
     <span style="color:#c0c0c0">default_image</span>
     <span style="color:#778899">cluster_configs</span>
+
     <span style="color:#c0c0c0">cluster_configs</span>
 
     <span style="color:#CD5C5C">node_groups:</span>  
 
     <span style="color:#CD5C5C">node_groups:</span>  
 
       <span style="color:#CD5C5C">name</span>
 
       <span style="color:#CD5C5C">name</span>
       <span style="color:#778899">flavor</span>
+
       <span style="color:#c0c0c0">flavor</span>
       <span style="color:#778899">image</span>
+
       <span style="color:#c0c0c0">image</span>
 
       <span style="color:#CD5C5C">node_processes</span>
 
       <span style="color:#CD5C5C">node_processes</span>
       <span style="color:#778899">node_configs</span>
+
       <span style="color:#c0c0c0">node_configs</span>
       <span style="color:#778899">anti_affinity_group</span>
+
       <span style="color:#c0c0c0">anti_affinity_group</span>
 
       <span style="color:#1E90FF">count</span>
 
       <span style="color:#1E90FF">count</span>
       <span style="color:#778899">instances:</span>
+
       <span style="color:#c0c0c0">instances:</span>
         <span style="color:#778899">id</span>
+
         <span style="color:#c0c0c0">id</span>
         <span style="color:#778899">ip</span>
+
         <span style="color:#c0c0c0">ip</span>
         <span style="color:#778899">credentials</span>
+
         <span style="color:#c0c0c0">credentials</span>
 
         <span style="color:#1E90FF">extra</span>
 
         <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>
Line 62: Line 62:
 
       name
 
       name
 
       flavor
 
       flavor
       <span style="color:#778899">image</span>
+
       <span style="color:#c0c0c0">image</span>
 
       node_processes
 
       node_processes
 
       node_configs
 
       node_configs
       <span style="color:#778899">anti_affinity_group</span>
+
       <span style="color:#c0c0c0">anti_affinity_group</span>
 
       count
 
       count
       <span style="color:#778899">instances:</span>
+
       <span style="color:#c0c0c0">instances:</span>
         <span style="color:#778899">id</span>
+
         <span style="color:#c0c0c0">id</span>
         <span style="color:#778899">ip</span>
+
         <span style="color:#c0c0c0">ip</span>
         <span style="color:#778899">credentials</span>
+
         <span style="color:#c0c0c0">credentials</span>
 
         <span style="color:#1E90FF">extra</span>
 
         <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>
Line 87: Line 87:
 
       <u><span style="color:#1E90FF">node_processes</span></u>
 
       <u><span style="color:#1E90FF">node_processes</span></u>
 
       <u><span style="color:#1E90FF">node_configs</span></u>
 
       <u><span style="color:#1E90FF">node_configs</span></u>
       <span style="color:#778899">anti_affinity_group</span>
+
       <span style="color:#c0c0c0">anti_affinity_group</span>
 
       <u><span style="color:#1E90FF">count</span></u>
 
       <u><span style="color:#1E90FF">count</span></u>
       <span style="color:#778899">instances:</span>
+
       <span style="color:#c0c0c0">instances:</span>
         <span style="color:#778899">id</span>
+
         <span style="color:#c0c0c0">id</span>
         <span style="color:#778899">ip</span>
+
         <span style="color:#c0c0c0">ip</span>
         <span style="color:#778899">credentials</span>
+
         <span style="color:#c0c0c0">credentials</span>
 
         <span style="color:#1E90FF">extra</span>
 
         <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>
 
       <span style="color:#1E90FF">extra</span>

Revision as of 14:58, 21 May 2013

Cluster Lifecycle for Templates Mode

The ‘cluster’ object is passed as an argument to several functions. It could be used to both get cluster configuration and change it. During these invocations the object has some fields blank.
validate_cluster(...) and update_infra(...) both receive cluster with the same set of fields set. The validate_cluster(...) must not change the cluster object, while update_infra(...) can (and for some fields must) do some adjustments. Below is the list of fields which will not be set at the time of invocation. All comments stating that plugin can or must adjust some field are for update_infra(...) function only:

  • image - plugin must set that field. It is assumed that plugin set this field to either default_image from parent cluster object or an image obtained from Image Registry.
  • instances. At that point cluster instances are not yet created.

The plugin could completely rewrite node_groups field. It is assumed that the plugin will use this ability to add specs for management nodes if needed or something like that.
configure_cluster(...) and start_cluster(...) both receive ‘cluster’ object with all fields set.

Cluster Lifecycle for Config File Mode

The previous section covered cluster creation with templates. This section elaborates on creating cluster from provider-specific config file.
In this mode, user starts creating cluster with providing provider-specific configuration file. Savanna passes that file to the plugin’s convert(...) method along with empty ‘cluster’ object. Plugin is expected to parse cluster configuration from the file and populate ‘cluster’ object with cluster topology.
After convert(...) returns, Savanna shows the cluster dialog to the user. In the dialog user can change number of nodes and flavors of node groups. See cluster mockups on the wiki for clarity. After user submits the form, the flow goes through the same cycle as for Templates mode, except one thing:
Neither cluster_configs nor node_configs will be provided to the plugin. It is up to the plugin if it uses these fields. Alternatively plugin can save the config file in extra field and use it later.

Cluster Lifecycle Colourgram

Below is the description of Savanna core and plugin’s responsibility for cluster object for each phase of its lifecycle. Color legend for fields:

colour is set modifiable must be specified?
black yes - -
grey - - -
underlined blue yes yes -
blue - yes -
red - yes yes

convert(cluster)

 cluster:
   name
   plugin_name
   default_image
   cluster_configs
   node_groups: 
     name
     flavor
     image
     node_processes
     node_configs
     anti_affinity_group
     count
     instances:
       id
       ip
       credentials
       extra
     extra
   extra

validate_cluster(cluster)

 cluster:
  name
  plugin_name
  default_image
  cluster_configs
   node_groups:
     name
     flavor
     image
     node_processes
     node_configs
     anti_affinity_group
     count
     instances:
       id
       ip
       credentials
       extra
     extra
   extra

update_infra(cluster)

 cluster:
  name
  plugin_name
  default_image
  cluster_configs
   node_groups:
     name
     flavor
     image
     node_processes
     node_configs
     anti_affinity_group
     count
     instances:
       id
       ip
       credentials
       extra
     extra
   extra

configure_cluster(cluster), start_cluster(cluster)

 cluster:
  name
  plugin_name
  default_image
  cluster_configs
   node_groups:
     name
     flavor
     image
     node_processes
     node_configs
     anti_affinity_group
     count
     instances:
       id
       ip
       credentials
       extra
     extra
   extra