Skip to content
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

Merged
merged 7 commits into from
May 16, 2017
Merged

Check agent liveness while migrating #31

merged 7 commits into from
May 16, 2017

Conversation

matelakat
Copy link

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)

Copy link
Member

@vuntz vuntz left a 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.

errors += 1
if fail_fast:
break
elif migration_result.skipped:
return (migrations, errors)
Copy link
Member

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?

Mate Lakat added 7 commits May 15, 2017 15:11
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.
@matelakat
Copy link
Author

Re-basing and adding the change...

@matelakat
Copy link
Author

@vuntz Added a separate commit for adding the log messages.

Copy link

@rhafer rhafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@matelakat matelakat merged commit ebb0e69 into SUSE-Cloud:neutron-ha-tool-maintenance May 16, 2017
@matelakat matelakat deleted the check-agent-liveness-while-migrating branch May 16, 2017 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants