2008-06-17 20:27:32 +04:00
/* -------------------------------------------------------------------------- */
2013-01-24 19:18:30 +04:00
/* Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs */
2008-06-17 20:27:32 +04:00
/* */
/* Licensed 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. */
/* -------------------------------------------------------------------------- */
# ifndef NEBULA_H_
# define NEBULA_H_
2010-04-11 00:19:49 +04:00
# include "SqlDB.h"
2012-11-30 05:59:26 +04:00
# include "SystemDB.h"
2008-06-17 20:27:32 +04:00
# include "NebulaTemplate.h"
# include "VirtualMachinePool.h"
2008-11-13 19:21:17 +03:00
# include "VirtualNetworkPool.h"
2008-06-17 20:27:32 +04:00
# include "HostPool.h"
2009-07-09 18:34:34 +04:00
# include "UserPool.h"
2011-03-30 21:03:49 +04:00
# include "VMTemplatePool.h"
2011-05-10 20:45:15 +04:00
# include "GroupPool.h"
2012-02-09 20:56:47 +04:00
# include "DatastorePool.h"
2012-02-24 18:53:53 +04:00
# include "ClusterPool.h"
2012-06-08 17:41:59 +04:00
# include "DocumentPool.h"
2008-06-17 20:27:32 +04:00
# include "VirtualMachineManager.h"
# include "LifeCycleManager.h"
# include "InformationManager.h"
# include "TransferManager.h"
# include "DispatchManager.h"
# include "RequestManager.h"
2009-04-04 03:34:33 +04:00
# include "HookManager.h"
2010-07-08 21:28:10 +04:00
# include "AuthManager.h"
2011-06-22 21:22:52 +04:00
# include "AclManager.h"
2011-03-22 20:21:09 +03:00
# include "ImageManager.h"
2008-06-17 20:27:32 +04:00
2012-11-26 15:48:10 +04:00
# include "DefaultQuotas.h"
2012-11-19 18:19:09 +04:00
2011-04-29 20:59:39 +04:00
# include "Callbackable.h"
2012-11-30 05:59:26 +04:00
/**
* This is the main class for the OpenNebula daemon oned . It stores references
* to the main modules and data pools . It also includes functions to bootstrap
* the system and start all its components .
*/
class Nebula
2008-06-17 20:27:32 +04:00
{
public :
2010-04-11 00:19:49 +04:00
static Nebula & instance ( )
2008-06-17 20:27:32 +04:00
{
static Nebula nebulad ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
return nebulad ;
} ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
// --------------------------------------------------------------
// Pool Accessors
2010-04-11 00:19:49 +04:00
// --------------------------------------------------------------
2008-06-17 20:27:32 +04:00
VirtualMachinePool * get_vmpool ( )
{
return vmpool ;
2010-04-11 00:19:49 +04:00
} ;
2008-06-17 20:27:32 +04:00
HostPool * get_hpool ( )
{
return hpool ;
2010-04-11 00:19:49 +04:00
} ;
2008-11-13 19:21:17 +03:00
VirtualNetworkPool * get_vnpool ( )
{
return vnpool ;
} ;
2010-04-11 00:19:49 +04:00
2009-07-09 18:34:34 +04:00
UserPool * get_upool ( )
{
return upool ;
} ;
2008-06-17 20:27:32 +04:00
2010-06-25 15:24:54 +04:00
ImagePool * get_ipool ( )
{
return ipool ;
} ;
2011-05-10 20:45:15 +04:00
GroupPool * get_gpool ( )
{
return gpool ;
} ;
2011-03-30 21:03:49 +04:00
VMTemplatePool * get_tpool ( )
{
return tpool ;
} ;
2012-02-09 20:56:47 +04:00
DatastorePool * get_dspool ( )
{
return dspool ;
} ;
2012-02-24 18:53:53 +04:00
ClusterPool * get_clpool ( )
{
return clpool ;
} ;
2012-06-08 17:41:59 +04:00
DocumentPool * get_docpool ( )
{
return docpool ;
} ;
2008-06-17 20:27:32 +04:00
// --------------------------------------------------------------
// Manager Accessors
2010-04-11 00:19:49 +04:00
// --------------------------------------------------------------
2008-06-17 20:27:32 +04:00
VirtualMachineManager * get_vmm ( )
{
return vmm ;
} ;
LifeCycleManager * get_lcm ( )
{
return lcm ;
} ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
InformationManager * get_im ( )
{
return im ;
} ;
TransferManager * get_tm ( )
{
return tm ;
} ;
DispatchManager * get_dm ( )
{
return dm ;
} ;
2010-04-11 00:19:49 +04:00
2009-04-04 03:34:33 +04:00
HookManager * get_hm ( )
{
return hm ;
} ;
2010-04-11 00:19:49 +04:00
2010-07-08 21:28:10 +04:00
AuthManager * get_authm ( )
{
return authm ;
} ;
2011-03-22 20:21:09 +03:00
ImageManager * get_imagem ( )
{
return imagem ;
} ;
2011-06-22 21:22:52 +04:00
AclManager * get_aclm ( )
{
return aclm ;
} ;
2008-06-17 20:27:32 +04:00
// --------------------------------------------------------------
// Environment & Configuration
2009-01-02 17:58:51 +03:00
// --------------------------------------------------------------
2010-04-11 00:19:49 +04:00
2012-04-03 20:02:14 +04:00
/**
2013-01-31 23:43:17 +04:00
* Returns the value of LOG - > DEBUG_LEVEL in oned . conf file
2012-04-03 20:02:14 +04:00
* @ return the debug level , to instantiate Log ' ers
*/
Log : : MessageType get_debug_level ( ) const
{
2013-01-31 23:43:17 +04:00
Log : : MessageType clevel = Log : : ERROR ;
vector < const Attribute * > logs ;
int rc ;
int log_level_int ;
2012-04-03 20:02:14 +04:00
2013-01-31 23:43:17 +04:00
rc = nebula_configuration - > get ( " LOG " , logs ) ;
2012-04-03 20:02:14 +04:00
2013-01-31 23:43:17 +04:00
if ( rc ! = 0 )
2012-04-03 20:02:14 +04:00
{
2013-01-31 23:43:17 +04:00
string value ;
const VectorAttribute * log = static_cast < const VectorAttribute * >
( logs [ 0 ] ) ;
value = log - > vector_value ( " DEBUG_LEVEL " ) ;
log_level_int = atoi ( value . c_str ( ) ) ;
2013-07-16 18:51:40 +04:00
if ( Log : : ERROR < = log_level_int & & log_level_int < = Log : : DDDEBUG )
2013-01-31 23:43:17 +04:00
{
clevel = static_cast < Log : : MessageType > ( log_level_int ) ;
}
2012-04-03 20:02:14 +04:00
}
return clevel ;
}
2013-01-31 23:43:17 +04:00
/**
* Returns the value of LOG - > SYSTEM in oned . conf file
2013-02-01 21:49:03 +04:00
* @ return the logging system CERR , FILE_TS or SYSLOG
2013-01-31 23:43:17 +04:00
*/
2013-02-01 21:49:03 +04:00
NebulaLog : : LogType get_log_system ( ) const
2013-01-31 23:43:17 +04:00
{
2013-02-01 21:49:03 +04:00
vector < const Attribute * > logs ;
int rc ;
NebulaLog : : LogType log_system = NebulaLog : : UNDEFINED ;
2013-01-31 23:43:17 +04:00
rc = nebula_configuration - > get ( " LOG " , logs ) ;
if ( rc ! = 0 )
{
string value ;
const VectorAttribute * log = static_cast < const VectorAttribute * >
( logs [ 0 ] ) ;
2013-02-01 21:49:03 +04:00
value = log - > vector_value ( " SYSTEM " ) ;
log_system = NebulaLog : : str_to_type ( value ) ;
2013-01-31 23:43:17 +04:00
}
return log_system ;
2013-02-01 21:49:03 +04:00
} ;
2013-01-31 23:43:17 +04:00
2009-01-02 17:58:51 +03:00
/**
2010-04-11 00:19:49 +04:00
* Returns the value of ONE_LOCATION env variable . When this variable is
2009-01-02 17:58:51 +03:00
* not defined the nebula location is " / " .
* @ return the nebula location .
2010-04-11 00:19:49 +04:00
*/
2008-11-13 19:21:17 +03:00
const string & get_nebula_location ( )
2008-06-17 20:27:32 +04:00
{
return nebula_location ;
} ;
2009-01-02 17:58:51 +03:00
/**
2010-04-11 00:19:49 +04:00
* Returns the path where mad executables are stored , if ONE_LOCATION is
* defined this path points to $ ONE_LOCATION / bin , otherwise it is
2009-01-02 17:58:51 +03:00
* / usr / lib / one / mads .
* @ return the mad execs location .
*/
const string & get_mad_location ( )
{
return mad_location ;
} ;
/**
2010-04-11 00:19:49 +04:00
* Returns the path where defaults for mads are stored , if ONE_LOCATION is
2009-01-02 17:58:51 +03:00
* defined this path points to $ ONE_LOCATION / etc , otherwise it is / etc / one
* @ return the mad defaults location .
*/
const string & get_defaults_location ( )
{
return etc_location ;
} ;
2010-04-11 00:19:49 +04:00
2009-01-02 17:58:51 +03:00
/**
* Returns the path where logs ( oned . log , schedd . log , . . . ) are generated
2010-04-11 00:19:49 +04:00
* if ONE_LOCATION is defined this path points to $ ONE_LOCATION / var ,
2009-01-02 17:58:51 +03:00
* otherwise it is / var / log / one .
* @ return the log location .
*/
const string & get_log_location ( )
{
return log_location ;
} ;
/**
2012-02-25 02:13:22 +04:00
* Returns the default var location . When ONE_LOCATION is defined this path
* points to $ ONE_LOCATION / var , otherwise it is / var / lib / one .
2009-01-02 17:58:51 +03:00
* @ return the log location .
*/
const string & get_var_location ( )
{
return var_location ;
} ;
2010-04-11 00:19:49 +04:00
2012-10-28 22:19:57 +04:00
/**
* Returns the default vms location . When ONE_LOCATION is defined this path
* points to $ ONE_LOCATION / var / vms , otherwise it is / var / lib / one / vms . This
* location stores vm related files : deployment , transfer , context , and
* logs ( in self - contained mode only )
* @ return the vms location .
*/
const string & get_vms_location ( )
{
return vms_location ;
} ;
2009-01-02 17:58:51 +03:00
/**
* Returns the path of the log file for a VM , depending where OpenNebula is
* installed ,
* $ ONE_LOCATION / var / $ VM_ID / vm . log
* or
* / var / log / one / $ VM_ID . log
* @ return the log location for the VM .
*/
string get_vm_log_filename ( int oid )
{
ostringstream oss ;
2010-04-11 00:19:49 +04:00
2009-01-02 17:58:51 +03:00
if ( nebula_location = = " / " )
{
2010-04-11 00:19:49 +04:00
oss < < log_location < < oid < < " .log " ;
2009-01-02 17:58:51 +03:00
}
else
{
2012-10-28 22:19:57 +04:00
oss < < vms_location < < oid < < " /vm.log " ;
2009-01-02 17:58:51 +03:00
}
2010-04-11 00:19:49 +04:00
2009-01-02 17:58:51 +03:00
return oss . str ( ) ;
} ;
2010-04-11 00:19:49 +04:00
2012-12-24 05:41:17 +04:00
/**
* Returns the name of the host running oned
* @ return the name
*/
2008-11-13 19:21:17 +03:00
const string & get_nebula_hostname ( )
{
return hostname ;
} ;
2010-04-11 00:19:49 +04:00
2012-12-24 05:41:17 +04:00
/**
* Returns the version of oned
* @ return the version
*/
2008-06-17 20:27:32 +04:00
static string version ( )
{
2013-08-06 15:42:57 +04:00
return " OpenNebula 4.3.0 " ;
2008-06-17 20:27:32 +04:00
} ;
2010-04-11 00:19:49 +04:00
2011-07-12 15:54:53 +04:00
static string db_version ( )
2011-04-29 20:59:39 +04:00
{
2013-08-06 15:42:57 +04:00
return " 4.3.0 " ;
2011-07-12 15:54:53 +04:00
}
2011-04-29 20:59:39 +04:00
2012-12-24 05:41:17 +04:00
/**
* Starts all the modules and services for OpenNebula
*/
2008-06-17 20:27:32 +04:00
void start ( ) ;
2010-04-11 00:19:49 +04:00
2013-10-05 23:34:55 +04:00
/**
* Initialize the database
*/
void init ( ) ;
2012-12-24 05:41:17 +04:00
// -----------------------------------------------------------------------
// Configuration attributes (read from oned.conf)
// -----------------------------------------------------------------------
/**
* Gets a configuration attribute for oned
* @ param name of the attribute
* @ param value of the attribute
*/
2008-06-17 20:27:32 +04:00
void get_configuration_attribute (
2010-04-11 00:19:49 +04:00
const char * name ,
2008-06-17 20:27:32 +04:00
string & value ) const
{
string _name ( name ) ;
2010-04-11 00:19:49 +04:00
2012-12-24 05:41:17 +04:00
nebula_configuration - > Template : : get ( _name , value ) ;
2008-06-17 20:27:32 +04:00
} ;
2010-04-11 00:19:49 +04:00
2012-12-24 05:41:17 +04:00
/**
* Gets a configuration attribute for oned , bool version
*/
void get_configuration_attribute (
const char * name ,
bool & value ) const
{
string _name ( name ) ;
nebula_configuration - > Template : : get ( _name , value ) ;
} ;
/**
* Gets an XML document with all of the configuration attributes
* @ return the XML
*/
2012-11-14 15:54:31 +04:00
string get_configuration_xml ( ) const
{
string xml ;
return nebula_configuration - > to_xml ( xml ) ;
} ;
2012-12-24 05:41:17 +04:00
// -----------------------------------------------------------------------
// Default Quotas
// -----------------------------------------------------------------------
/**
* Get the default quotas for OpenNebula users
* @ return the default quotas
*/
2012-11-26 19:12:05 +04:00
const DefaultQuotas & get_default_user_quota ( )
2012-11-19 18:19:09 +04:00
{
return default_user_quota ;
} ;
2012-12-24 05:41:17 +04:00
/**
* Set the default quotas for OpenNebula users
* @ param tmpl template with the default quotas
* @ param error describes the error if any
*
* @ return 0 if success
*/
2012-11-23 19:03:10 +04:00
int set_default_user_quota ( Template * tmpl , string & error )
{
2012-12-24 05:41:17 +04:00
int rc = default_user_quota . set ( tmpl , error ) ;
2012-11-26 21:14:12 +04:00
if ( rc = = 0 )
{
2012-11-30 05:59:26 +04:00
rc = default_user_quota . update ( ) ;
2012-11-26 21:14:12 +04:00
}
return rc ;
2012-11-23 19:03:10 +04:00
} ;
2012-12-24 05:41:17 +04:00
/**
* Get the default quotas for OpenNebula for groups
* @ return the default quotas
*/
2012-11-26 19:12:05 +04:00
const DefaultQuotas & get_default_group_quota ( )
2012-11-19 19:38:39 +04:00
{
return default_group_quota ;
} ;
2012-12-24 05:41:17 +04:00
/**
* Set the default quotas for OpenNebula groups
* @ param tmpl template with the default quotas
* @ param error describes the error if any
*
* @ return 0 if success
*/
2012-11-23 19:03:10 +04:00
int set_default_group_quota ( Template * tmpl , string & error )
{
2012-12-24 05:41:17 +04:00
int rc = default_group_quota . set ( tmpl , error ) ;
2012-11-26 21:14:12 +04:00
if ( rc = = 0 )
{
2012-11-30 05:59:26 +04:00
rc = default_group_quota . update ( ) ;
2012-11-26 21:14:12 +04:00
}
return rc ;
2012-11-23 19:03:10 +04:00
} ;
2012-11-30 05:59:26 +04:00
// -----------------------------------------------------------------------
// System attributes
// -----------------------------------------------------------------------
/**
* Reads a System attribute from the DB
* @ param attr_name name of the attribute
* @ param cb Callback that will receive the attribute in XML
* @ return 0 on success
*/
int select_sys_attribute ( const string & attr_name , string & attr_xml )
{
return system_db - > select_sys_attribute ( attr_name , attr_xml ) ;
} ;
/**
* Writes a system attribute in the database .
* @ param db pointer to the db
* @ return 0 on success
*/
int insert_sys_attribute (
const string & attr_name ,
const string & xml_attr ,
string & error_str )
{
return system_db - > insert_sys_attribute ( attr_name , xml_attr , error_str ) ;
} ;
/**
* Updates the system attribute in the database .
* @ param db pointer to the db
* @ return 0 on success
*/
int update_sys_attribute (
const string & attr_name ,
const string & xml_attr ,
string & error_str )
{
return system_db - > update_sys_attribute ( attr_name , xml_attr , error_str ) ;
} ;
2008-06-17 20:27:32 +04:00
private :
2010-04-11 00:19:49 +04:00
// -----------------------------------------------------------------------
2008-06-17 20:27:32 +04:00
//Constructors and = are private to only access the class through instance
// -----------------------------------------------------------------------
2010-04-11 00:19:49 +04:00
2012-11-19 18:19:09 +04:00
Nebula ( ) : nebula_configuration ( 0 ) ,
2012-11-26 19:12:05 +04:00
default_user_quota ( " DEFAULT_USER_QUOTAS " ,
" /DEFAULT_USER_QUOTAS/DATASTORE_QUOTA " ,
" /DEFAULT_USER_QUOTAS/NETWORK_QUOTA " ,
" /DEFAULT_USER_QUOTAS/IMAGE_QUOTA " ,
" /DEFAULT_USER_QUOTAS/VM_QUOTA " ) ,
default_group_quota ( " DEFAULT_GROUP_QUOTAS " ,
" /DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA " ,
" /DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA " ,
" /DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA " ,
" /DEFAULT_GROUP_QUOTAS/VM_QUOTA " ) ,
2012-11-30 05:59:26 +04:00
system_db ( 0 ) , db ( 0 ) , vmpool ( 0 ) , hpool ( 0 ) , vnpool ( 0 ) ,
upool ( 0 ) , ipool ( 0 ) , gpool ( 0 ) , tpool ( 0 ) , dspool ( 0 ) , clpool ( 0 ) ,
docpool ( 0 ) , lcm ( 0 ) , vmm ( 0 ) , im ( 0 ) , tm ( 0 ) , dm ( 0 ) , rm ( 0 ) , hm ( 0 ) , authm ( 0 ) ,
aclm ( 0 ) , imagem ( 0 )
2009-01-02 17:58:51 +03:00
{
2010-06-25 15:24:54 +04:00
const char * nl = getenv ( " ONE_LOCATION " ) ;
2009-01-02 17:58:51 +03:00
if ( nl = = 0 ) //OpenNebula installed under root directory
{
2010-06-25 15:24:54 +04:00
nebula_location = " / " ;
2010-04-11 00:19:49 +04:00
2010-08-17 02:28:48 +04:00
mad_location = " /usr/lib/one/mads/ " ;
etc_location = " /etc/one/ " ;
log_location = " /var/log/one/ " ;
var_location = " /var/lib/one/ " ;
2010-11-16 14:29:14 +03:00
remotes_location = " /var/lib/one/remotes/ " ;
2012-10-28 22:19:57 +04:00
vms_location = " /var/lib/one/vms/ " ;
2009-01-02 17:58:51 +03:00
}
else
{
2010-06-25 15:24:54 +04:00
nebula_location = nl ;
2010-04-11 00:19:49 +04:00
2010-06-25 15:24:54 +04:00
if ( nebula_location . at ( nebula_location . size ( ) - 1 ) ! = ' / ' )
{
nebula_location + = " / " ;
}
2010-04-11 00:19:49 +04:00
2010-08-17 02:28:48 +04:00
mad_location = nebula_location + " lib/mads/ " ;
etc_location = nebula_location + " etc/ " ;
log_location = nebula_location + " var/ " ;
var_location = nebula_location + " var/ " ;
2010-11-16 14:29:14 +03:00
remotes_location = nebula_location + " var/remotes/ " ;
2012-10-28 22:19:57 +04:00
vms_location = nebula_location + " var/vms/ " ;
2010-04-11 00:19:49 +04:00
}
2009-01-02 17:58:51 +03:00
} ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
~ Nebula ( )
{
if ( vmpool ! = 0 )
{
delete vmpool ;
}
2008-11-13 23:12:52 +03:00
if ( vnpool ! = 0 )
{
delete vnpool ;
}
2008-06-17 20:27:32 +04:00
if ( hpool ! = 0 )
{
delete hpool ;
}
2009-07-09 18:34:34 +04:00
if ( upool ! = 0 )
{
delete upool ;
}
2010-06-25 15:24:54 +04:00
if ( ipool ! = 0 )
{
delete ipool ;
}
2011-05-10 20:45:15 +04:00
if ( gpool ! = 0 )
{
delete gpool ;
}
2011-03-30 21:03:49 +04:00
if ( tpool ! = 0 )
{
delete tpool ;
}
2012-02-10 04:18:46 +04:00
if ( dspool ! = 0 )
{
2012-02-10 16:24:52 +04:00
delete dspool ;
2012-02-10 04:18:46 +04:00
}
2012-02-24 18:53:53 +04:00
if ( clpool ! = 0 )
{
delete clpool ;
}
2012-10-28 22:19:57 +04:00
2012-06-08 17:41:59 +04:00
if ( docpool ! = 0 )
{
delete docpool ;
}
2008-06-17 20:27:32 +04:00
if ( vmm ! = 0 )
{
delete vmm ;
}
if ( lcm ! = 0 )
{
delete lcm ;
}
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
if ( im ! = 0 )
{
delete im ;
}
if ( tm ! = 0 )
{
delete tm ;
}
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
if ( dm ! = 0 )
{
delete dm ;
}
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
if ( rm ! = 0 )
{
delete rm ;
}
2010-04-11 00:19:49 +04:00
2009-04-05 02:07:06 +04:00
if ( hm ! = 0 )
{
delete hm ;
}
2010-04-11 00:19:49 +04:00
2010-07-08 21:28:10 +04:00
if ( authm ! = 0 )
{
delete authm ;
}
2011-06-22 21:22:52 +04:00
if ( aclm ! = 0 )
{
delete aclm ;
}
2011-03-22 20:21:09 +03:00
if ( imagem ! = 0 )
{
delete imagem ;
}
2008-06-17 20:27:32 +04:00
if ( nebula_configuration ! = 0 )
{
delete nebula_configuration ;
}
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
if ( db ! = 0 )
{
delete db ;
}
2012-11-30 05:59:26 +04:00
if ( system_db ! = 0 )
{
delete system_db ;
}
2008-06-17 20:27:32 +04:00
} ;
2010-04-11 00:19:49 +04:00
Nebula & operator = ( Nebula const & ) { return * this ; } ;
2008-06-17 20:27:32 +04:00
// ---------------------------------------------------------------
// Environment variables
// ---------------------------------------------------------------
2010-04-11 00:19:49 +04:00
2009-01-02 17:58:51 +03:00
string nebula_location ;
2010-04-11 00:19:49 +04:00
2009-01-02 17:58:51 +03:00
string mad_location ;
string etc_location ;
string log_location ;
string var_location ;
2010-08-02 13:24:01 +04:00
string hook_location ;
2010-08-17 02:28:48 +04:00
string remotes_location ;
2012-10-28 22:19:57 +04:00
string vms_location ;
2010-08-17 02:28:48 +04:00
2009-01-02 17:58:51 +03:00
string hostname ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
// ---------------------------------------------------------------
// Configuration
// ---------------------------------------------------------------
2012-11-30 05:59:26 +04:00
OpenNebulaTemplate * nebula_configuration ;
2010-04-11 00:19:49 +04:00
2012-11-19 18:19:09 +04:00
// ---------------------------------------------------------------
// Default quotas
// ---------------------------------------------------------------
2012-11-26 15:48:10 +04:00
DefaultQuotas default_user_quota ;
DefaultQuotas default_group_quota ;
2012-11-19 18:19:09 +04:00
2012-11-30 05:59:26 +04:00
// ---------------------------------------------------------------
// The system database
// ---------------------------------------------------------------
SystemDB * system_db ;
2012-11-19 18:19:09 +04:00
2008-06-17 20:27:32 +04:00
// ---------------------------------------------------------------
// Nebula Pools
// ---------------------------------------------------------------
2010-04-11 00:19:49 +04:00
SqlDB * db ;
2008-06-17 20:27:32 +04:00
VirtualMachinePool * vmpool ;
2008-11-13 19:21:17 +03:00
HostPool * hpool ;
VirtualNetworkPool * vnpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2010-06-01 20:00:44 +04:00
ImagePool * ipool ;
2011-05-10 20:45:15 +04:00
GroupPool * gpool ;
2011-03-30 21:03:49 +04:00
VMTemplatePool * tpool ;
2012-02-09 20:56:47 +04:00
DatastorePool * dspool ;
2012-02-24 18:53:53 +04:00
ClusterPool * clpool ;
2012-06-08 17:41:59 +04:00
DocumentPool * docpool ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
// ---------------------------------------------------------------
// Nebula Managers
// ---------------------------------------------------------------
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
LifeCycleManager * lcm ;
VirtualMachineManager * vmm ;
InformationManager * im ;
TransferManager * tm ;
DispatchManager * dm ;
RequestManager * rm ;
2009-04-04 03:34:33 +04:00
HookManager * hm ;
2010-07-08 21:28:10 +04:00
AuthManager * authm ;
2011-06-22 21:22:52 +04:00
AclManager * aclm ;
2011-03-22 20:21:09 +03:00
ImageManager * imagem ;
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
// ---------------------------------------------------------------
// Implementation functions
// ---------------------------------------------------------------
2010-04-11 00:19:49 +04:00
2008-06-17 20:27:32 +04:00
friend void nebula_signal_handler ( int sig ) ;
} ;
# endif /*NEBULA_H_*/