Title: New Configuration System Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. [TOC] This page describes a new configuration system that will be added to VCL that can be used to dynamically configure deployed systems. Database schema --------------- config: * id - id of record * name - name of record * ownerid - owner of this record (reference to user.id) * configtypeid - type of record (reference to configtype.id) * data - any data associated with this (ex. puppet manifest) * optional - 0/1 - when this config is mapped to something, can the user specify to apply it or not configtype: * id - id of record * name - name of record * moduleid - id of module that handles this type of record (reference to module.id) > initial types: puppet, subimage, shellcommand, perlfunction, software configvariable: * id - id of record * name - name of record * configid - config this is associated with (reference to config.id) * value - default value of this variable * required - 0/1 - when mapped to something, is this variable always applied * ask - 0/1 - will the user be prompted for a value for this variable, or will the default value always be used * key - string in config.data to replace with the value of this variable * datatype - enum(int, multiint, string) - type of this variable so that the frontend knows how to validate it There are some initial, special names: * subimage - used for clusters, specifies a subimage to be deployed; when deployed, configinstancevariable.value will be reservation.id of the subimage * min - used in conjunction with subimage to specify a minimum number of those subimages * max - used in conjunction with subimage to specify a maximum number of those subimages * runbefore - used to relate to other configs to specify that this should be run before the ones specified in 'value' * runafter - used to relate to other configs to specify that this should be run after the ones specified in 'value' * getdata - ?? configinstance: > This is similar to the config table, but is for deployed systems. * id - id of record * reservationid - reservation this is associated with (references reservation.id) * configid - config entry being applied (references config.id) * status - new/processing/completed?? configinstancevariable: > This is similar to the configvariable table, but is for deployed systems. * configinstanceid - config instance this is associated with (references configinstance.id) * configvariableid - config variable being applied (references configvariable.id) * value - similar to configvariable.value, but can be set by user to different value if configvariable.ask is set to 1 configmap: >This is for mapping configs to various resources or other items in VCL. * configid - config being mapped (references config.id) * subid - id from specific resource table (ex. image.id) * configmaptypeid - type of resource or other item in VCL this is mapped to (references configmaptype.id) * affiliationid - allows configs to only be mapped for a specific affiliation, use the Global affilation to map to all (references affiliation.id) * disabled - 0/1 (a little complicated, normally 0) allows exceptions to a config being applied; set to 1 if a config would be mapped due to a general mapping, but want to disable for a specific instance (ex. if a config is applied for everything deployed by a certain provisioning module, but you don't want it applied for a certain image, you would have an entry in this table mapping it to the provisioning module with disabled set to 0, then you would also have an entry for the image with disabled set to 1) * stage - start_load/post_load/(others?) which stage in the provisioning process where this record should be applied configmaptype: * id - id of this record * name - name of this record Initial types: * image * OStype * provisioning Examples -------- ### Assigning a VLAN to an image This example shows how to assign a VLAN to an image. For this example, we'll use the following values from other tables: * module.id for handling VLAN config type: 67 * image.id for the image in this example: 524 * affiliation.id for the desired affiliation: 6 * reservation.id for the image: 2748 * user.id that owns the configs: 54 configtype:
idnamemoduleid
5VLAN67

config:
idnameowneridconfigtypeiddataoptional
77VLAN 30545300

configvariable:
idnameconfigidvaluerequiredaskkeydatatype
486VLAN773010(empty)int

configmaptype:
idname
1image

configmap:
configidsubidconfigmaptypeidaffiliationiddisabledstage
77524160post_load

configinstance:
idreservationidconfigidstatus
6854274877new

configinstancevariable:
configinstanceidconfigvariableidvalue
685448630
###Hadoop cluster with variable amount of slave nodes This example shows how a hadoop cluster can be requested with 5-10 slave nodes. It can be useful to have the variable amount because 10 nodes may be desired, but you may want to cluster anyway if only 5 nodes are available or if 10 are requested, but 2 of them fail at deploy time. For this example, we'll use the following values from other tables: * module.id for handling subimage config type: 58 * image.id for the Hadoop master image: 453 * image.id for the Hadoop slave image: 454 * affiliation.id for the desired affiliation: 5 * reservation.id for the Hadoop master image: 2351 * reservation.id for the Hadoop slave images: 2352-2361 * user.id that owns the configs: 9 configtype:
idnamemoduleid
2subimage58

config:
idnameowneridconfigtypeiddataoptional
59hadoop cluster92(empty)0

configvariable:
idnameconfigidvaluerequiredaskkeydatatype
146subimage5945410(empty)int
147min59111(empty)int
148max595011(empty)int

configmaptype:
idname
1image

configmap:
configidsubidconfigmaptypeidaffiliationiddisabledstage
59453150start_load

configinstance:
idreservationidconfigidstatus
5023235159new

configinstancevariable:
configinstanceidconfigvariableidvalue
50231462352
50231462353
50231462354
50231462355
50231462356
50231462357
50231462358
50231462359
50231462360
50231462361
50231475
502314810
### SAS cluster This example shows how to configure a SAS cluster of 3 nodes: meta, midtier, and apps so that they are all deployed and then started in the correct order. For this example, we'll use the following values from other tables: * module.id for handling puppet config type: 57 * module.id for handling subimage config type: 58 * module.id for handling shellcommand config type: 59 * image.id for the SAS meta image: 728 * image.id for the SAS midtier image: 729 * image.id for the SAS apps image: 730 * affiliation.id for the desired affiliation: 7 * reservation.id for the SAS meta image: 2466 * reservation.id for the SAS midtier image: 2467 * reservation.id for the SAS apps image: 2468 * user.id that owns the configs: 15 configtype:
idnamemoduleid
1puppet57
2subimage58
3shellcommand59

config:
idnameowneridconfigtypeiddataoptional
76SAS apps152(empty)0
77SAS midtier152(empty)0
78SAS meta config151(puppet manifest)0
79SAS apps config151(puppet manifest)0
80SAS midtier config151(puppet manifest)0
81SAS meta start153(startup commands)0
82SAS apps start153(startup commands)0
83SAS midtier start153(startup commands)0

configvariable:
idnameconfigidvaluerequiredaskkeydatatype
268subimage7672910(empty)int
269subimage7773010(empty)int
270runafter78268,26910(empty)int
271runafter7927010(empty)int
272runafter8027110(empty)int
273runafter8127210(empty)int
274runafter8227310(empty)int
275runafter8327410(empty)int

configmaptype:
idname
1image

configmap:
configidsubidconfigmaptypeidaffiliationiddisabledstage
76728170start_load
77728170start_load
78728170post_load
79728170post_load
80728170post_load
81728170post_load
82728170post_load
83728170post_load

configinstance:
idreservationidconfigidstatus
6005246676new
6006246677new
6007246678new
6008246679new
6009246680new
6010246681new
6011246682new
6012246683new

configinstancevariable:
configinstanceidconfigvariableidvalue
60052682467
60062692468
60072706005,6006
60082716007
60092726008
60102736009
60112746010
60122756011