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

v2plugin set forward mode when netmaster up #1058

Merged
merged 4 commits into from
Nov 14, 2017
Merged

Conversation

chrisplo
Copy link
Contributor

Docker expects the netplugin socket to be available within 10 seconds
before it fails enabling (or installing) the v2plugin.

Due to #1043, netplugin is blocking waiting for the forward mode to be
set, which is done by netctl calling netmaster, but netmaster is not
started until the plugin is activating.

Instead of backgrounding the plugin install/enabling then letting
ansible set the forward mode, do it in the plugin script to avoid
ansible's unpredictable round trip delays.

Adds a plugin setting for the forward mode

Drive-by: Logging to stdout and stderr for some commands were not
making it to the logfile, this change redirects all to the logfile

Signed-off-by: Chris Plock chrisplo@cisco.com

Docker expects the netplugin socket to be available within 10 seconds
before it fails enabling (or installing) the v2plugin.

Due to contiv#1043, netplugin is blocking waiting for the forward mode to be
set, which is done by netctl calling netmaster, but netmaster is not
started until the plugin is activating.

Instead of backgrounding the plugin install/enabling then letting
ansible set the forward mode, do it in the plugin script to avoid
ansible's unpredictable round trip delays.

Signed-off-by: Chris Plock <chrisplo@cisco.com>
exit 1
fi
sleep 1
echo "Netmaster ready for connections, setting forward mode to $fwd_mode"
Copy link
Contributor

Choose a reason for hiding this comment

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

a nit, could we exit 1 when $fwd_mode not set ?

},
{
"Description": "Forwarding mode for netplugin",
"Name": "fwd_mode",
Copy link
Contributor

@rchirakk rchirakk Nov 13, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

check if you need to configure Fabric mode(ACI/default) also here

Copy link
Contributor

Choose a reason for hiding this comment

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

it's fine for now about fabric mode

Copy link
Contributor

@rchirakk rchirakk left a comment

Choose a reason for hiding this comment

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

LGTM

fi
sleep 1
echo "Netmaster ready for connections, setting forward mode to $fwd_mode"
/netctl --netmaster http://$control_url global set --fwd-mode "$fwd_mode"
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we need to check if fwd mode has been set or if it's allowed to update, or we can check the return code, if it's 5xx then retry, if it's 2xx or 4xx, it might be good to move on

Copy link
Contributor

Choose a reason for hiding this comment

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

i did testing, the request is idempotent , as long as it's not changing the mode when there's network, we should be good

@chrisplo
Copy link
Contributor Author

build PR

Copy link
Contributor

@tiewei tiewei left a comment

Choose a reason for hiding this comment

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

LGTM

@tiewei tiewei merged commit 92cd1fe into contiv:master Nov 14, 2017
@chrisplo chrisplo deleted the v2_set_fwd branch November 14, 2017 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants