From 201e3c133e28acb6dcdeb017389718db0775a748 Mon Sep 17 00:00:00 2001 From: Huan Xie Date: Thu, 27 Aug 2015 12:34:24 +0100 Subject: [PATCH] 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 --- lib/neutron-legacy | 2 +- lib/neutron_plugins/openvswitch_agent | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index c244e5470a..ac99678e66 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -639,7 +639,7 @@ function install_neutron { plugin_dir=$($ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location") # install neutron plugins to dom0 - tar -czf - -C $NEUTRON_DIR/neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/ ./ | + tar -czf - -C $NEUTRON_DIR/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/etc/xapi.d/plugins/ ./ | $ssh_dom0 "tar -xzf - -C $plugin_dir && chmod a+x $plugin_dir/*" fi } diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent index 5a843ffba7..6a333939d0 100644 --- a/lib/neutron_plugins/openvswitch_agent +++ b/lib/neutron_plugins/openvswitch_agent @@ -71,6 +71,9 @@ function neutron_plugin_configure_plugin_agent { # Make a copy of our config for domU sudo cp /$Q_PLUGIN_CONF_FILE "/$Q_PLUGIN_CONF_FILE.domU" + # change domU's config file to STACK_USER + sudo chown $STACK_USER:$STACK_USER /$Q_PLUGIN_CONF_FILE.domU + # Deal with Dom0's L2 Agent: Q_RR_DOM0_COMMAND="$NEUTRON_BIN_DIR/neutron-rootwrap-xen-dom0 $Q_RR_CONF_FILE" @@ -82,7 +85,14 @@ function neutron_plugin_configure_plugin_agent { # Under XS/XCP, the ovs agent needs to target the dom0 # integration bridge. This is enabled by using a root wrapper # that executes commands on dom0 via a XenAPI plugin. + # XenAPI does not support daemon rootwrap now, so set root_helper_daemon empty iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_DOM0_COMMAND" + iniset /$Q_PLUGIN_CONF_FILE agent root_helper_daemon "" + + # Disable minimize polling, so that it can always detect OVS and Port changes + # This is a problem of xenserver + neutron, bug has been reported + # https://bugs.launchpad.net/neutron/+bug/1495423 + iniset /$Q_PLUGIN_CONF_FILE agent minimize_polling False # Set "physical" mapping iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings "physnet1:$FLAT_NETWORK_BRIDGE" @@ -95,10 +105,14 @@ function neutron_plugin_configure_plugin_agent { # Create a bridge "br-$GUEST_INTERFACE_DEFAULT" _neutron_ovs_base_add_bridge "br-$GUEST_INTERFACE_DEFAULT" # Add $GUEST_INTERFACE_DEFAULT to that bridge - sudo ovs-vsctl add-port "br-$GUEST_INTERFACE_DEFAULT" $GUEST_INTERFACE_DEFAULT + sudo ovs-vsctl -- --may-exist add-port "br-$GUEST_INTERFACE_DEFAULT" $GUEST_INTERFACE_DEFAULT + + # Create external bridge and add port + _neutron_ovs_base_add_bridge $PUBLIC_BRIDGE + sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $PUBLIC_INTERFACE_DEFAULT # Set bridge mappings to "physnet1:br-$GUEST_INTERFACE_DEFAULT" - iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT" + iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs bridge_mappings "physnet1:br-$GUEST_INTERFACE_DEFAULT,physnet-ex:$PUBLIC_BRIDGE" # Set integration bridge to domU's iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs integration_bridge $OVS_BRIDGE # Set root wrap