1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Merge branch 'master' of git.opennebula.org:one

This commit is contained in:
Daniel Molina 2011-08-18 12:44:30 +02:00
commit b58bb3f5ba
9 changed files with 48 additions and 12 deletions

View File

@ -34,12 +34,14 @@ public:
HostPool * _hpool,
time_t _timer_period,
time_t _monitor_period,
int _host_limit,
const string& _remotes_location,
vector<const Attribute*>& _mads)
:MadManager(_mads),
hpool(_hpool),
timer_period(_timer_period),
monitor_period(_monitor_period),
host_limit(_host_limit),
remotes_location(_remotes_location)
{
am.addListener(this);
@ -98,6 +100,11 @@ private:
*/
time_t monitor_period;
/**
* Host monitoring limit
*/
int host_limit;
/**
* Path for the remote action programs
*/

View File

@ -37,6 +37,7 @@ public:
HostPool * _hpool,
time_t _timer_period,
time_t _poll_period,
int _vm_limit,
vector<const Attribute*>& _mads);
~VirtualMachineManager(){};
@ -118,6 +119,11 @@ private:
*/
time_t poll_period;
/**
* Virtual Machine polling limit
*/
int vm_limit;
/**
* Action engine for the Manager
*/

View File

@ -10,9 +10,11 @@
# than MANAGER_TIMER.
#
# HOST_MONITORING_INTERVAL: Time in seconds between host monitorization.
# HOST_PER_INTERVAL: Number of hosts monitored in each interval.
#
# VM_POLLING_INTERVAL: Time in seconds between virtual machine monitorization.
# (use 0 to disable VM monitoring).
# VM_PER_INTERVAL: Number of VMs monitored in each interval.
#
# VM_DIR: Remote path to store the VM images, it should be shared between all
# the cluster nodes to perform live migrations. This variable is the default
@ -39,17 +41,19 @@
# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
#*******************************************************************************
#MANAGER_TIMER=30
#MANAGER_TIMER = 30
HOST_MONITORING_INTERVAL = 600
#HOST_PER_INTERVAL = 15
VM_POLLING_INTERVAL = 600
#VM_PER_INTERVAL = 5
#VM_DIR=/srv/cloud/one/var
SCRIPTS_REMOTE_DIR=/var/tmp/one
PORT=2633
PORT = 2633
DB = [ backend = "sqlite" ]
@ -63,7 +67,7 @@ DB = [ backend = "sqlite" ]
VNC_BASE_PORT = 5900
DEBUG_LEVEL=3
DEBUG_LEVEL = 3
#*******************************************************************************
# Physical Networks configuration

View File

@ -147,9 +147,6 @@ void InformationManager::timer_action()
Host * host;
istringstream iss;
// -------------- Max. number of hosts to monitor. ---------------------
int host_limit = 15;
mark = mark + timer_period;
if ( mark >= 600 )

View File

@ -93,7 +93,7 @@ public:
time_t _poll_period,
vector<const Attribute*>& _mads):
VirtualMachineManager( _vmpool, _hpool, _timer_period,
_poll_period, _mads){}
_poll_period, 5, _mads){}
void trigger(Actions action, int _vid)
{

View File

@ -339,9 +339,12 @@ void Nebula::start()
{
time_t poll_period;
vector<const Attribute *> vmm_mads;
int vm_limit;
nebula_configuration->get("VM_POLLING_INTERVAL", poll_period);
nebula_configuration->get("VM_PER_INTERVAL", vm_limit);
nebula_configuration->get("VM_MAD", vmm_mads);
vmm = new VirtualMachineManager(
@ -349,6 +352,7 @@ void Nebula::start()
hpool,
timer_period,
poll_period,
vm_limit,
vmm_mads);
}
catch (bad_alloc&)
@ -385,14 +389,18 @@ void Nebula::start()
{
vector<const Attribute *> im_mads;
time_t monitor_period;
int host_limit;
nebula_configuration->get("HOST_MONITORING_INTERVAL", monitor_period);
nebula_configuration->get("HOST_PER_INTERVAL", host_limit);
nebula_configuration->get("IM_MAD", im_mads);
im = new InformationManager(hpool,
timer_period,
monitor_period,
host_limit,
remotes_location,
im_mads);
}

View File

@ -47,7 +47,9 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
# Daemon configuration attributes
#-------------------------------------------------------------------------------
# HOST_MONITORING_INTERVAL
# HOST_PER_INTERVAL
# VM_POLLING_INTERVAL
# VM_PER_INTERVAL
# VM_DIR
# PORT
# DB
@ -61,12 +63,24 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
attribute = new SingleAttribute("HOST_MONITORING_INTERVAL",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// HOST_PER_INTERVAL
value = "15";
attribute = new SingleAttribute("HOST_PER_INTERVAL",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// POLL_INTERVAL
value = "600";
attribute = new SingleAttribute("VM_POLLING_INTERVAL",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// VM_PER_INTERVAL
value = "5";
attribute = new SingleAttribute("VM_PER_INTERVAL",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//VM_DIR
attribute = new SingleAttribute("VM_DIR",var_location);
conf_default.insert(make_pair(attribute->name(),attribute));

View File

@ -71,6 +71,7 @@ VirtualMachineManager* NebulaTest::create_vmm(VirtualMachinePool* vmpool,
hpool,
timer_period,
poll_period,
5,
vmm_mads);
}
@ -90,6 +91,7 @@ InformationManager* NebulaTest::create_im(HostPool* hpool,
return new InformationManager(hpool,
timer_period,
monitor_period,
15,
remotes_location,
im_mads);
}

View File

@ -33,12 +33,14 @@ VirtualMachineManager::VirtualMachineManager(
HostPool * _hpool,
time_t _timer_period,
time_t _poll_period,
int _vm_limit,
vector<const Attribute*>& _mads):
MadManager(_mads),
vmpool(_vmpool),
hpool(_hpool),
timer_period(_timer_period),
poll_period(_poll_period)
poll_period(_poll_period),
vm_limit(_vm_limit)
{
am.addListener(this);
};
@ -822,10 +824,6 @@ void VirtualMachineManager::timer_action()
const VirtualMachineManagerDriver * vmd;
// -------------- Max. number of VMs to monitor. ---------------------
int vm_limit = 5;
mark = mark + timer_period;
if ( mark >= 600 )