XenAPI: move Neutron plugin install to domU

Use the same mechanism as used for nova plugin installation, thus
avoiding the need for variables in dom0. This change will also help to
move XenServer CI to neutron in the future, as the dom0 part of the
script is not executed there.

With this change, the neutron related network will always be created and
attached even if the user wants to use nova-network.

Change-Id: I8669c94e9f0aacce2990469dbabde1ff702a2769
This commit is contained in:
Mate Lakat 2014-10-17 13:09:49 +02:00
parent 33d079bcca
commit 6df648920c
2 changed files with 24 additions and 20 deletions

View File

@ -595,6 +595,24 @@ function init_neutron {
function install_neutron { function install_neutron {
git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
setup_develop $NEUTRON_DIR setup_develop $NEUTRON_DIR
if [ "$VIRT_DRIVER" == 'xenserver' ]; then
local dom0_ip
dom0_ip=$(echo "$XENAPI_CONNECTION_URL" | cut -d "/" -f 3-)
local ssh_dom0
ssh_dom0="sudo -u $DOMZERO_USER ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$dom0_ip"
# Find where the plugins should go in dom0
local xen_functions
xen_functions=$(cat $TOP_DIR/tools/xen/functions)
local plugin_dir
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/ ./ |
$ssh_dom0 "tar -xzf - -C $plugin_dir && chmod a+x $plugin_dir/*"
fi
} }
# install_neutronclient() - Collect source and prepare # install_neutronclient() - Collect source and prepare

View File

@ -65,16 +65,6 @@ EOF
exit 1 exit 1
fi fi
# Install plugins
## Install the netwrap xapi plugin to support agent control of dom0 networking
if [[ "$ENABLED_SERVICES" =~ "q-agt" && "$Q_PLUGIN" = "openvswitch" ]]; then
NEUTRON_ZIPBALL_URL=${NEUTRON_ZIPBALL_URL:-$(zip_snapshot_location $NEUTRON_REPO $NEUTRON_BRANCH)}
EXTRACTED_NEUTRON=$(extract_remote_zipball "$NEUTRON_ZIPBALL_URL")
install_xapi_plugins_from "$EXTRACTED_NEUTRON"
rm -rf "$EXTRACTED_NEUTRON"
fi
# #
# Configure Networking # Configure Networking
# #
@ -88,9 +78,7 @@ setup_network "$PUB_BRIDGE_OR_NET_NAME"
# With neutron, one more network is required, which is internal to the # With neutron, one more network is required, which is internal to the
# hypervisor, and used by the VMs # hypervisor, and used by the VMs
if is_service_enabled neutron; then setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
fi
if parameter_is_specified "FLAT_NETWORK_BRIDGE"; then if parameter_is_specified "FLAT_NETWORK_BRIDGE"; then
if [ "$(bridge_for "$VM_BRIDGE_OR_NET_NAME")" != "$(bridge_for "$FLAT_NETWORK_BRIDGE")" ]; then if [ "$(bridge_for "$VM_BRIDGE_OR_NET_NAME")" != "$(bridge_for "$FLAT_NETWORK_BRIDGE")" ]; then
@ -292,14 +280,12 @@ $THIS_DIR/build_xva.sh "$GUEST_NAME"
# Attach a network interface for the integration network (so that the bridge # Attach a network interface for the integration network (so that the bridge
# is created by XenServer). This is required for Neutron. Also pass that as a # is created by XenServer). This is required for Neutron. Also pass that as a
# kernel parameter for DomU # kernel parameter for DomU
if is_service_enabled neutron; then attach_network "$XEN_INT_BRIDGE_OR_NET_NAME"
attach_network "$XEN_INT_BRIDGE_OR_NET_NAME"
XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME") XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME")
append_kernel_cmdline \ append_kernel_cmdline \
"$GUEST_NAME" \ "$GUEST_NAME" \
"xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}" "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}"
fi
FLAT_NETWORK_BRIDGE="${FLAT_NETWORK_BRIDGE:-$(bridge_for "$VM_BRIDGE_OR_NET_NAME")}" FLAT_NETWORK_BRIDGE="${FLAT_NETWORK_BRIDGE:-$(bridge_for "$VM_BRIDGE_OR_NET_NAME")}"
append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}" append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}"