Add flag live migration#459
Conversation
This flag is needed for both cases:
- when the entire hypervisor.drain workflow is executed
- when only the server.migrate action is executed
Because of that, we need to add the flag in the YAML
configuration file for both Actions (hypervisor.drain and
server.migrate), and also in the Orchesta YAML configuration that
connects those two Actions.
The behavior of this flag is as follows:
* only affects the migration of ACTIVE Servers. If the Server is already
SHUTOFF, an unconditional Cold Migration will be performed
* for ACTIVE Servers
* if the flag is set to True (default value), then a Live Migration
will be attempted
* if the flag is set to False, a Cold Migration will be performed
4597c50 to
d76ebcc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #459 +/- ##
=======================================
Coverage 99.19% 99.19%
=======================================
Files 112 112
Lines 2726 2737 +11
Branches 338 339 +1
=======================================
+ Hits 2704 2715 +11
Misses 19 19
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f4ed702 to
2a84329
Compare
|
Notes from testing: To fix:
To note (gotchas):
Test cases that worked:
|
We decide whether a Live Migration or a Cold Migration is performed on ACTIVE Servers based on the value of the new flag "live_migration". SHUTOFF Servers are still handled with a Cold Migration. Some refactoring to make the code more readable: * the step for both Live Migration and Cold Migration have been moved to their own functions * the check for Servers in a status different than ACTIVE and SHUTOFF has been moved outside the original can_be_migrated() function and moved into the new decision tree. This way, the can_be_migrated() function only checks the properties of the Server's Flavor.
2a84329 to
640c19b
Compare
|
@jose-caballero could you look at:
This should check for GPU or error before we do any steps - it's likely a bug in the existing implementation too I'm currently looking at the endless wait if it fails:
|
0a7ddf7 to
48094bf
Compare
Noticed while testing cold migration. Openstack's wait for status does not allow us to specify invalid states. This means if we ask for it to go to "VERIFY_RESIZE" it will spend the entire timeout (previously 1 hour) waiting. Instead we should check the migration status for the error (as the VM will appear ACTIVE/SHUTDOWN the entire time unless there's a serious error), then confirm the VM moves to VERIFY_RESIZE on the happy path. Add some extra test cases in-case we ever have it a VM completes a migration but somehow ends up ACTIVE or ERROR when the migration is finished. This is extremely unlikely, but play defensive in this case.
48094bf to
5e00a96
Compare
|
Fixed the hang - need to be careful we both fetch before editing or rebasing from this point
I haven't made a start so if you beat me to it tomorrow feel free to push another commit onto this, then I think we're good to retest and maybe even |
Skips any migration steps, as we would previously take a snapshot - force the user to wait for multiple hours then fail when we knew up-front it wouldn't work. Instead provide rapid feedback that we can't do an error state or we can't migrate before doing any work
#461 after this is reviewed + merged
This now correctly works There's a separate bug where if the most recent migration goes into error it will re-migrate but incorrectly pick up on that previous error now we've got stricter checking. We'll need to do another PR for that but it's not a regression from this work since it would error before too.... And the migrations with enough space still work, so I'm going to mark it as tested on dev |
DavidFair
left a comment
There was a problem hiding this comment.
Approved for Jose's work
@jose-caballero should review and approve mine with a comment (can't approve own PR) then we just need a second reviewer to merge
BUG: Skip any migration or snapshot steps if we're in an invalid state
…migration Revert "BUG: Skip any migration or snapshot steps if we're in an invalid state"
…migration Revert "BUG: Skip any migration or snapshot steps if we're in an invalid state"
DavidFair
left a comment
There was a problem hiding this comment.
Right take 2 - approved pending a second reviewer....
Description:
Special Notes:
Submitter:
Have you (where applicable):
Reviewer
Does this PR:
libdirectory?liblayers?