Merge "XenAPI:Fix problems to support xenserver+neutron"

This commit is contained in:
Jenkins 2015-11-16 17:24:33 +00:00 committed by Gerrit Code Review
commit 21fee9d160
2 changed files with 17 additions and 3 deletions

View File

@ -638,7 +638,7 @@ function install_neutron {
plugin_dir=$($ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location") plugin_dir=$($ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location")
# install neutron plugins to dom0 # 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/*" $ssh_dom0 "tar -xzf - -C $plugin_dir && chmod a+x $plugin_dir/*"
fi fi
} }

View File

@ -71,6 +71,9 @@ function neutron_plugin_configure_plugin_agent {
# Make a copy of our config for domU # Make a copy of our config for domU
sudo cp /$Q_PLUGIN_CONF_FILE "/$Q_PLUGIN_CONF_FILE.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: # Deal with Dom0's L2 Agent:
Q_RR_DOM0_COMMAND="$NEUTRON_BIN_DIR/neutron-rootwrap-xen-dom0 $Q_RR_CONF_FILE" 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 # Under XS/XCP, the ovs agent needs to target the dom0
# integration bridge. This is enabled by using a root wrapper # integration bridge. This is enabled by using a root wrapper
# that executes commands on dom0 via a XenAPI plugin. # 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 "$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 # Set "physical" mapping
iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings "physnet1:$FLAT_NETWORK_BRIDGE" 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" # Create a bridge "br-$GUEST_INTERFACE_DEFAULT"
_neutron_ovs_base_add_bridge "br-$GUEST_INTERFACE_DEFAULT" _neutron_ovs_base_add_bridge "br-$GUEST_INTERFACE_DEFAULT"
# Add $GUEST_INTERFACE_DEFAULT to that bridge # 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" # 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 # Set integration bridge to domU's
iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs integration_bridge $OVS_BRIDGE iniset "/$Q_PLUGIN_CONF_FILE.domU" ovs integration_bridge $OVS_BRIDGE
# Set root wrap # Set root wrap