From 78fdaed57f252cd248ae1e66013572b82c5e00b7 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 26 May 2008 14:10:50 +0000 Subject: [PATCH] defines a few builtin node tags - more to come later --- db-config | 349 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 195 insertions(+), 154 deletions(-) diff --git a/db-config b/db-config index 6c17325..f36d542 100755 --- a/db-config +++ b/db-config @@ -80,6 +80,196 @@ def main(): AddRoleToPerson(10, admin['person_id']) AddRoleToPerson(20, admin['person_id']) + #################### node tags + default_tag_types = [ + { 'tagname' : 'arch', + 'description' : 'architecture name', + 'category' : 'general', + 'min_role_id' : 40} , + { 'tagname' : 'pldistro', + 'description' : 'PlanetLab distribution', + 'category' : 'general', + 'min_role_id' : 10} , + { 'tagname' : 'fcdistro', + 'description' : 'Linux distribution', + 'category' : 'general', + 'min_role_id' : 10} , + { 'tagname' : 'deployment', + 'description' : 'typically "alpha", "beta", or "production"', + 'category' : 'general', + 'min_role_id' : 10} , + ] + + # Get list of existing tag types + known_tag_types = [tag_type['tagname'] for tag_type in GetNodeTagTypes()] + + # Create/update default slice tag types + for default_tag_type in default_tag_types: + if default_tag_type['tagname'] not in known_tag_types: + AddNodeTagType(default_tag_type) + else: + UpdateNodeTagType(default_tag_type['tagname'], default_tag_type) + + #################### interface settings + + # Setup default slice attribute types + default_setting_types = [ + {'category' : "general", + 'name' : "ifname", + 'description': "Set interface name, instead of eth0 or the like", + 'min_role_id' : 40}, + {'category' : "Multihome", + 'name' : "alias", + 'description': "Specifies that the network is used for multihoming", + 'min_role_id' : 40}, + + {'category' : "hidden", + 'name' : "backdoor", + 'description': "For testing new settings", + 'min_role_id' : 10}, + ] + [ + { "category" : "WiFi", + "name" : x, + "description" : "802.11 %s -- see %s"%(y,z), + "min_role_id" : 40 } for (x,y,z) in [ + ("mode","Mode","iwconfig"), + ("essid","ESSID","iwconfig"), + ("nw","Network Id","iwconfig"), + ("freq","Frequency","iwconfig"), + ("channel","Channel","iwconfig"), + ("sens","sensitivity threshold","iwconfig"), + ("rate","Rate","iwconfig"), + ("key","key","iwconfig key"), + ("key1","key1","iwconfig key [1]"), + ("key2","key2","iwconfig key [2]"), + ("key3","key3","iwconfig key [3]"), + ("key4","key4","iwconfig key [4]"), + ("securitymode","Security mode","iwconfig enc"), + ("iwconfig","Additional parameters to iwconfig","ifup-wireless"), + ("iwpriv","Additional parameters to iwpriv","ifup-wireless"), + ] + ] + + # Get list of existing setting types + setting_types = GetInterfaceSettingTypes() + setting_types = [setting_type['name'] for setting_type in setting_types] + + # Create/update default slice setting types + for default_setting_type in default_setting_types: + if default_setting_type['name'] not in setting_types: + AddInterfaceSettingType(default_setting_type) + else: + UpdateInterfaceSettingType(default_setting_type['name'], default_setting_type) + + #################### slice attributes + + # Setup default slice attribute types + default_attribute_types = [ + # Slice type (only vserver is supported) + {'name': "type", + 'description': "Type of slice (e.g. vserver)", + 'min_role_id': 20}, + + # System slice + {'name': "system", + 'description': "Is a default system slice (1) or not (0 or unset)", + 'min_role_id': 10}, + + # Slice enabled (1) or suspended (0) + {'name': "enabled", + 'description': "Slice enabled (1 or unset) or suspended (0)", + 'min_role_id': 10}, + + # Slice reference image + {'name': "vref", + 'description': "Reference image", + 'min_role_id': 30}, + + # Slice initialization script + {'name': "initscript", + 'description': "Slice initialization script", + 'min_role_id': 10}, + + # CPU share + {'name': "cpu_pct", + 'description': "Reserved CPU percent", + 'min_role_id': 10}, + {'name': "cpu_share", + 'description': "Number of CPU shares", + 'min_role_id': 10}, + + # Bandwidth limits + {'name': "net_min_rate", + 'description': "Minimum bandwidth (kbps)", + 'min_role_id': 10}, + {'name': "net_max_rate", + 'description': "Maximum bandwidth (kbps)", + 'min_role_id': 10}, + {'name': "net_i2_min_rate", + 'description': "Minimum bandwidth over I2 routes (kbps)", + 'min_role_id': 10}, + {'name': "net_i2_max_rate", + 'description': "Maximum bandwidth over I2 routes (kbps)", + 'min_role_id': 10}, + {'name': "net_max_kbyte", + 'description': "Maximum daily network Tx KByte limit.", + 'min_role_id': 10}, + {'name': "net_thresh_kbyte", + 'description': "KByte limit before warning and throttling.", + 'min_role_id': 10}, + {'name': "net_i2_max_kbyte", + 'description': "Maximum daily network Tx KByte limit to I2 hosts.", + 'min_role_id': 10}, + {'name': "net_i2_thresh_kbyte", + 'description': "KByte limit to I2 hosts before warning and throttling.", + 'min_role_id': 10}, + {'name': "net_share", + 'description': "Number of bandwidth shares", + 'min_role_id': 10}, + {'name': "net_i2_share", + 'description': "Number of bandwidth shares over I2 routes", + 'min_role_id': 10}, + + # Disk quota + {'name': "disk_max", + 'description': "Disk quota (1k disk blocks)", + 'min_role_id': 10}, + + # Proper operations + {'name': "proper_op", + 'description': "Proper operation (e.g. bind_socket)", + 'min_role_id': 10}, + + # VServer capabilities + {'name': "capabilities", + 'description': "VServer bcapabilities (separate by commas)", + 'min_role_id': 10}, + + # Vsys + {'name': "vsys", + 'description': "Bind vsys script fd's to a slice's vsys directory.", + 'min_role_id': 10}, + + # CoDemux + {'name': "codemux", + 'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.", + 'min_role_id': 10}, + + ] + + # Get list of existing attribute types + attribute_types = GetSliceAttributeTypes() + attribute_types = [attribute_type['name'] for attribute_type in attribute_types] + + # Create/update default slice attribute types + for default_attribute_type in default_attribute_types: + if default_attribute_type['name'] not in attribute_types: + AddSliceAttributeType(default_attribute_type) + else: + UpdateSliceAttributeType(default_attribute_type['name'], default_attribute_type) + + #################### conf files + # Setup default PlanetLabConf entries default_conf_files = [ # NTP configuration @@ -422,110 +612,8 @@ def main(): conf_file = conf_files[default_conf_file['dest']] UpdateConfFile(conf_file['conf_file_id'], default_conf_file) - # Setup default slice attribute types - default_attribute_types = [ - # Slice type (only vserver is supported) - {'name': "type", - 'description': "Type of slice (e.g. vserver)", - 'min_role_id': 20}, - - # System slice - {'name': "system", - 'description': "Is a default system slice (1) or not (0 or unset)", - 'min_role_id': 10}, - - # Slice enabled (1) or suspended (0) - {'name': "enabled", - 'description': "Slice enabled (1 or unset) or suspended (0)", - 'min_role_id': 10}, - - # Slice reference image - {'name': "vref", - 'description': "Reference image", - 'min_role_id': 30}, - - # Slice initialization script - {'name': "initscript", - 'description': "Slice initialization script", - 'min_role_id': 10}, - - # CPU share - {'name': "cpu_pct", - 'description': "Reserved CPU percent", - 'min_role_id': 10}, - {'name': "cpu_share", - 'description': "Number of CPU shares", - 'min_role_id': 10}, - - # Bandwidth limits - {'name': "net_min_rate", - 'description': "Minimum bandwidth (kbps)", - 'min_role_id': 10}, - {'name': "net_max_rate", - 'description': "Maximum bandwidth (kbps)", - 'min_role_id': 10}, - {'name': "net_i2_min_rate", - 'description': "Minimum bandwidth over I2 routes (kbps)", - 'min_role_id': 10}, - {'name': "net_i2_max_rate", - 'description': "Maximum bandwidth over I2 routes (kbps)", - 'min_role_id': 10}, - {'name': "net_max_kbyte", - 'description': "Maximum daily network Tx KByte limit.", - 'min_role_id': 10}, - {'name': "net_thresh_kbyte", - 'description': "KByte limit before warning and throttling.", - 'min_role_id': 10}, - {'name': "net_i2_max_kbyte", - 'description': "Maximum daily network Tx KByte limit to I2 hosts.", - 'min_role_id': 10}, - {'name': "net_i2_thresh_kbyte", - 'description': "KByte limit to I2 hosts before warning and throttling.", - 'min_role_id': 10}, - {'name': "net_share", - 'description': "Number of bandwidth shares", - 'min_role_id': 10}, - {'name': "net_i2_share", - 'description': "Number of bandwidth shares over I2 routes", - 'min_role_id': 10}, - - # Disk quota - {'name': "disk_max", - 'description': "Disk quota (1k disk blocks)", - 'min_role_id': 10}, - - # Proper operations - {'name': "proper_op", - 'description': "Proper operation (e.g. bind_socket)", - 'min_role_id': 10}, - - # VServer capabilities - {'name': "capabilities", - 'description': "VServer bcapabilities (separate by commas)", - 'min_role_id': 10}, - - # Vsys - {'name': "vsys", - 'description': "Bind vsys script fd's to a slice's vsys directory.", - 'min_role_id': 10}, - - # CoDemux - {'name': "codemux", - 'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.", - 'min_role_id': 10}, - - ] - - # Get list of existing attribute types - attribute_types = GetSliceAttributeTypes() - attribute_types = [attribute_type['name'] for attribute_type in attribute_types] - # Create/update default slice attribute types - for default_attribute_type in default_attribute_types: - if default_attribute_type['name'] not in attribute_types: - AddSliceAttributeType(default_attribute_type) - else: - UpdateSliceAttributeType(default_attribute_type['name'], default_attribute_type) + #################### initscripts # Default Initscripts default_initscripts = [] @@ -547,57 +635,6 @@ def main(): for initscript in default_initscripts: if initscript['name'] not in oldinitscripts: AddInitScript(initscript) - # Setup default slice attribute types - default_setting_types = [ - - {'category' : "general", - 'name' : "ifname", - 'description': "Set interface name, instead of eth0 or the like", - 'min_role_id' : 40}, - {'category' : "Multihome", - 'name' : "alias", - 'description': "Specifies that the network is used for multihoming", - 'min_role_id' : 40}, - - {'category' : "hidden", - 'name' : "backdoor", - 'description': "For testing new settings", - 'min_role_id' : 10}, - ] + [ - { "category" : "WiFi", - "name" : x, - "description" : "802.11 %s -- see %s"%(y,z), - "min_role_id" : 40 } for (x,y,z) in [ - ("mode","Mode","iwconfig"), - ("essid","ESSID","iwconfig"), - ("nw","Network Id","iwconfig"), - ("freq","Frequency","iwconfig"), - ("channel","Channel","iwconfig"), - ("sens","sensitivity threshold","iwconfig"), - ("rate","Rate","iwconfig"), - ("key","key","iwconfig key"), - ("key1","key1","iwconfig key [1]"), - ("key2","key2","iwconfig key [2]"), - ("key3","key3","iwconfig key [3]"), - ("key4","key4","iwconfig key [4]"), - ("securitymode","Security mode","iwconfig enc"), - ("iwconfig","Additional parameters to iwconfig","ifup-wireless"), - ("iwpriv","Additional parameters to iwpriv","ifup-wireless"), - ] - ] - - - # Get list of existing attribute types - setting_types = GetInterfaceSettingTypes() - setting_types = [setting_type['name'] for setting_type in setting_types] - - # Create/update default slice setting types - for default_setting_type in default_setting_types: - if default_setting_type['name'] not in setting_types: - AddInterfaceSettingType(default_setting_type) - else: - UpdateInterfaceSettingType(default_setting_type['name'], default_setting_type) - # Create/update system slices default_slices = [ # PlanetFlow @@ -647,6 +684,9 @@ def main(): if (name, value) not in slice_attributes: AddSliceAttribute(slice['name'], name, value) + + #################### body for messages + installfailed = """ Once the node meets these requirements, please reinitiate the install by visiting: @@ -890,6 +930,7 @@ message, please reply so that we may investigate the problem. if not messages: AddMessage(template) + #################### PCUs ### Setup Initial PCU information pcu_types = [{'model': 'AP79xx', -- 2.43.0