mirror of
https://github.com/OpenNebula/one.git
synced 2025-04-24 14:50:08 +03:00
(cherry picked from commit 3beca2d9d3f3aeb7d81bb277cc5469af73fac337)
This commit is contained in:
parent
4cbd92bd6e
commit
60fb740d1e
@ -701,6 +701,8 @@ public:
|
||||
*/
|
||||
void set_vm_info()
|
||||
{
|
||||
load_monitoring();
|
||||
|
||||
to_xml_extended(history->vm_info, 0);
|
||||
};
|
||||
|
||||
|
@ -1478,6 +1478,8 @@ int DispatchManager::detach(int vid, int disk_id, const RequestAttributes& ra,
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
close_cp_history(vmpool, vm.get(), VMActions::DISK_DETACH_ACTION, ra);
|
||||
|
||||
if ( vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
@ -1767,6 +1769,8 @@ int DispatchManager::attach_nic(int vid, VirtualMachineTemplate* tmpl,
|
||||
action = VMActions::ALIAS_ATTACH_ACTION;
|
||||
}
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
close_cp_history(vmpool, vm.get(), action, ra);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE)
|
||||
@ -1855,6 +1859,8 @@ int DispatchManager::detach_nic(int vid, int nic_id, const RequestAttributes& ra
|
||||
action = VMActions::ALIAS_DETACH_ACTION;
|
||||
}
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
close_cp_history(vmpool, vm.get(), action, ra);
|
||||
|
||||
bool cold_attach = false;
|
||||
@ -2040,6 +2046,8 @@ int DispatchManager::disk_snapshot_revert(int vid, int did, int snap_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
close_cp_history(vmpool, vm.get(), VMActions::DISK_SNAPSHOT_REVERT_ACTION, ra);
|
||||
|
||||
switch (state)
|
||||
|
@ -471,6 +471,11 @@ void InformationManager::_vm_state(unique_ptr<im_msg_t> msg)
|
||||
vmpool->update(vm.get());
|
||||
}
|
||||
|
||||
// Update monitoring date in history record
|
||||
vm->set_vm_info();
|
||||
|
||||
vmpool->update_history(vm.get());
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Apply state changes */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user