mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
bug #3212: Only move VMs to poweroff it they have been successfully monitored at least once.
This commit is contained in:
parent
fa988411d6
commit
a3ef8a0375
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user