bug #3212: Only move VMs to poweroff it they have been successfully monitored at least once.

This commit is contained in:
Ruben S. Montero committed 2014-10-10 10:26:16 +02:00
1 parent fa988411d6
commit a3ef8a0375
3 files changed
+15 -3

No files matched your search

+1 -3
View File
@@ -194,8 +194,6 @@ void MonitorThread::do_message()
return;
}
time_t prev_last_monitor = host->get_last_monitored();
rc = host->update_info(tmpl, vm_poll, lost, found, non_shared_ds,
reserved_cpu, reserved_mem);
@@ -241,7 +239,7 @@ void MonitorThread::do_message()
// 3.- It has been monitored at least once
if (vm->hasHistory() &&
vm->get_lcm_state() == VirtualMachine::RUNNING &&
prev_last_monitor <= vm->get_last_poll() )
vm->get_last_poll() != 0)
{
lcm->trigger(LifeCycleManager::MONITOR_POWEROFF, *its);
}
+4
View File
@@ -612,6 +612,8 @@ void LifeCycleManager::restore_action(int vid)
vm->set_stime(the_time);
vm->set_last_poll(0);
vm->set_running_stime(the_time);
vmpool->update_history(vm);
@@ -746,6 +748,8 @@ void LifeCycleManager::restart_action(int vid)
vm->set_stime(the_time);
vm->set_last_poll(0);
vm->set_running_stime(the_time);
vmpool->update_history(vm);
+10
View File
@@ -208,6 +208,8 @@ void LifeCycleManager::save_failure_action(int vid)
vm->set_running_stime(the_time);
vm->set_last_poll(0);
vmpool->update_history(vm);
vm->log("LCM", Log::INFO, "Fail to save VM state while migrating."
@@ -275,6 +277,8 @@ void LifeCycleManager::deploy_success_action(int vid)
vm->set_running_stime(the_time);
vm->set_last_poll(0);
vmpool->update_history(vm);
vm->set_previous_etime(the_time);
@@ -383,6 +387,8 @@ void LifeCycleManager::deploy_failure_action(int vid)
vm->set_running_stime(the_time);
vm->set_last_poll(0);
vmpool->update_history(vm);
vm->log("LCM", Log::INFO, "Fail to live migrate VM."
@@ -713,6 +719,8 @@ void LifeCycleManager::prolog_success_action(int vid)
vm->set_running_stime(the_time);
vm->set_last_poll(0);
vmpool->update_history(vm);
vm->log("LCM", Log::INFO, "New VM state is BOOT");
@@ -1348,6 +1356,8 @@ void LifeCycleManager::monitor_poweron_action(int vid)
vm->set_running_stime(the_time);
vm->set_last_poll(0);
vmpool->update_history(vm);
vm->log("LCM", Log::INFO, "New VM state is RUNNING");