-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check agent liveness while migrating #31
Check agent liveness while migrating #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally +1, just a question.
files/default/neutron-ha-tool.py
Outdated
errors += 1 | ||
if fail_fast: | ||
break | ||
elif migration_result.skipped: | ||
return (migrations, errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to log something here?
Given that now we have multiple scripts, it makes sense to introduce a test runner. nosetests seems to support our weird file namings, so using that. It picked up signal_tester as a testcase, so that has been renamed. Also amended travis, and added noqa for some flake8 violations. (cherry picked from commit b1d6f84)
Checking the agent liveness and migrating the agents are two separate calls of neutron-ha-tool. It does not make sense to print out what would be the target agent on checking, because: - the choice is random - the router distribution might change between two calls Therefore removing the misleading statements, and just listing routers to be migrated.
Add some unit tests to cover existing functionality of that method.
`migrate_router_safely` method returned a boolean that indicated the success of the migration. Given that we want to put a check on agent liveness to the method, it will be possible that the migration will be skipped if the agent is alive, thus the return value needs to represent that fact as well. By making the method return an object, multiple return values can be added.
When migrating routers away, make sure that the migration is skipped if the agent is already back on it's feet.
When we skipped migrating a router, that means that the agent has came back alive, so there is no need to call the migration for the rest of the routers on that specific agent.
This makes it easier to understand what the tool did, especially in the case when the agent became online in the meanwhile.
Re-basing and adding the change... |
@vuntz Added a separate commit for adding the log messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This change makes sure that agent liveness is checked before migrating a router in
l3-agent-migrate
mode.Please note that the first commit is part of another PR (#30) as well (a small cleanup commit)