Skip to content

Commit

Permalink
B OpenNebula#6772: Additional fix Host NUMA nodes after VM migration
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
  • Loading branch information
feldsam committed Dec 20, 2024
1 parent 305b33e commit 5988ca9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
16 changes: 13 additions & 3 deletions src/lcm/LifeCycleActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ void LifeCycleManager::trigger_migrate(int vid, const RequestAttributes& ra,

if ( vm->get_hid() != vm->get_previous_hid() )
{
hpool->del_capacity(vm->get_previous_hid(), sr);
HostShareCapacity prev_sr;
Template tmpl;
vm->get_previous_capacity(prev_sr, tmpl);

hpool->del_capacity(vm->get_previous_hid(), prev_sr);

vm->release_previous_vnc_port();
}
Expand Down Expand Up @@ -1038,6 +1042,8 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose,
int& image_id, int uid, int gid, int req_id, Template& quota_tmpl)
{
HostShareCapacity sr;
HostShareCapacity prev_sr;
Template tmpl;

time_t the_time = time(0);

Expand Down Expand Up @@ -1245,11 +1251,13 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose,
case VirtualMachine::MIGRATE:
vm->set_running_etime(the_time);

vm->get_previous_capacity(prev_sr, tmpl);

vm->set_previous_etime(the_time);
vm->set_previous_vm_info();
vm->set_previous_running_etime(the_time);

hpool->del_capacity(vm->get_previous_hid(), sr);
hpool->del_capacity(vm->get_previous_hid(), prev_sr);

vmpool->update_previous_history(vm);

Expand All @@ -1268,11 +1276,13 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose,
case VirtualMachine::SAVE_MIGRATE:
vm->set_running_etime(the_time);

vm->get_previous_capacity(prev_sr, tmpl);

vm->set_previous_etime(the_time);
vm->set_previous_vm_info();
vm->set_previous_running_etime(the_time);

hpool->del_capacity(vm->get_previous_hid(), sr);
hpool->del_capacity(vm->get_previous_hid(), prev_sr);

vmpool->update_previous_history(vm);

Expand Down
25 changes: 13 additions & 12 deletions src/lcm/LifeCycleStates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ void LifeCycleManager::start_prolog_migrate(VirtualMachine* vm)

vm->set_state(VirtualMachine::PROLOG_MIGRATE);

vm->set_previous_etime(the_time);

vm->set_previous_running_etime(the_time);

vmpool->update_previous_history(vm);

vm->set_prolog_stime(the_time);

vmpool->update_history(vm);

if ( vm->get_hid() != vm->get_previous_hid() )
{
Template tmpl;
Expand All @@ -64,6 +54,16 @@ void LifeCycleManager::start_prolog_migrate(VirtualMachine* vm)
vm->release_previous_vnc_port();
}

vm->set_previous_etime(the_time);

vm->set_previous_running_etime(the_time);

vmpool->update_previous_history(vm);

vm->set_prolog_stime(the_time);

vmpool->update_history(vm);

vmpool->update(vm);

//----------------------------------------------------
Expand Down Expand Up @@ -290,6 +290,9 @@ void LifeCycleManager::trigger_deploy_success(int vid)

vm->set_running_stime(the_time);

Template tmpl;
vm->get_previous_capacity(sr, tmpl);

vmpool->update_history(vm.get());

vm->set_previous_etime(the_time);
Expand All @@ -298,8 +301,6 @@ void LifeCycleManager::trigger_deploy_success(int vid)

vmpool->update_previous_history(vm.get());

vm->get_capacity(sr);

hpool->del_capacity(vm->get_previous_hid(), sr);

vm->set_state(VirtualMachine::RUNNING);
Expand Down

0 comments on commit 5988ca9

Please sign in to comment.