Merge "XenAPI: Use XenServer DevStack plugins"

This commit is contained in:
Jenkins 2017-01-10 22:42:53 +00:00 committed by Gerrit Code Review
commit 19efc1e6c6
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 if [ -z "$XENAPI_CONNECTION_URL" ]; then
die $LINENO "XENAPI_CONNECTION_URL is not specified" die $LINENO "XENAPI_CONNECTION_URL is not specified"
fi 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." read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver" iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
iniset $NOVA_CONF xenserver connection_url "$XENAPI_CONNECTION_URL" iniset $NOVA_CONF xenserver connection_url "$XENAPI_CONNECTION_URL"
@ -64,14 +79,6 @@ function configure_nova_hypervisor {
local ssh_dom0 local ssh_dom0
ssh_dom0="sudo -u $DOMZERO_USER ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@$dom0_ip" 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 # install console logrotate script
tar -czf - -C $NOVA_DIR/tools/xenserver/ rotate_xen_guest_logs.sh | 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' $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 # install_nova_hypervisor() - Install external components
function install_nova_hypervisor { 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 # 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 ## Note that the lines below are coming from stackrc to support
## new-style config files ## new-style config files
source $RC_DIR/functions-common
# allow local overrides of env variables, including repo config # allow local overrides of env variables, including repo config
if [[ -f $RC_DIR/localrc ]]; then if [[ -f $RC_DIR/localrc ]]; then