F #1324: Configure update interval of VM monitor data

(cherry picked from commit 047c32025c)
This commit is contained in:
Ruben S. Montero committed 2019-06-12 19:01:12 +02:00
1 parent 25da330dbd
commit 32ccc4501c
2 files changed
+6 -1

No files matched your search

+2
View File
@@ -417,6 +417,7 @@ void OpenNebulaTemplate::set_conf_default()
# MONITORING_INTERVAL_VM
# MONITORING_INTERVAL_MARKET
# MONITORING_INTERVAL_DATASTORE
# MONITORING_INTERVAL_DB_UPDATE
# MONITORING_THREADS
# HOST_PER_INTERVAL
# HOST_MONITORING_EXPIRATION_TIME
@@ -437,6 +438,7 @@ void OpenNebulaTemplate::set_conf_default()
set_conf_single("MONITORING_INTERVAL_VM", "180");
set_conf_single("MONITORING_INTERVAL_MARKET", "600");
set_conf_single("MONITORING_INTERVAL_DATASTORE", "300");
set_conf_single("MONITORING_INTERVAL_DB_UPDATE", "0");
set_conf_single("MONITORING_THREADS", "50");
set_conf_single("HOST_PER_INTERVAL", "15");
set_conf_single("HOST_MONITORING_EXPIRATION_TIME", "43200");
+4 -1
View File
@@ -711,6 +711,7 @@ void VirtualMachineManagerDriver::process_poll(VirtualMachine* vm,
const string& monitor_str)
{
char state;
time_t update_time;
Nebula &ne = Nebula::instance();
@@ -720,8 +721,10 @@ void VirtualMachineManagerDriver::process_poll(VirtualMachine* vm,
/* ---------------------------------------------------------------------- */
/* Update VM info only for VMs in ACTIVE */
/* ---------------------------------------------------------------------- */
ne.get_configuration_attribute("MONITORING_INTERVAL_DB_UPDATE", update_time);
if (vm->get_state() == VirtualMachine::ACTIVE)
if (vm->get_state() == VirtualMachine::ACTIVE && update_time != -1 &&
(time(0) - vm->get_last_poll() > update_time))
{
if (vm->update_info(monitor_str) == 0)
{