diff --git a/share/etc/oned.conf.template b/share/etc/oned.conf.template index 439c01053c..31d68da491 100644 --- a/share/etc/oned.conf.template +++ b/share/etc/oned.conf.template @@ -82,7 +82,7 @@ MAC_PREFIX = "02:00" # vd KVM virtual disk #******************************************************************************* -IMAGE_REPOSITORY_PATH = [IMAGES_LOCATION] +#IMAGE_REPOSITORY_PATH = /srv/cloud/var/images DEFAULT_IMAGE_TYPE = "OS" DEFAULT_DEVICE_PREFIX = "hd" diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 6d7637e11b..8b28763267 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -241,12 +241,6 @@ void Nebula::start() upool = new UserPool(db); nebula_configuration->get("IMAGE_REPOSITORY_PATH", repository_path); - - if (repository_path.empty()) // Defaults to ONE_LOCATION/var - { - repository_path = var_location; - } - nebula_configuration->get("DEFAULT_IMAGE_TYPE", default_image_type); nebula_configuration->get("DEFAULT_DEVICE_PREFIX", default_device_prefix); diff --git a/src/nebula/NebulaTemplate.cc b/src/nebula/NebulaTemplate.cc index 0e94046082..a38f592fd2 100644 --- a/src/nebula/NebulaTemplate.cc +++ b/src/nebula/NebulaTemplate.cc @@ -31,60 +31,114 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location) { ostringstream os; SingleAttribute * attribute; + VectorAttribute * vattribute; string value; conf_file = etc_location + conf_name; + // MANAGER_TIMER + value = "15"; + + attribute = new SingleAttribute("MANAGER_TIMER",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + +/* +#******************************************************************************* +# Daemon configuration attributes +#------------------------------------------------------------------------------- +# HOST_MONITORING_INTERVAL +# VM_POLLING_INTERVAL +# VM_DIR +# PORT +# DB +# VNC_BASE_PORT +#******************************************************************************* +*/ + // MONITOR_INTERVAL + value = "600"; + + attribute = new SingleAttribute("HOST_MONITORING_INTERVAL",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + // POLL_INTERVAL - value = "300"; - + value = "600"; + attribute = new SingleAttribute("VM_POLLING_INTERVAL",value); conf_default.insert(make_pair(attribute->name(),attribute)); - // MANAGER_TIMER - value = "30"; - - attribute = new SingleAttribute("MANAGER_TIMER",value); - conf_default.insert(make_pair(attribute->name(),attribute)); - - // MONITOR_INTERVAL - value = "300"; - - attribute = new SingleAttribute("HOST_MONITORING_INTERVAL",value); - conf_default.insert(make_pair(attribute->name(),attribute)); - - //XML-RPC Server PORT - value = "2633"; - - attribute = new SingleAttribute("PORT",value); - conf_default.insert(make_pair(attribute->name(),attribute)); - - //VM_DIR + //VM_DIR attribute = new SingleAttribute("VM_DIR",var_location); conf_default.insert(make_pair(attribute->name(),attribute)); - - //MAC_PREFIX - value = "00:01"; - - attribute = new SingleAttribute("MAC_PREFIX",value); + + //XML-RPC Server PORT + value = "2633"; + + attribute = new SingleAttribute("PORT",value); conf_default.insert(make_pair(attribute->name(),attribute)); - //NETWORK_SIZE - value = "254"; - - attribute = new SingleAttribute("NETWORK_SIZE",value); - conf_default.insert(make_pair(attribute->name(),attribute)); + //DB CONFIGURATION + map vvalue; + vvalue.insert(make_pair("BACKEND","sqlite")); - //NETWORK_SIZE + vattribute = new VectorAttribute("DB",vvalue); + conf_default.insert(make_pair(attribute->name(),vattribute)); + + //VNC_BASE_PORT value = "5900"; attribute = new SingleAttribute("VNC_BASE_PORT",value); - conf_default.insert(make_pair(attribute->name(),attribute)); - - //DEBUG_LEVEL - value = Log::WARNING; - - attribute = new SingleAttribute("DEBUG_LEVEL",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + + //XML-RPC Server PORT + value = "2633"; + + attribute = new SingleAttribute("PORT",value); + conf_default.insert(make_pair(attribute->name(),attribute)); +/* +#******************************************************************************* +# Physical Networks configuration +#******************************************************************************* +# NETWORK_SIZE +# MAC_PREFIX +#******************************************************************************* +*/ + //MAC_PREFIX + value = "02:00"; + + attribute = new SingleAttribute("MAC_PREFIX",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + + //NETWORK_SIZE + value = "254"; + + attribute = new SingleAttribute("NETWORK_SIZE",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + +/* +#******************************************************************************* +# Image Repository Configuration +#******************************************************************************* +# IMAGE_REPOSITORY_PATH +# DEFAULT_IMAGE_TYPE +# DEFAULT_DEVICE_PREFIX +#******************************************************************************* +*/ + //IMAGE_REPOSITORY_PATH + value = var_location + "/images"; + + attribute = new SingleAttribute("IMAGE_REPOSITORY_PATH",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + + //DEFAULT_IMAGE_TYPE + value = "OS"; + + attribute = new SingleAttribute("DEFAULT_IMAGE_TYPE",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + + //DEFAULT_DEVICE_PREFIX + value = "hd"; + + attribute = new SingleAttribute("DEFAULT_DEVICE_PREFIX",value); conf_default.insert(make_pair(attribute->name(),attribute)); } @@ -95,31 +149,31 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location) int NebulaTemplate::load_configuration() { char * error = 0; - map::iterator iter, j; + map::iterator iter, j; int rc; - + string aname; Attribute * attr; - + rc = parse(conf_file.c_str(), &error); - + if ( rc != 0 && error != 0) { cout << "\nError while parsing configuration file:\n" << error << endl; free(error); - + return -1; } - + for(iter=conf_default.begin();iter!=conf_default.end();) { aname = iter->first; attr = iter->second; - + j = attributes.find(aname); - + if ( j == attributes.end() ) { attributes.insert(make_pair(aname,attr)); @@ -131,7 +185,7 @@ int NebulaTemplate::load_configuration() conf_default.erase(iter++); } } - + return 0; }