From e4289c88c8007ae942a18a1786fc6fd36f2489c7 Mon Sep 17 00:00:00 2001 From: Paul Michali Date: Fri, 14 Aug 2015 11:49:27 -0400 Subject: [PATCH] Prevent spawning two VPN agents Currently, if the VPN devstack plugin is enabled (which is the method used for VPN in all test jobs), there will be two VPN agent processes started. This doesn't seem to affect the tests, but is incorrect. To resolve this, the proposal is to do this in two steps. With this commit, the script is modified to start the q-vpn process, if q-vpn is enabled (legacy), and to only start q-l3 process, if neither q-vpn nor neutron-vpnaas is enabled. Once committed, the opertion will be the same - if no VPN service is enabled, we get q-l3 (correct); if legacy q-vpn is enabled (only), we get q-vpn (correct); if the plugin is used (the default), we get two q-vpn processes started (wrong). With a separate plugin commit (to be pushed next), the plugin will be renamed to neutron-vpnaas, and then we'll get only one agent process (q-vpn or neutron-vpnaas) runing. We can't commit the plugin first, because both the VPN agent and the q-l3 agent will be started at once (just as bad, if not worse). Change-Id: I2bb7ac01e619c8a9b22bd517a4ff60d67035dfed Partial-Bug: 1484141 --- lib/neutron-legacy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 4069439183..01be7cb244 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -730,7 +730,9 @@ function start_neutron_l2_agent { function start_neutron_other_agents { run_process q-dhcp "python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE" - if is_service_enabled q-vpn; then + if is_service_enabled neutron-vpnaas; then + : # Started by plugin + elif is_service_enabled q-vpn; then run_process q-vpn "$AGENT_VPN_BINARY $(determine_config_files neutron-vpn-agent)" else run_process q-l3 "python $AGENT_L3_BINARY $(determine_config_files neutron-l3-agent)"