Browse code

XenAPI: Use XenServer DevStack plugins

Hypervisor XenServer will change to use os-xenapi in the future,
this will need DevStack changes, this patch is to remove install
Dom0 plugins part to our own DevStack plugins.

Change-Id: Ic327135b893a77672fd42af919f47f181e932773

Huan Xie authored on 2016/11/16 17:40:32
Showing 2 changed files
... ...
@@ -48,6 +48,21 @@ function configure_nova_hypervisor {
48 48
     if [ -z "$XENAPI_CONNECTION_URL" ]; then
49 49
         die $LINENO "XENAPI_CONNECTION_URL is not specified"
50 50
     fi
51
+
52
+    # Check os-xenapi plugin is enabled
53
+    local plugins="${DEVSTACK_PLUGINS}"
54
+    local plugin
55
+    local found=0
56
+    for plugin in ${plugins//,/ }; do
57
+        if [[ "$plugin" = "os-xenapi" ]]; then
58
+            found=1
59
+            break
60
+        fi
61
+    done
62
+    if [[ $found -ne 1 ]]; then
63
+        die $LINENO "os-xenapi plugin is not specified. Please enable this plugin in local.conf"
64
+    fi
65
+
51 66
     read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
52 67
     iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
53 68
     iniset $NOVA_CONF xenserver connection_url "$XENAPI_CONNECTION_URL"
... ...
@@ -64,14 +79,6 @@ function configure_nova_hypervisor {
64 64
     local ssh_dom0
65 65
     ssh_dom0="sudo -u $DOMZERO_USER ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$dom0_ip"
66 66
 
67
-    # Find where the plugins should go in dom0
68
-    xen_functions=`cat $TOP_DIR/tools/xen/functions`
69
-    PLUGIN_DIR=`$ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location"`
70
-
71
-    # install nova plugins to dom0
72
-    tar -czf - -C $NOVA_DIR/plugins/xenserver/xenapi/etc/xapi.d/plugins/ ./ |
73
-        $ssh_dom0 "tar -xzf - -C $PLUGIN_DIR && chmod a+x $PLUGIN_DIR/*"
74
-
75 67
     # install console logrotate script
76 68
     tar -czf - -C $NOVA_DIR/tools/xenserver/ rotate_xen_guest_logs.sh |
77 69
         $ssh_dom0 'tar -xzf - -C /root/ && chmod +x /root/rotate_xen_guest_logs.sh && mkdir -p /var/log/xen/guest'
... ...
@@ -107,7 +114,9 @@ CRONTAB
107 107
 
108 108
 # install_nova_hypervisor() - Install external components
109 109
 function install_nova_hypervisor {
110
-    pip_install_gr xenapi
110
+    # xenapi functionality is now included in os-xenapi library which houses the plugin
111
+    # so this function intentionally left blank
112
+    :
111 113
 }
112 114
 
113 115
 # start_nova_hypervisor - Start any required external services
... ...
@@ -101,6 +101,7 @@ set +u
101 101
 
102 102
 ## Note that the lines below are coming from stackrc to support
103 103
 ## new-style config files
104
+source $RC_DIR/functions-common
104 105
 
105 106
 # allow local overrides of env variables, including repo config
106 107
 if [[ -f $RC_DIR/localrc ]]; then