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
This commit is contained in:
Huan Xie 2016-11-16 00:40:32 -08:00
parent c95ca63ae3
commit c608184211
2 changed files with 19 additions and 9 deletions

View File

@ -48,6 +48,21 @@ function configure_nova_hypervisor {
if [ -z "$XENAPI_CONNECTION_URL" ]; then
die $LINENO "XENAPI_CONNECTION_URL is not specified"
fi
# Check os-xenapi plugin is enabled
local plugins="${DEVSTACK_PLUGINS}"
local plugin
local found=0
for plugin in ${plugins//,/ }; do
if [[ "$plugin" = "os-xenapi" ]]; then
found=1
break
fi
done
if [[ $found -ne 1 ]]; then
die $LINENO "os-xenapi plugin is not specified. Please enable this plugin in local.conf"
fi
read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
iniset $NOVA_CONF xenserver connection_url "$XENAPI_CONNECTION_URL"
@ -64,14 +79,6 @@ function configure_nova_hypervisor {
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
xen_functions=`cat $TOP_DIR/tools/xen/functions`
PLUGIN_DIR=`$ssh_dom0 "$xen_functions; set -eux; xapi_plugin_location"`
# install nova plugins to dom0
tar -czf - -C $NOVA_DIR/plugins/xenserver/xenapi/etc/xapi.d/plugins/ ./ |
$ssh_dom0 "tar -xzf - -C $PLUGIN_DIR && chmod a+x $PLUGIN_DIR/*"
# install console logrotate script
tar -czf - -C $NOVA_DIR/tools/xenserver/ rotate_xen_guest_logs.sh |
$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
# install_nova_hypervisor() - Install external components
function install_nova_hypervisor {
pip_install_gr xenapi
# xenapi functionality is now included in os-xenapi library which houses the plugin
# so this function intentionally left blank
:
}
# start_nova_hypervisor - Start any required external services

View File

@ -101,6 +101,7 @@ set +u
## Note that the lines below are coming from stackrc to support
## new-style config files
source $RC_DIR/functions-common
# allow local overrides of env variables, including repo config
if [[ -f $RC_DIR/localrc ]]; then