Browse code

XenAPI:Fix problems to support xenserver+neutron

The lack of a CI for XenAPI + Neutron has meant this support has been
broken over time. This is set of one-off fixes that are needed to
reintroduce support while we work towards getting a CI functional

Related-Bug: #1495423
Change-Id: Id41fdc77c155756bda9e2e9ac0446a49f06f0603

Huan Xie authored on 2015/08/27 20:34:24
Showing 2 changed files
... ...
@@ -639,7 +639,7 @@ function install_neutron {
639 639
         plugin_dir=$($ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location")
640 640
 
641 641
         # install neutron plugins to dom0
642
-        tar -czf - -C $NEUTRON_DIR/neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/ ./ |
642
+        tar -czf - -C $NEUTRON_DIR/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/etc/xapi.d/plugins/ ./ |
643 643
             $ssh_dom0 "tar -xzf - -C $plugin_dir && chmod a+x $plugin_dir/*"
644 644
     fi
645 645
 }
... ...
@@ -71,6 +71,9 @@ function neutron_plugin_configure_plugin_agent {
71 71
         # Make a copy of our config for domU
72 72
         sudo cp /$Q_PLUGIN_CONF_FILE "/$Q_PLUGIN_CONF_FILE.domU"
73 73
 
74
+        # change domU's config file to STACK_USER
75
+        sudo chown $STACK_USER:$STACK_USER /$Q_PLUGIN_CONF_FILE.domU
76
+
74 77
         # Deal with Dom0's L2 Agent:
75 78
         Q_RR_DOM0_COMMAND="$NEUTRON_BIN_DIR/neutron-rootwrap-xen-dom0 $Q_RR_CONF_FILE"
76 79
 
... ...
@@ -82,7 +85,14 @@ function neutron_plugin_configure_plugin_agent {
82 82
         # Under XS/XCP, the ovs agent needs to target the dom0
83 83
         # integration bridge.  This is enabled by using a root wrapper
84 84
         # that executes commands on dom0 via a XenAPI plugin.
85
+        # XenAPI does not support daemon rootwrap now, so set root_helper_daemon empty
85 86
         iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_DOM0_COMMAND"
87
+        iniset /$Q_PLUGIN_CONF_FILE agent root_helper_daemon ""
88
+
89
+        # Disable minimize polling, so that it can always detect OVS and Port changes
90
+        # This is a problem of xenserver + neutron, bug has been reported
91
+        # https://bugs.launchpad.net/neutron/+bug/1495423
92
+        iniset /$Q_PLUGIN_CONF_FILE agent minimize_polling False
86 93
 
87 94
         # Set "physical" mapping
88 95
         iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings "physnet1:$FLAT_NETWORK_BRIDGE"
... ...
@@ -95,10 +105,14 @@ function neutron_plugin_configure_plugin_agent {
95 95
         # Create a bridge "br-$GUEST_INTERFACE_DEFAULT"
96 96
         _neutron_ovs_base_add_bridge "br-$GUEST_INTERFACE_DEFAULT"
97 97
         # Add $GUEST_INTERFACE_DEFAULT to that bridge
98
-        sudo ovs-vsctl add-port "br-$GUEST_INTERFACE_DEFAULT" $GUEST_INTERFACE_DEFAULT
98
+        sudo ovs-vsctl -- --may-exist add-port "br-$GUEST_INTERFACE_DEFAULT" $GUEST_INTERFACE_DEFAULT
99
+
100
+        # Create external bridge and add port
101
+        _neutron_ovs_base_add_bridge $PUBLIC_BRIDGE
102
+        sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $PUBLIC_INTERFACE_DEFAULT
99 103
 
100 104
         # Set bridge mappings to "physnet1:br-$GUEST_INTERFACE_DEFAULT"
101
-        iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT"
105
+        iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT,physnet-ex:$PUBLIC_BRIDGE"
102 106
         # Set integration bridge to domU's
103 107
         iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs integration_bridge $OVS_BRIDGE
104 108
         # Set root wrap