DevStack plugin updates for bionic job
This makes some cleanup changes to the DevStack plugin for the change to master and bionic. * Define values for precedence handling by the upstream devstack playbook * Add STX_INST_DIR for a deterministic install location * Add stx-metal to required plugins * Consolidate all of the is_enabled() handling in the main plugin entrypoint functions in lib/stx-nfv Depends-On: https://review.openstack.org/639858 Change-Id: If9fdc8221443561ed489c38b9006de2f6e9755d7 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
parent
116b10b7c6
commit
5df02e5e08
|
@ -94,6 +94,7 @@
|
||||||
timeout: 7800
|
timeout: 7800
|
||||||
required-projects:
|
required-projects:
|
||||||
- openstack/stx-fault
|
- openstack/stx-fault
|
||||||
|
- openstack/stx-metal
|
||||||
- openstack/stx-update
|
- openstack/stx-update
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: functional
|
tox_envlist: functional
|
||||||
|
@ -126,12 +127,17 @@
|
||||||
q-svc: false
|
q-svc: false
|
||||||
horizon: false
|
horizon: false
|
||||||
# StarlingX services
|
# StarlingX services
|
||||||
|
fm-common: true
|
||||||
|
fm-api: true
|
||||||
|
fm-rest-api: true
|
||||||
|
fm-mgr: true
|
||||||
nfv-common: true
|
nfv-common: true
|
||||||
nfv-vim: true
|
nfv-vim: true
|
||||||
nfv-client: true
|
nfv-client: true
|
||||||
guest-client: true
|
guest-client: true
|
||||||
devstack_plugins:
|
devstack_plugins:
|
||||||
stx-fault: git://git.starlingx.io/stx-fault
|
stx-fault: git://git.starlingx.io/stx-fault
|
||||||
|
stx-metal: git://git.starlingx.io/stx-metal
|
||||||
stx-nfv: git://git.starlingx.io/stx-nfv
|
stx-nfv: git://git.starlingx.io/stx-nfv
|
||||||
stx-update: git://git.starlingx.io/stx-update
|
stx-update: git://git.starlingx.io/stx-update
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# lib/stx-nfv
|
# lib/stx-nfv
|
||||||
# Functions to control the configuration and operation of stx-nfv
|
|
||||||
|
|
||||||
_XTRACE_STX_NFV=$(set +o | grep xtrace)
|
_XTRACE_STX_NFV=$(set +o | grep xtrace)
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
# all
|
# Defaults
|
||||||
STXNFV_DIR=$DEST/stx-nfv
|
# --------
|
||||||
|
|
||||||
|
STXNFV_DIR=${GITDIR[$STX_NFV_NAME]}
|
||||||
STXNFV_SYSCONFDIR=/etc
|
STXNFV_SYSCONFDIR=/etc
|
||||||
STXNFV_OCF_ROOT=/usr/lib/ocf
|
STXNFV_OCF_ROOT=/usr/lib/ocf
|
||||||
|
|
||||||
STX_BIN_DIR=$(get_python_exec_prefix)
|
|
||||||
STX_PREFIX=${STX_BIN_DIR%/*}
|
|
||||||
|
|
||||||
# nfv
|
|
||||||
NFV_DIR=$STXNFV_DIR/nfv
|
NFV_DIR=$STXNFV_DIR/nfv
|
||||||
NFV_CONF_DIR=$STXNFV_SYSCONFDIR/nfv
|
NFV_CONF_DIR=$STXNFV_SYSCONFDIR/nfv
|
||||||
NFV_OCF_DIR=$STXNFV_OCF_ROOT/resource.d/nfv
|
NFV_OCF_DIR=$STXNFV_OCF_ROOT/resource.d/nfv
|
||||||
|
@ -38,51 +35,40 @@ GUEST_CLIENT_VERSION="3.0.1"
|
||||||
|
|
||||||
STX_SDK_DEPLOY_DIR=${STX_SDK_DEPLOY_DIR:-/opt/deploy/cgcs_sdk}
|
STX_SDK_DEPLOY_DIR=${STX_SDK_DEPLOY_DIR:-/opt/deploy/cgcs_sdk}
|
||||||
|
|
||||||
|
# STX_INST_DIR should be a non-root-writable place to install build artifacts
|
||||||
|
STX_INST_DIR=${STX_INST_DIR:-$DEST/usr}
|
||||||
|
STX_BIN_DIR=$STX_INST_DIR/bin
|
||||||
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
# ---------
|
||||||
|
|
||||||
function cleanup_guest_agent {
|
function cleanup_guest_agent {
|
||||||
sudo rm -rf $MTCE_GUEST_OCF_DIR/guestAgent
|
sudo rm -rf $MTCE_GUEST_OCF_DIR/guestAgent
|
||||||
sudo rm -rf $MTCE_GUEST_CONF/guestAgent.ini
|
sudo rm -rf $MTCE_GUEST_CONF/guestAgent.ini
|
||||||
sudo rm -rf $STX_PREFIX/bin/guestAgent
|
sudo rm -rf $STX_INST_DIR/bin/guestAgent
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/init.d/guestAgent
|
sudo rm -rf $STXNFV_SYSCONFDIR/init.d/guestAgent
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/logrotate.d/guestAgent.logrotate
|
sudo rm -rf $STXNFV_SYSCONFDIR/logrotate.d/guestAgent.logrotate
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_guest_client {
|
function cleanup_guest_client {
|
||||||
if is_service_enabled guest-client; then
|
sudo rm -rf $STX_INST_DIR/include/guest-client
|
||||||
sudo rm -rf $STX_PREFIX/include/guest-client
|
sudo rm -rf $STX_SDK_DEPLOY_DIR
|
||||||
sudo rm -rf $STX_SDK_DEPLOY_DIR
|
sudo rm -rf $STXNFV_SYSCONFDIR/systemd/system/guest-client.service
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/systemd/system/guest-client.service
|
sudo rm -rf $STXNFV_SYSCONFDIR/guest-client
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/guest-client
|
sudo rm -rf $STX_INST_DIR/bin/guest-client
|
||||||
sudo rm -rf $STX_PREFIX/bin/guest-client
|
sudo rm -rf $STX_INST_DIR/lib/libguest_common_api.so.$GUEST_CLIENT_VERSION
|
||||||
sudo rm -rf $STX_PREFIX/lib/libguest_common_api.so.$GUEST_CLIENT_VERSION
|
sudo rm -rf $STX_INST_DIR/lib/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION
|
||||||
sudo rm -rf $STX_PREFIX/lib/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_guest_server {
|
function cleanup_guest_server {
|
||||||
sudo rm -rf $MTCE_GUEST_CONF/guestServer.ini
|
sudo rm -rf $MTCE_GUEST_CONF/guestServer.ini
|
||||||
sudo rm -rf $STX_PREFIX/bin/guestServer
|
sudo rm -rf $STX_INST_DIR/bin/guestServer
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/init.d/guestServer
|
sudo rm -rf $STXNFV_SYSCONFDIR/init.d/guestServer
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/pmon.d/guestServer.conf
|
sudo rm -rf $STXNFV_SYSCONFDIR/pmon.d/guestServer.conf
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/logrotate.d/guestServer.logrotate
|
sudo rm -rf $STXNFV_SYSCONFDIR/logrotate.d/guestServer.logrotate
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_mtce_guest {
|
|
||||||
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
|
||||||
pushd $MTCE_GUEST_DIR/src
|
|
||||||
make clean
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
if is_service_enabled guest-agent; then
|
|
||||||
cleanup_guest_agent
|
|
||||||
fi
|
|
||||||
if is_service_enabled guest-server; then
|
|
||||||
cleanup_guest_server
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanup_nfv {
|
function cleanup_nfv {
|
||||||
if is_service_enabled nfv-vim || is_service_enabled nfv-vim-api || is_service_enabled nfv-vim-webserver; then
|
if is_service_enabled nfv-vim || is_service_enabled nfv-vim-api || is_service_enabled nfv-vim-webserver; then
|
||||||
sudo rm -rf $NFV_CONF_DIR
|
sudo rm -rf $NFV_CONF_DIR
|
||||||
|
@ -104,6 +90,27 @@ function cleanup_nfv {
|
||||||
if is_service_enabled nfv-vim-webserver; then
|
if is_service_enabled nfv-vim-webserver; then
|
||||||
sudo rm -rf $STXNFV_SYSCONFDIR/systemd/system/devstack@nfv-vim-webserver.service
|
sudo rm -rf $STXNFV_SYSCONFDIR/systemd/system/devstack@nfv-vim-webserver.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled nova-api-proxy; then
|
||||||
|
cleanup_nova_api_proxy
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-client; then
|
||||||
|
cleanup_guest_client
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
||||||
|
pushd $MTCE_GUEST_DIR/src
|
||||||
|
make clean
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent; then
|
||||||
|
cleanup_guest_agent
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-server; then
|
||||||
|
cleanup_guest_server
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_nfv_client {
|
function cleanup_nfv_client {
|
||||||
|
@ -127,9 +134,7 @@ function cleanup_nfv_vim {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_nova_api_proxy {
|
function cleanup_nova_api_proxy {
|
||||||
if is_service_enabled nova-api-proxy; then
|
pip_uninstall api-proxy
|
||||||
pip_uninstall api-proxy
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_guest_agent {
|
function configure_guest_agent {
|
||||||
|
@ -142,34 +147,25 @@ function configure_guest_server {
|
||||||
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@guest-server.service "Service" "PIDFile" "/var/run/guestServer.pid"
|
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@guest-server.service "Service" "PIDFile" "/var/run/guestServer.pid"
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_mtce_guest {
|
function configure_mtce_guest_common {
|
||||||
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
# the content related to "controller" in /etc/hosts is generated by stx-metal
|
||||||
# the content related to "controller" in /etc/hosts is generated by stx-metal
|
# devstack plugin. for the time being, there are no entries about oamcontroller,
|
||||||
# devstack plugin. for the time being, there are no entries about oamcontroller,
|
# pxecontroller, ipv6, etc. so here we use a simple regular expression.
|
||||||
# pxecontroller, ipv6, etc. so here we use a simple regular expression.
|
if grep -q "^[0-9]\{1,3\}.*\s\+controller$" /etc/hosts; then
|
||||||
if grep -q "^[0-9]\{1,3\}.*\s\+controller$" /etc/hosts; then
|
sudo sed -i "s%^[0-9]\{1,3\}.*\s\+controller$%$HOST_IP controller%" /etc/hosts
|
||||||
sudo sed -i "s%^[0-9]\{1,3\}.*\s\+controller$%$HOST_IP controller%" /etc/hosts
|
else
|
||||||
else
|
echo "$HOST_IP controller" | sudo tee -a "/etc/hosts"
|
||||||
echo "$HOST_IP controller" | sudo tee -a "/etc/hosts"
|
|
||||||
fi
|
|
||||||
if grep -q "^[0-9]\{1,3\}.*\s\+.*controller-0$" /etc/hosts; then
|
|
||||||
sudo sed -i "s%^[0-9]\{1,3\}.*\s\+controller-0$%$HOST_IP controller-0%" /etc/hosts
|
|
||||||
else
|
|
||||||
echo "$HOST_IP controller-0" | sudo tee -a "/etc/hosts"
|
|
||||||
fi
|
|
||||||
if [ -f "/etc/platform/.initial_config_complete" ]; then
|
|
||||||
sudo touch /etc/platform/.initial_config_complete
|
|
||||||
fi
|
|
||||||
if [ -f "/var/run/.goenabled" ]; then
|
|
||||||
sudo touch /var/run/.goenabled
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
if grep -q "^[0-9]\{1,3\}.*\s\+.*controller-0$" /etc/hosts; then
|
||||||
if is_service_enabled guest-agent; then
|
sudo sed -i "s%^[0-9]\{1,3\}.*\s\+controller-0$%$HOST_IP controller-0%" /etc/hosts
|
||||||
configure_guest_agent
|
else
|
||||||
|
echo "$HOST_IP controller-0" | sudo tee -a "/etc/hosts"
|
||||||
fi
|
fi
|
||||||
if is_service_enabled guest-server; then
|
if [ -f "/etc/platform/.initial_config_complete" ]; then
|
||||||
configure_guest_server
|
sudo touch /etc/platform/.initial_config_complete
|
||||||
|
fi
|
||||||
|
if [ -f "/var/run/.goenabled" ]; then
|
||||||
|
sudo touch /var/run/.goenabled
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +183,20 @@ function configure_nfv {
|
||||||
if is_service_enabled nfv-vim-webserver; then
|
if is_service_enabled nfv-vim-webserver; then
|
||||||
configure_nfv_vim_webserver
|
configure_nfv_vim_webserver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled nova-api-proxy; then
|
||||||
|
configure_nova_api_proxy
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
||||||
|
configure_mtce_guest_common
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-agent; then
|
||||||
|
configure_guest_agent
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-server; then
|
||||||
|
configure_guest_server
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_nfv_common {
|
function configure_nfv_common {
|
||||||
|
@ -236,23 +246,21 @@ function configure_nfv_vim_webserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_nova_api_proxy {
|
function configure_nova_api_proxy {
|
||||||
if is_service_enabled nova-api-proxy; then
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "pool_size" "256"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "pool_size" "256"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "nfvi_compute_listen_port" "30003"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "nfvi_compute_listen_port" "30003"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "nfvi_compute_listen" "127.0.0.1"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "DEFAULT" "nfvi_compute_listen" "127.0.0.1"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "auth_type" "password"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "auth_type" "password"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "auth_url" "$KEYSTONE_SERVICE_URI"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "auth_url" "$KEYSTONE_SERVICE_URI"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "user_domain_name" "$SERVICE_DOMAIN_NAME"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "user_domain_name" "$SERVICE_DOMAIN_NAME"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "username" "nova"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "username" "nova"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "password" "$SERVICE_PASSWORD"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "password" "$SERVICE_PASSWORD"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "project_domain_name" "$SERVICE_DOMAIN_NAME"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "project_domain_name" "$SERVICE_DOMAIN_NAME"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "project_name" "$SERVICE_PROJECT_NAME"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "project_name" "$SERVICE_PROJECT_NAME"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "admin_user" "nova"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "admin_user" "nova"
|
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "admin_tenant_name" "$SERVICE_PROJECT_NAME"
|
||||||
iniset -sudo $NOVA_API_PROXY_CONF/nova-api-proxy.conf "keystone_authtoken" "admin_tenant_name" "$SERVICE_PROJECT_NAME"
|
|
||||||
|
|
||||||
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@nova-api-proxy.service "Service" "Type" "simple"
|
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@nova-api-proxy.service "Service" "Type" "simple"
|
||||||
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@nova-api-proxy.service "Service" "PIDFile" "/var/run/nova-api-proxy.pid"
|
iniset -sudo $STXNFV_SYSCONFDIR/systemd/system/devstack@nova-api-proxy.service "Service" "PIDFile" "/var/run/nova-api-proxy.pid"
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_guest_agent {
|
function install_guest_agent {
|
||||||
|
@ -261,7 +269,7 @@ function install_guest_agent {
|
||||||
sudo install -m 755 -d $MTCE_GUEST_OCF_DIR
|
sudo install -m 755 -d $MTCE_GUEST_OCF_DIR
|
||||||
sudo install -m 755 -p -D scripts/guestAgent.ocf $MTCE_GUEST_OCF_DIR/guestAgent
|
sudo install -m 755 -p -D scripts/guestAgent.ocf $MTCE_GUEST_OCF_DIR/guestAgent
|
||||||
sudo install -m 644 -p -D scripts/guest.ini $MTCE_GUEST_CONF/guestAgent.ini
|
sudo install -m 644 -p -D scripts/guest.ini $MTCE_GUEST_CONF/guestAgent.ini
|
||||||
sudo install -m 755 -p -D guestAgent $STX_PREFIX/bin/guestAgent
|
sudo install -m 755 -p -D guestAgent $STX_INST_DIR/bin/guestAgent
|
||||||
sudo install -m 755 -p -D scripts/guestAgent $STXNFV_SYSCONFDIR/init.d/guestAgent
|
sudo install -m 755 -p -D scripts/guestAgent $STXNFV_SYSCONFDIR/init.d/guestAgent
|
||||||
sudo install -m 644 -p -D scripts/guestAgent.logrotate $STXNFV_SYSCONFDIR/logrotate.d/guestAgent.logrotate
|
sudo install -m 644 -p -D scripts/guestAgent.logrotate $STXNFV_SYSCONFDIR/logrotate.d/guestAgent.logrotate
|
||||||
|
|
||||||
|
@ -269,42 +277,40 @@ function install_guest_agent {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_guest_client {
|
function install_guest_client {
|
||||||
if is_service_enabled guest-client; then
|
pushd $STXNFV_DIR/guest-client/guest-client-$GUEST_CLIENT_VERSION
|
||||||
pushd $STXNFV_DIR/guest-client/guest-client-$GUEST_CLIENT_VERSION
|
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
make build sysconfdir=$STXNFV_SYSCONFDIR
|
make build sysconfdir=$STXNFV_SYSCONFDIR
|
||||||
make sample
|
make sample
|
||||||
make tar ARCHIVE_NAME=wrs-guest-heartbeat-$GUEST_CLIENT_VERSION
|
make tar ARCHIVE_NAME=wrs-guest-heartbeat-$GUEST_CLIENT_VERSION
|
||||||
find build
|
find build
|
||||||
|
|
||||||
# Sudo Install for guest-client package
|
# Sudo Install for guest-client package
|
||||||
sudo install -m 755 -d $STX_PREFIX/include/guest-client
|
sudo install -m 755 -d $STX_INST_DIR/include/guest-client
|
||||||
sudo install -m 644 -p -D guest_client/src/heartbeat/guest_heartbeat_msg_defs.h $STX_PREFIX/include/guest-client/guest_heartbeat_msg_defs.h
|
sudo install -m 644 -p -D guest_client/src/heartbeat/guest_heartbeat_msg_defs.h $STX_INST_DIR/include/guest-client/guest_heartbeat_msg_defs.h
|
||||||
sudo install -d $STX_SDK_DEPLOY_DIR
|
sudo install -d $STX_SDK_DEPLOY_DIR
|
||||||
sudo install -m 640 build/wrs-guest-heartbeat-$GUEST_CLIENT_VERSION.tgz $STX_SDK_DEPLOY_DIR
|
sudo install -m 640 build/wrs-guest-heartbeat-$GUEST_CLIENT_VERSION.tgz $STX_SDK_DEPLOY_DIR
|
||||||
|
|
||||||
# Systemd services
|
# Systemd services
|
||||||
sudo install -m 644 -p -D guest_client/scripts/guest-client.service $STXNFV_SYSCONFDIR/systemd/system/guest-client.service
|
sudo install -m 644 -p -D guest_client/scripts/guest-client.service $STXNFV_SYSCONFDIR/systemd/system/guest-client.service
|
||||||
sudo install -m 744 -p -D guest_client/scripts/guest-client.systemd $STXNFV_SYSCONFDIR/guest-client/guest-client.systemd
|
sudo install -m 744 -p -D guest_client/scripts/guest-client.systemd $STXNFV_SYSCONFDIR/guest-client/guest-client.systemd
|
||||||
|
|
||||||
sudo install -m 750 -d $STXNFV_SYSCONFDIR/guest-client/heartbeat
|
sudo install -m 750 -d $STXNFV_SYSCONFDIR/guest-client/heartbeat
|
||||||
sudo install -m 755 -p -D guest_client/scripts/guest_heartbeat.conf $STXNFV_SYSCONFDIR/guest-client/heartbeat/guest_heartbeat.conf
|
sudo install -m 755 -p -D guest_client/scripts/guest_heartbeat.conf $STXNFV_SYSCONFDIR/guest-client/heartbeat/guest_heartbeat.conf
|
||||||
sudo install -m 755 -p -D guest_client/scripts/sample_event_handling_script $STXNFV_SYSCONFDIR/guest-client/heartbeat/sample_event_handling_script
|
sudo install -m 755 -p -D guest_client/scripts/sample_event_handling_script $STXNFV_SYSCONFDIR/guest-client/heartbeat/sample_event_handling_script
|
||||||
sudo install -m 755 -p -D guest_client/scripts/sample_health_check_script $STXNFV_SYSCONFDIR/guest-client/heartbeat/sample_health_check_script
|
sudo install -m 755 -p -D guest_client/scripts/sample_health_check_script $STXNFV_SYSCONFDIR/guest-client/heartbeat/sample_health_check_script
|
||||||
sudo install -m 640 -p -D build/guest-client $STX_PREFIX/bin/guest-client
|
sudo install -m 640 -p -D build/guest-client $STX_INST_DIR/bin/guest-client
|
||||||
sudo install -m 640 -p -D build/libguest_common_api.so.$GUEST_CLIENT_VERSION $STX_PREFIX/lib/libguest_common_api.so.$GUEST_CLIENT_VERSION
|
sudo install -m 640 -p -D build/libguest_common_api.so.$GUEST_CLIENT_VERSION $STX_INST_DIR/lib/libguest_common_api.so.$GUEST_CLIENT_VERSION
|
||||||
sudo install -m 640 -p -D build/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION $STX_PREFIX/lib/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION
|
sudo install -m 640 -p -D build/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION $STX_INST_DIR/lib/libguest_heartbeat_api.so.$GUEST_CLIENT_VERSION
|
||||||
|
|
||||||
popd
|
popd
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_guest_server {
|
function install_guest_server {
|
||||||
pushd $MTCE_GUEST_DIR/src
|
pushd $MTCE_GUEST_DIR/src
|
||||||
|
|
||||||
sudo install -m 644 -p -D scripts/guest.ini $MTCE_GUEST_CONF/guestServer.ini
|
sudo install -m 644 -p -D scripts/guest.ini $MTCE_GUEST_CONF/guestServer.ini
|
||||||
sudo install -m 755 -p -D guestServer $STX_PREFIX/bin/guestServer
|
sudo install -m 755 -p -D guestServer $STX_INST_DIR/bin/guestServer
|
||||||
sudo install -m 755 -p -D scripts/guestServer $STXNFV_SYSCONFDIR/init.d/guestServer
|
sudo install -m 755 -p -D scripts/guestServer $STXNFV_SYSCONFDIR/init.d/guestServer
|
||||||
sudo install -m 755 -d $(STXNFV_SYSCONFDIR)/pmon.d
|
sudo install -m 755 -d $(STXNFV_SYSCONFDIR)/pmon.d
|
||||||
sudo install -m 644 -p -D scripts/guestServer.pmon $STXNFV_SYSCONFDIR/pmon.d/guestServer.conf
|
sudo install -m 644 -p -D scripts/guestServer.pmon $STXNFV_SYSCONFDIR/pmon.d/guestServer.conf
|
||||||
|
@ -313,30 +319,12 @@ function install_guest_server {
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_mtce_guest {
|
function install_mtce_guest_common {
|
||||||
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
pushd $MTCE_GUEST_DIR/src
|
||||||
# guest-client: to install guest_heartbeat_api_msg_defs.h
|
make build
|
||||||
# stx-metal: to install mtce_common header files and libraries
|
popd
|
||||||
# fm-common: to install fmcommon library
|
|
||||||
local req_services="guest-client stx-metal fm-common"
|
|
||||||
for srv in $req_services;do
|
|
||||||
if ! is_service_enabled "$srv"; then
|
|
||||||
die $LINENO "$srv should be enabled for guestAgent/guestServer"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
pushd $MTCE_GUEST_DIR/src
|
sudo install -m 755 -d $(STXNFV_SYSCONFDIR)/logrotate.d
|
||||||
make build
|
|
||||||
popd
|
|
||||||
|
|
||||||
sudo install -m 755 -d $(STXNFV_SYSCONFDIR)/logrotate.d
|
|
||||||
fi
|
|
||||||
if is_service_enabled guest-agent; then
|
|
||||||
install_guest_agent
|
|
||||||
fi
|
|
||||||
if is_service_enabled guest-server; then
|
|
||||||
install_guest_server
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_nfv {
|
function install_nfv {
|
||||||
|
@ -347,6 +335,23 @@ function install_nfv {
|
||||||
install_nfv_tools
|
install_nfv_tools
|
||||||
install_nfv_client
|
install_nfv_client
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled nova-api-proxy; then
|
||||||
|
install_nova_api_proxy
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-client; then
|
||||||
|
install_guest_client
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
||||||
|
install_mtce_guest_common
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-agent; then
|
||||||
|
install_guest_agent
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-server; then
|
||||||
|
install_guest_server
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_nfv_client {
|
function install_nfv_client {
|
||||||
|
@ -410,16 +415,14 @@ function install_nfv_vim {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_nova_api_proxy {
|
function install_nova_api_proxy {
|
||||||
if is_service_enabled nova-api-proxy; then
|
pushd $NOVA_API_PROXY_DIR
|
||||||
pushd $NOVA_API_PROXY_DIR
|
python setup.py build
|
||||||
python setup.py build
|
sudo python setup.py install --root=/ --install-lib=${PYTHON_SITE_DIR} --single-version-externally-managed
|
||||||
sudo python setup.py install --root=/ --install-lib=${PYTHON_SITE_DIR} --single-version-externally-managed
|
popd
|
||||||
popd
|
|
||||||
|
|
||||||
sudo install -d -m 755 $NOVA_API_PROXY_CONF
|
sudo install -d -m 755 $NOVA_API_PROXY_CONF
|
||||||
sudo install -p -D -m 744 $NOVA_API_PROXY_DIR/nova_api_proxy/nova-api-proxy.conf $NOVA_API_PROXY_CONF/nova-api-proxy.conf
|
sudo install -p -D -m 744 $NOVA_API_PROXY_DIR/nova_api_proxy/nova-api-proxy.conf $NOVA_API_PROXY_CONF/nova-api-proxy.conf
|
||||||
sudo install -p -D -m 744 $NOVA_API_PROXY_DIR/nova_api_proxy/api-proxy-paste.ini $NOVA_API_PROXY_CONF/api-proxy-paste.ini
|
sudo install -p -D -m 744 $NOVA_API_PROXY_DIR/nova_api_proxy/api-proxy-paste.ini $NOVA_API_PROXY_CONF/api-proxy-paste.ini
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_guest_agent {
|
function start_guest_agent {
|
||||||
|
@ -430,15 +433,6 @@ function start_guest_server {
|
||||||
run_process guest-server "$STXNFV_SYSCONFDIR/init.d/guestServer start" root root
|
run_process guest-server "$STXNFV_SYSCONFDIR/init.d/guestServer start" root root
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_mtce_guest {
|
|
||||||
if is_service_enabled guest-agent; then
|
|
||||||
start_guest_agent
|
|
||||||
fi
|
|
||||||
if is_service_enabled guest-server; then
|
|
||||||
start_guest_server
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function start_nfv {
|
function start_nfv {
|
||||||
if is_service_enabled nfv-vim; then
|
if is_service_enabled nfv-vim; then
|
||||||
start_nfv_vim
|
start_nfv_vim
|
||||||
|
@ -449,6 +443,17 @@ function start_nfv {
|
||||||
if is_service_enabled nfv-vim-webserver; then
|
if is_service_enabled nfv-vim-webserver; then
|
||||||
start_nfv_vim_webserver
|
start_nfv_vim_webserver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled nova-api-proxy; then
|
||||||
|
start_nova_api_proxy
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent; then
|
||||||
|
start_guest_agent
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-server; then
|
||||||
|
start_guest_server
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_nfv_vim {
|
function start_nfv_vim {
|
||||||
|
@ -464,10 +469,9 @@ function start_nfv_vim_webserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_nova_api_proxy {
|
function start_nova_api_proxy {
|
||||||
if is_service_enabled nova-api-proxy; then
|
local daemon
|
||||||
local daemon=$(which nova-api-proxy)
|
daemon=$(which nova-api-proxy)
|
||||||
run_process nova-api-proxy "$daemon --config-file=$NOVA_API_PROXY_CONF/nova-api-proxy.conf" root root
|
run_process nova-api-proxy "$daemon --config-file=$NOVA_API_PROXY_CONF/nova-api-proxy.conf" root root
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_guest_agent {
|
function stop_guest_agent {
|
||||||
|
@ -478,15 +482,6 @@ function stop_guest_server {
|
||||||
stop_process guest-server
|
stop_process guest-server
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_mtce_guest {
|
|
||||||
if is_service_enabled guest-agent; then
|
|
||||||
stop_guest_agent
|
|
||||||
fi
|
|
||||||
if is_service_enabled guest-server; then
|
|
||||||
stop_guest_server
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function stop_nfv {
|
function stop_nfv {
|
||||||
if is_service_enabled nfv-vim; then
|
if is_service_enabled nfv-vim; then
|
||||||
stop_nfv_vim
|
stop_nfv_vim
|
||||||
|
@ -497,6 +492,17 @@ function stop_nfv {
|
||||||
if is_service_enabled nfv-vim-webserver; then
|
if is_service_enabled nfv-vim-webserver; then
|
||||||
stop_nfv_vim_webserver
|
stop_nfv_vim_webserver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled nova-api-proxy; then
|
||||||
|
stop_nova_api_proxy
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled guest-agent; then
|
||||||
|
stop_guest_agent
|
||||||
|
fi
|
||||||
|
if is_service_enabled guest-server; then
|
||||||
|
stop_guest_server
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_nfv_vim {
|
function stop_nfv_vim {
|
||||||
|
@ -512,9 +518,7 @@ function stop_nfv_vim_webserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_nova_api_proxy {
|
function stop_nova_api_proxy {
|
||||||
if is_service_enabled nova-api-proxy; then
|
stop_process nova-api-proxy
|
||||||
stop_process nova-api-proxy
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_XTRACE_STX_NFV
|
$_XTRACE_STX_NFV
|
||||||
|
|
|
@ -11,36 +11,24 @@ if is_service_enabled stx-nfv; then
|
||||||
# Perform installation of service source
|
# Perform installation of service source
|
||||||
echo_summary "Installing stx-nfv"
|
echo_summary "Installing stx-nfv"
|
||||||
install_nfv
|
install_nfv
|
||||||
install_nova_api_proxy
|
|
||||||
install_guest_client
|
|
||||||
install_mtce_guest
|
|
||||||
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||||
# Configure after the other layer 1 and 2 services have been configured
|
# Configure after the other layer 1 and 2 services have been configured
|
||||||
echo_summary "Configuring stx-nfv"
|
echo_summary "Configuring stx-nfv"
|
||||||
configure_nfv
|
configure_nfv
|
||||||
configure_nova_api_proxy
|
|
||||||
configure_mtce_guest
|
|
||||||
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||||
echo_summary "Starting stx-nfv"
|
echo_summary "Starting stx-nfv"
|
||||||
start_nfv
|
start_nfv
|
||||||
start_nova_api_proxy
|
|
||||||
start_mtce_guest
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "unstack" ]]; then
|
if [[ "$1" == "unstack" ]]; then
|
||||||
echo_summary "Shutdown stx-nfv"
|
echo_summary "Shutdown stx-nfv"
|
||||||
stop_nfv
|
stop_nfv
|
||||||
stop_nova_api_proxy
|
|
||||||
stop_mtce_guest
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "clean" ]]; then
|
if [[ "$1" == "clean" ]]; then
|
||||||
echo_summary "Clean stx-nfv"
|
echo_summary "Clean stx-nfv"
|
||||||
cleanup_nfv
|
cleanup_nfv
|
||||||
cleanup_nova_api_proxy
|
|
||||||
cleanup_guest_client
|
|
||||||
cleanup_mtce_guest
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,11 +19,29 @@ enable_service $STX_NFV_NAME
|
||||||
define_plugin stx-nfv
|
define_plugin stx-nfv
|
||||||
# This works for Zuul jobs using OpenStack's DevStack roles
|
# This works for Zuul jobs using OpenStack's DevStack roles
|
||||||
plugin_requires stx-nfv stx-update
|
plugin_requires stx-nfv stx-update
|
||||||
|
plugin_requires stx-nfv stx-fault
|
||||||
|
plugin_requires stx-nfv stx-metal
|
||||||
|
|
||||||
if is_service_enabled stx-nfv; then
|
if is_service_enabled stx-nfv; then
|
||||||
# Enable prerequisites here
|
# Enable prerequisites here
|
||||||
:
|
:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# NOTE(dtroyer): This needs to be refiend a bit yet, for example fo we want
|
||||||
|
# to abort or just disable guest-agent and guest-server if the
|
||||||
|
# prereqs are not configured?
|
||||||
|
if is_service_enabled guest-agent || is_service_enabled guest-server; then
|
||||||
|
# These guest- services require additional prerequisites
|
||||||
|
# guest-client: to install guest_heartbeat_api_msg_defs.h
|
||||||
|
# stx-metal: to install mtce_common header files and libraries
|
||||||
|
# fm-common: to install fmcommon library
|
||||||
|
local req_services="guest-client stx-metal fm-common"
|
||||||
|
for srv in $req_services;do
|
||||||
|
if ! is_service_enabled "$srv"; then
|
||||||
|
die $LINENO "$srv should be enabled for guestAgent/guestServer"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Initial source of lib script
|
# Initial source of lib script
|
||||||
source $DEST/stx-nfv/devstack/lib/stx-nfv
|
source $DEST/stx-nfv/devstack/lib/stx-nfv
|
||||||
|
|
Loading…
Reference in New Issue