69aa3e4eed
* fix hwmon start script issue * check hostname for mtcAgent. disable mtcAgent if the hostname does not meet the requriement. * set correct interface name Story: 2003161 Task: 29977 Change-Id: I30e321eab3fd5424913ddce37cc9ef6442c0e969 Signed-off-by: Yi Wang <yi.c.wang@intel.com>
84 lines
2.3 KiB
Bash
84 lines
2.3 KiB
Bash
#!/bin/bash
|
|
# Devstack settings
|
|
|
|
# This plugin is to enable StarlingX stx-metal services and follows the
|
|
# devstack plugin contract:
|
|
# https://docs.openstack.org/devstack/latest/plugins.html#plugin-sh-contract
|
|
#
|
|
# Services can be seperatly enabled by node personality or components
|
|
# unless they are coupled in functionality(e.g. mtcAgent/mtcClient).
|
|
# Other flocks services sysinv/fm/sm/nfv required to bring up full
|
|
# functionality maintenance services.
|
|
#
|
|
# Current configuration supports All-in-One simplex mode.
|
|
#
|
|
# Servcies
|
|
# stx-metal - Overall enable for this plugin
|
|
#
|
|
# mtce
|
|
# mtce-control
|
|
# mtce-compute
|
|
# mtce-storage
|
|
#
|
|
# mtce-components (include all of the below)
|
|
# fsmon
|
|
# hbs
|
|
# hwmon
|
|
# mtcalarm
|
|
# mtclog
|
|
# pmon
|
|
|
|
STX_METAL_NAME=stx-metal
|
|
|
|
######### Plugin Specific ##########
|
|
# Enable service for node type
|
|
enable_service $STX_METAL_NAME
|
|
|
|
# This must not use any variables to work properly in OpenStack's DevStack playbook
|
|
define_plugin stx-metal
|
|
# This works for Zuul jobs using OpenStack's DevStack roles
|
|
plugin_requires stx-metal barbican
|
|
plugin_requires stx-metal stx-fault
|
|
|
|
if ! is_service_enabled barbican; then
|
|
die $LINENO "Barbican is required"
|
|
fi
|
|
|
|
if is_service_enabled mtce-components; then
|
|
enable_service fsmon hbs hwmon mtce mtcalarm mtclog pmon
|
|
fi
|
|
|
|
# Be careful to enable hostw, it will restart your host
|
|
# if some config is not correct
|
|
#enable_service hostw
|
|
|
|
if is_service_enabled mtce-compute; then
|
|
# stx-update
|
|
enable_service tsconfig
|
|
fi
|
|
# run_process checks whether the service name is enabled or not
|
|
if is_service_enabled hbs; then
|
|
# enable hbsAgent/hbsClient service as part of hbs service
|
|
enable_service hbsAgent
|
|
enable_service hbsClient
|
|
fi
|
|
if is_service_enabled mtce; then
|
|
# enable mtcAgent/mtcClient service as part of mtce service
|
|
enable_service mtcAgent
|
|
enable_service mtcClient
|
|
fi
|
|
if is_service_enabled hwmon && is_plugin_enabled stx-config; then
|
|
enable_service sysinv
|
|
fi
|
|
|
|
if is_service_enabled mtcAgent; then
|
|
if [ $(hostname) != "controller-0" ] && [ $(hostname) != "controller-1" ]; then
|
|
# mtcAgent requires that hostname must be "controller-0" or "controller-1"
|
|
echo_summary "hostname doesn't meet requirements, so disable mtcAgent"
|
|
disable_service mtcAgent
|
|
fi
|
|
fi
|
|
|
|
# Initial source of lib script
|
|
source $DEST/stx-metal/devstack/lib/stx-metal
|