mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
bug #2923: Clean VM monitor when VM_INDIVIDUAL_MONITOR is set to "no" (default)
(cherry picked from commit fbedfdc2a6
)
This commit is contained in:
parent
d2796cca5c
commit
15f596b4aa
@ -37,6 +37,7 @@ public:
|
||||
HostPool * _hpool,
|
||||
time_t _timer_period,
|
||||
time_t _poll_period,
|
||||
bool _do_vm_poll,
|
||||
int _vm_limit,
|
||||
vector<const Attribute*>& _mads);
|
||||
|
||||
@ -131,6 +132,11 @@ private:
|
||||
*/
|
||||
time_t poll_period;
|
||||
|
||||
/**
|
||||
* Perform pro-active VM monitoring
|
||||
*/
|
||||
bool do_vm_poll;
|
||||
|
||||
/**
|
||||
* Virtual Machine polling limit
|
||||
*/
|
||||
|
@ -563,16 +563,14 @@ void Nebula::start(bool bootstrap_only)
|
||||
|
||||
nebula_configuration->get("VM_INDIVIDUAL_MONITORING", do_poll);
|
||||
|
||||
if (do_poll)
|
||||
{
|
||||
poll_period = monitor_period * 2.5;
|
||||
}
|
||||
poll_period = monitor_period * 2.5;
|
||||
|
||||
vmm = new VirtualMachineManager(
|
||||
vmpool,
|
||||
hpool,
|
||||
timer_period,
|
||||
poll_period,
|
||||
do_poll,
|
||||
vm_limit,
|
||||
vmm_mads);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ VirtualMachineManager::VirtualMachineManager(
|
||||
HostPool * _hpool,
|
||||
time_t _timer_period,
|
||||
time_t _poll_period,
|
||||
bool _do_vm_poll,
|
||||
int _vm_limit,
|
||||
vector<const Attribute*>& _mads):
|
||||
MadManager(_mads),
|
||||
@ -41,6 +42,7 @@ VirtualMachineManager::VirtualMachineManager(
|
||||
hpool(_hpool),
|
||||
timer_period(_timer_period),
|
||||
poll_period(_poll_period),
|
||||
do_vm_poll(_do_vm_poll),
|
||||
vm_limit(_vm_limit)
|
||||
{
|
||||
am.addListener(this);
|
||||
@ -63,15 +65,7 @@ extern "C" void * vmm_action_loop(void *arg)
|
||||
|
||||
NebulaLog::log("VMM",Log::INFO,"Virtual Machine Manager started.");
|
||||
|
||||
if ( vmm->poll_period == 0 )
|
||||
{
|
||||
vmm->am.loop(0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
NebulaLog::log("VMM",Log::INFO,"VM monitoring is enabled.");
|
||||
vmm->am.loop(vmm->timer_period,0);
|
||||
}
|
||||
vmm->am.loop(vmm->timer_period, 0);
|
||||
|
||||
NebulaLog::log("VMM",Log::INFO,"Virtual Machine Manager stopped.");
|
||||
|
||||
@ -1507,8 +1501,8 @@ void VirtualMachineManager::timer_action()
|
||||
vmpool->clean_expired_monitoring();
|
||||
|
||||
// Skip monitoring the first poll_period to allow the Host monitoring to
|
||||
// gather the VM info
|
||||
if ( timer_start + poll_period > thetime )
|
||||
// gather the VM info (or if it is disabled)
|
||||
if ( timer_start + poll_period > thetime || !do_vm_poll)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user