Bug #4593

Can't migrate VM after reschedule fom state UNKNOWN

Added by Anton Todorov over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:06/22/2016
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Core & System
Target version:-
Resolution:fixed Pull request:
Affected Versions:OpenNebula 5.0

Description

Hi,

The issue is because in the code path there is no function to close the previous history reason.

here is the patch that solves the issue by properly closing the previous history record on prolog success action:

diff --git a/src/lcm/LifeCycleStates.cc b/src/lcm/LifeCycleStates.cc
index e05d2e7..16b85b7 100644
--- a/src/lcm/LifeCycleStates.cc
+++ b/src/lcm/LifeCycleStates.cc
@@ -682,10 +682,14 @@ void LifeCycleManager::prolog_success_action(int vid)
                     vm->set_state(VirtualMachine::BOOT_MIGRATE);
                     break;

-                case VirtualMachine::PROLOG:
-                case VirtualMachine::PROLOG_FAILURE: //recover success
                 case VirtualMachine::PROLOG_MIGRATE_UNKNOWN:
                 case VirtualMachine::PROLOG_MIGRATE_UNKNOWN_FAILURE: //recover success
+                    vm->set_previous_reason(History::USER);
+                    vm->set_previous_action(History::MIGRATE_ACTION);
+                    vmpool->update_previous_history(vm);
+
+                case VirtualMachine::PROLOG:
+                case VirtualMachine::PROLOG_FAILURE: //recover success
                     action = VirtualMachineManager::DEPLOY;
                     vm->set_state(VirtualMachine::BOOT);
                     break;

I'll update with pull request @GitHub shortly.

Kind Regards,
Anton Todorov

Associated revisions

Revision 58d72568
Added by Anton Todorov over 4 years ago

fix for bug #4593 (#104)

When VM in UNKNOWN state is rescheduled it can not be migrated anymore because a check in VirtualMachineMigrate::request_execute is not satisfied due to previous history record not closed properly.

Revision c637d795
Added by Ruben S. Montero over 4 years ago

bug #4593: Moved history closing to the action, where the capacity is
removed from the host. FAILURE states does not need update

History

#1 Updated by Anton Todorov over 4 years ago

Here is the pull request on GitHub
https://github.com/OpenNebula/one/pull/104

Kind Regards,
Anton Todorov

#2 Updated by Anton Todorov over 4 years ago

Hi,

I can confirm that the latest master does not have the issue.

I think the issue could be closed

Kind Regards,
Anton Todorov

#3 Updated by Ruben S. Montero over 4 years ago

  • Status changed from Pending to Closed
  • Resolution set to fixed

Thanks

Also available in: Atom PDF