Browse code

Separate start/stop control of Neutron L2 agent.

This patch separates out control of the Neutron L2 agent from
starting/stopping the rest of Neutron. This is needed for the same
reason that control of nova-compute was separated out for Nova. When
doing rolling upgrade testing with Grenade, we need to be able to stop
and upgrade everything except the L2 agent, as that is what would be
running on a compute node.

After this is in place, we can update grenade to support a partial
upgrade scenario with Neutron and run it in jenkins to ensure we don't
break live upgrade support of Neutron.

Change-Id: I7eb87fba778aff3e4514813c6232dafa99ee2912
Signed-off-by: Russell Bryant <rbryant@redhat.com>

Russell Bryant authored on 2015/06/09 04:25:43
Showing 1 changed files
... ...
@@ -703,11 +703,10 @@ function start_neutron_service_and_check {
703 703
     fi
704 704
 }
705 705
 
706
-# Start running processes, including screen
707
-function start_neutron_agents {
708
-    # Start up the neutron agents if enabled
706
+# Control of the l2 agent is separated out to make it easier to test partial
707
+# upgrades (everything upgraded except the L2 agent)
708
+function start_neutron_l2_agent {
709 709
     run_process q-agt "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
710
-    run_process q-dhcp "python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
711 710
 
712 711
     if is_provider_network; then
713 712
         sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
... ...
@@ -722,6 +721,10 @@ function start_neutron_agents {
722 722
             sudo route add -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE
723 723
         fi
724 724
     fi
725
+}
726
+
727
+function start_neutron_other_agents {
728
+    run_process q-dhcp "python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
725 729
 
726 730
     if is_service_enabled q-vpn; then
727 731
         run_process q-vpn "$AGENT_VPN_BINARY $(determine_config_files neutron-vpn-agent)"
... ...
@@ -745,8 +748,18 @@ function start_neutron_agents {
745 745
     fi
746 746
 }
747 747
 
748
-# stop_neutron() - Stop running processes (non-screen)
749
-function stop_neutron {
748
+# Start running processes, including screen
749
+function start_neutron_agents {
750
+    # Start up the neutron agents if enabled
751
+    start_neutron_l2_agent
752
+    start_neutron_other_agents
753
+}
754
+
755
+function stop_neutron_l2_agent {
756
+    stop_process q-agt
757
+}
758
+
759
+function stop_neutron_other {
750 760
     if is_service_enabled q-dhcp; then
751 761
         stop_process q-dhcp
752 762
         pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }')
... ...
@@ -761,8 +774,6 @@ function stop_neutron {
761 761
         stop_process q-meta
762 762
     fi
763 763
 
764
-    stop_process q-agt
765
-
766 764
     if is_service_enabled q-lbaas; then
767 765
         neutron_lbaas_stop
768 766
     fi
... ...
@@ -777,6 +788,12 @@ function stop_neutron {
777 777
     fi
778 778
 }
779 779
 
780
+# stop_neutron() - Stop running processes (non-screen)
781
+function stop_neutron {
782
+    stop_neutron_other
783
+    stop_neutron_l2_agent
784
+}
785
+
780 786
 # _move_neutron_addresses_route() - Move the primary IP to the OVS bridge
781 787
 # on startup, or back to the public interface on cleanup
782 788
 function _move_neutron_addresses_route {