1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #-: Cooldown period after shutdown a VM

This commit is contained in:
Ruben S. Montero 2022-01-21 14:39:30 +01:00
parent a27bf1562f
commit 8f6ce0c025
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -1120,13 +1120,21 @@ void LifeCycleManager::trigger_monitor_poweron(int vid)
VirtualMachineTemplate quota_tmpl;
string error;
time_t the_time = time(0);
// Prevent Monitor and VMM driver race condition.
// Ignore state updates for 30s after state changes
if ( the_time - vm->get_running_etime() < 30 )
{
vm->log("VMM", Log::INFO, "Ignoring VM state update");
return;
}
int uid = vm->get_uid();
int gid = vm->get_gid();
vm->log("VMM",Log::INFO,"VM found again by the drivers");
time_t the_time = time(0);
vm->set_state(VirtualMachine::ACTIVE);
vm->set_state(VirtualMachine::RUNNING);