diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 42a4d4cb99..c53baeb367 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -1456,7 +1456,8 @@ error_common: void VirtualMachineManager::timer_action() { - static int mark = 0; + static int mark = 0; + static int timer_start = time(0); VirtualMachine * vm; vector oids; @@ -1482,6 +1483,13 @@ void VirtualMachineManager::timer_action() // Clear the expired monitoring records 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 ) + { + return; + } + // Monitor only VMs that hasn't been monitored for 'poll_period' seconds. rc = vmpool->get_running(oids, vm_limit, thetime - poll_period);