Browse code

Merge "XenAPI: move Neutron plugin install to domU"

Jenkins authored on 2014/10/31 20:23:29
Showing 2 changed files
... ...
@@ -597,6 +597,24 @@ function init_neutron {
597 597
 function install_neutron {
598 598
     git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
599 599
     setup_develop $NEUTRON_DIR
600
+
601
+    if [ "$VIRT_DRIVER" == 'xenserver' ]; then
602
+        local dom0_ip
603
+        dom0_ip=$(echo "$XENAPI_CONNECTION_URL" | cut -d "/" -f 3-)
604
+
605
+        local ssh_dom0
606
+        ssh_dom0="sudo -u $DOMZERO_USER ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$dom0_ip"
607
+
608
+        # Find where the plugins should go in dom0
609
+        local xen_functions
610
+        xen_functions=$(cat $TOP_DIR/tools/xen/functions)
611
+        local plugin_dir
612
+        plugin_dir=$($ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location")
613
+
614
+        # install neutron plugins to dom0
615
+        tar -czf - -C $NEUTRON_DIR/neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/ ./ |
616
+            $ssh_dom0 "tar -xzf - -C $plugin_dir && chmod a+x $plugin_dir/*"
617
+    fi
600 618
 }
601 619
 
602 620
 # install_neutronclient() - Collect source and prepare
... ...
@@ -65,16 +65,6 @@ EOF
65 65
     exit 1
66 66
 fi
67 67
 
68
-# Install plugins
69
-
70
-## Install the netwrap xapi plugin to support agent control of dom0 networking
71
-if [[ "$ENABLED_SERVICES" =~ "q-agt" && "$Q_PLUGIN" = "openvswitch" ]]; then
72
-    NEUTRON_ZIPBALL_URL=${NEUTRON_ZIPBALL_URL:-$(zip_snapshot_location $NEUTRON_REPO $NEUTRON_BRANCH)}
73
-    EXTRACTED_NEUTRON=$(extract_remote_zipball "$NEUTRON_ZIPBALL_URL")
74
-    install_xapi_plugins_from "$EXTRACTED_NEUTRON"
75
-    rm -rf "$EXTRACTED_NEUTRON"
76
-fi
77
-
78 68
 #
79 69
 # Configure Networking
80 70
 #
... ...
@@ -88,9 +78,7 @@ setup_network "$PUB_BRIDGE_OR_NET_NAME"
88 88
 
89 89
 # With neutron, one more network is required, which is internal to the
90 90
 # hypervisor, and used by the VMs
91
-if is_service_enabled neutron; then
92
-    setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
93
-fi
91
+setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
94 92
 
95 93
 if parameter_is_specified "FLAT_NETWORK_BRIDGE"; then
96 94
     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"
292 292
 # Attach a network interface for the integration network (so that the bridge
293 293
 # is created by XenServer). This is required for Neutron. Also pass that as a
294 294
 # kernel parameter for DomU
295
-if is_service_enabled neutron; then
296
-    attach_network "$XEN_INT_BRIDGE_OR_NET_NAME"
295
+attach_network "$XEN_INT_BRIDGE_OR_NET_NAME"
297 296
 
298
-    XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME")
299
-    append_kernel_cmdline \
300
-        "$GUEST_NAME" \
301
-        "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}"
302
-fi
297
+XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME")
298
+append_kernel_cmdline \
299
+    "$GUEST_NAME" \
300
+    "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}"
303 301
 
304 302
 FLAT_NETWORK_BRIDGE="${FLAT_NETWORK_BRIDGE:-$(bridge_for "$VM_BRIDGE_OR_NET_NAME")}"
305 303
 append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}"