Skip to content

Commit b480272

Browse files
committed
B #6772: Additional fix Host NUMA nodes after VM migration
Signed-off-by: Kristian Feldsam <[email protected]>
1 parent 305b33e commit b480272

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/lcm/LifeCycleActions.cc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,11 @@ void LifeCycleManager::trigger_migrate(int vid, const RequestAttributes& ra,
350350

351351
if ( vm->get_hid() != vm->get_previous_hid() )
352352
{
353-
hpool->del_capacity(vm->get_previous_hid(), sr);
353+
HostShareCapacity prev_sr;
354+
Template tmpl;
355+
vm->get_previous_capacity(prev_sr, tmpl);
356+
357+
hpool->del_capacity(vm->get_previous_hid(), prev_sr);
354358

355359
vm->release_previous_vnc_port();
356360
}
@@ -1038,6 +1042,8 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose,
10381042
int& image_id, int uid, int gid, int req_id, Template& quota_tmpl)
10391043
{
10401044
HostShareCapacity sr;
1045+
HostShareCapacity prev_sr;
1046+
Template tmpl;
10411047

10421048
time_t the_time = time(0);
10431049

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

1254+
vm->get_previous_capacity(prev_sr, tmpl);
1255+
12481256
vm->set_previous_etime(the_time);
12491257
vm->set_previous_vm_info();
12501258
vm->set_previous_running_etime(the_time);
12511259

1252-
hpool->del_capacity(vm->get_previous_hid(), sr);
1260+
hpool->del_capacity(vm->get_previous_hid(), prev_sr);
12531261

12541262
vmpool->update_previous_history(vm);
12551263

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

1279+
vm->get_previous_capacity(prev_sr, tmpl);
1280+
12711281
vm->set_previous_etime(the_time);
12721282
vm->set_previous_vm_info();
12731283
vm->set_previous_running_etime(the_time);
12741284

1275-
hpool->del_capacity(vm->get_previous_hid(), sr);
1285+
hpool->del_capacity(vm->get_previous_hid(), prev_sr);
12761286

12771287
vmpool->update_previous_history(vm);
12781288

src/lcm/LifeCycleStates.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ void LifeCycleManager::trigger_deploy_success(int vid)
290290

291291
vm->set_running_stime(the_time);
292292

293+
Template tmpl;
294+
vm->get_previous_capacity(sr, tmpl);
295+
293296
vmpool->update_history(vm.get());
294297

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

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

301-
vm->get_capacity(sr);
302-
303304
hpool->del_capacity(vm->get_previous_hid(), sr);
304305

305306
vm->set_state(VirtualMachine::RUNNING);

0 commit comments

Comments
 (0)