M #-: Cooldown period after shutdown a VM

(cherry picked from commit 8f6ce0c025)
This commit is contained in:
Ruben S. Montero committed 2022-01-21 14:40:43 +01:00
1 parent 301c440a58
commit 6a6daef8ac
1 file changed
+10 -2
+10 -2
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);