Remove contrib/devstack
DevStack doesn't use extras.d to install external repository plugins anymore. It has been replaced by the plugins interface [1][2]. However, extras.d related code was still contained in the contrib/devstack directory. This commit removes contrib/devstack and its contents. [1] http://docs.openstack.org/developer/devstack/plugins.html [2] https://github.com/openstack-dev/devstack/blob/51ecf0a8/functions-common#L1882 Change-Id: I86545cd8436b5a82f4700c01720798ea9f97599e Closes-Bug: #1649221
This commit is contained in:
parent
a6f728a720
commit
e6ebd0878e
|
@ -1,18 +0,0 @@
|
|||
====================
|
||||
Devstack Integration
|
||||
====================
|
||||
|
||||
This directory contains the files necessary to integrate Blazar with devstack.
|
||||
|
||||
To install:
|
||||
|
||||
$ DEVSTACK_DIR=.../path/to/devstack
|
||||
$ cp lib/blazar ${DEVSTACK_DIR}/lib
|
||||
$ cp extras.d/70-blazar.sh ${DEVSTACK_DIR}/extras.d
|
||||
|
||||
To configure devstack to run blazar:
|
||||
|
||||
$ cd ${DEVSTACK_DIR}
|
||||
$ echo "enable_service blazar" >> localrc
|
||||
$ echo "enable_service blazar-a" >> localrc
|
||||
$ echo "enable_service blazar-m" >> localrc
|
|
@ -1,21 +0,0 @@
|
|||
if is_service_enabled blazar; then
|
||||
if [[ "$1" == "source" ]]; then
|
||||
source $TOP_DIR/lib/keystone
|
||||
source $TOP_DIR/lib/nova
|
||||
source $TOP_DIR/lib/blazar
|
||||
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
||||
echo_summary "Installing Climate"
|
||||
install_climate
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
echo_summary "Configuring Climate"
|
||||
create_climate_accounts
|
||||
configure_climate
|
||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||
echo_summary "Creating nova aggregate used as freepool for Climate Host Reservation"
|
||||
create_climate_aggregate_freepool
|
||||
echo_summary "Starting Climate"
|
||||
start_climate
|
||||
elif [[ "$1" == "unstack" ]]; then
|
||||
stop_climate
|
||||
fi
|
||||
fi
|
|
@ -1,214 +0,0 @@
|
|||
# lib/blazar
|
||||
# Install and start **blazar** reservations service
|
||||
|
||||
# Dependencies:
|
||||
# - functions
|
||||
# - DEST, DATA_DIR, STACK_USER must be defined
|
||||
# SERVICE_{TENANT_NAME|PASSWORD} must be defined
|
||||
# ``KEYSTONE_TOKEN_FORMAT`` must be defined
|
||||
|
||||
# stack.sh
|
||||
# ---------
|
||||
# install_climate #
|
||||
# configure_climate #
|
||||
# start_climate #
|
||||
# stop_climate #
|
||||
|
||||
# Save trace setting
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
|
||||
# Defaults
|
||||
# --------
|
||||
|
||||
CLIMATE_DEBUG=${CLIMATE_DEBUG:-True}
|
||||
CLIMATE_VERBOSE=${CLIMATE_VERBOSE:-True}
|
||||
CLIMATE_USER_NAME=${CLIMATE_USER_NAME:-climate}
|
||||
|
||||
# Set up default repos
|
||||
CLIMATE_REPO=${CLIMATE_REPO:-${GIT_BASE}/openstack/blazar.git}
|
||||
CLIMATE_BRANCH=${CLIMATE_BRANCH:-master}
|
||||
CLIMATECLIENT_REPO=${CLIMATECLIENT_REPO:-${GIT_BASE}/openstack/python-blazarclient.git}
|
||||
CLIMATECLIENT_BRANCH=${CLIMATECLIENT_BRANCH:-master}
|
||||
CLIMATENOVA_REPO=${CLIMATENOVA_REPO:-${GIT_BASE}/openstack/blazar-nova.git}
|
||||
CLIMATENOVA_BRANCH=${CLIMATENOVA_BRANCH:-master}
|
||||
|
||||
# Set up default directories
|
||||
CLIMATE_DIR=$DEST/blazar
|
||||
CLIMATE_CONF_DIR=${CLIMATE_CONF_DIR:-/etc/climate}
|
||||
CLIMATE_CONF_FILE=$CLIMATE_CONF_DIR/climate.conf
|
||||
CLIMATECLIENT_DIR=$DEST/python-blazarclient
|
||||
CLIMATENOVA_DIR=$DEST/blazar-nova
|
||||
|
||||
CLIMATE_SERVICE_HOST=${CLIMATE_SERVICE_HOST:-$SERVICE_HOST}
|
||||
CLIMATE_SERVICE_PORT=${CLIMATE_SERVICE_PORT:-1234}
|
||||
CLIMATE_SERVICE_PROTOCOL=${CLIMATE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
||||
|
||||
CLIMATE_FREEPOOL_NAME=${CLIMATE_FREEPOOL_NAME:-freepool}
|
||||
|
||||
# Support entry points installation of console scripts
|
||||
if [[ -d $CLIMATE_DIR/bin ]]; then
|
||||
CLIMATE_BIN_DIR=$CLIMATE_DIR/bin
|
||||
else
|
||||
CLIMATE_BIN_DIR=$(get_python_exec_prefix)
|
||||
fi
|
||||
|
||||
# Oslo.Messaging RPC iniupdate cofiguration
|
||||
function iniupdate_rpc_backend() {
|
||||
local file=$1
|
||||
local section=$2
|
||||
if is_service_enabled zeromq; then
|
||||
iniset $file $section rpc_backend zmq
|
||||
elif is_service_enabled qpid || [ -n "$QPID_HOST" ]; then
|
||||
iniset $file $section rpc_backend qpid
|
||||
elif is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then
|
||||
iniset $file $section rpc_backend rabbit
|
||||
fi
|
||||
}
|
||||
|
||||
# configure_climate() - Set config files, create data dirs, etc
|
||||
function configure_climate() {
|
||||
if [[ ! -d $CLIMATE_CONF_DIR ]]; then
|
||||
sudo mkdir -p $CLIMATE_CONF_DIR
|
||||
fi
|
||||
sudo chown $STACK_USER $CLIMATE_CONF_DIR
|
||||
|
||||
CLIMATE_POLICY_FILE=$CLIMATE_CONF_DIR/policy.json
|
||||
cp $CLIMATE_DIR/etc/policy.json $CLIMATE_POLICY_FILE
|
||||
|
||||
touch $CLIMATE_CONF_FILE
|
||||
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT os_auth_version v3
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT os_auth_port $KEYSTONE_SERVICE_PORT
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT os_admin_password $SERVICE_PASSWORD
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT os_admin_username climate
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT os_admin_project_name $SERVICE_TENANT_NAME
|
||||
|
||||
# keystone authtoken
|
||||
iniset $CLIMATE_CONF_FILE keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
|
||||
iniset $CLIMATE_CONF_FILE keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
|
||||
iniset $CLIMATE_CONF_FILE keystone_authtoken admin_user climate
|
||||
iniset $CLIMATE_CONF_FILE keystone_authtoken admin_password $SERVICE_PASSWORD
|
||||
iniset $CLIMATE_CONF_FILE keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
|
||||
configure_API_version $CLIMATE_CONF_FILE 3
|
||||
|
||||
iniset $CLIMATE_CONF_FILE physical:host climate_username $CLIMATE_USER_NAME
|
||||
iniset $CLIMATE_CONF_FILE physical:host climate_password $SERVICE_PASSWORD
|
||||
iniset $CLIMATE_CONF_FILE physical:host climate_project_name $SERVICE_TENANT_NAME
|
||||
iniset $CLIMATE_CONF_FILE physical:host aggregate_freepool_name $CLIMATE_FREEPOOL_NAME
|
||||
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT host $HOST_IP
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT debug $CLIMATE_DEBUG
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT verbose $CLIMATE_VERBOSE
|
||||
|
||||
iniset $CLIMATE_CONF_FILE manager plugins basic.vm.plugin,physical.host.plugin
|
||||
|
||||
iniset $CLIMATE_CONF_FILE api api_v2_controllers oshosts,leases
|
||||
|
||||
iniset $CLIMATE_CONF_FILE database connection `database_connection_url climate`
|
||||
|
||||
iniset $CLIMATE_CONF_FILE DEFAULT use_syslog $SYSLOG
|
||||
|
||||
iniset_rpc_backend climate $CLIMATE_CONF_FILE DEFAULT
|
||||
iniupdate_rpc_backend $CLIMATE_CONF_FILE DEFAULT
|
||||
|
||||
ACTUAL_FILTERS=$(iniget $NOVA_CONF DEFAULT scheduler_default_filters)
|
||||
if [[ -z "$ACTUAL_FILTERS" ]]; then
|
||||
iniadd $NOVA_CONF DEFAULT scheduler_default_filters "RetryFilter, AvailabilityZoneFilter, RamFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, ClimateFilter"
|
||||
else
|
||||
iniset $NOVA_CONF DEFAULT scheduler_default_filters "$ACTUAL_FILTERS,ClimateFilter"
|
||||
fi
|
||||
|
||||
ACTUAL_AVAILABLE_FILTERS=$(iniget $NOVA_CONF DEFAULT scheduler_available_filters)
|
||||
if [[ -z "$ACTUAL_AVAILABLE_FILTERS" ]]; then
|
||||
iniset $NOVA_CONF DEFAULT scheduler_available_filters "nova.scheduler.filters.all_filters"
|
||||
fi
|
||||
iniadd $NOVA_CONF DEFAULT scheduler_available_filters "climatenova.scheduler.filters.climate_filter.ClimateFilter"
|
||||
|
||||
ACTUAL_OSAPI_COMPUTE_EXTENSIONS=$(iniget_multiline $NOVA_CONF DEFAULT osapi_compute_extension)
|
||||
if [[ -z "$ACTUAL_OSAPI_COMPUTE_EXTENSIONS" ]]; then
|
||||
iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
|
||||
fi
|
||||
iniadd $NOVA_CONF DEFAULT osapi_compute_extension "climatenova.api.extensions.reservation.Reservation"
|
||||
|
||||
# Database
|
||||
recreate_database climate utf8
|
||||
|
||||
# Run Climate db migrations
|
||||
$CLIMATE_BIN_DIR/climate-db-manage --config-file $CLIMATE_CONF_FILE upgrade head
|
||||
}
|
||||
|
||||
# create_climate_aggregate_freepool() - Create a Nova aggregate to use as freepool (for host reservation)
|
||||
create_climate_aggregate_freepool() {
|
||||
nova aggregate-create $CLIMATE_FREEPOOL_NAME
|
||||
}
|
||||
|
||||
# create_climate_accounts() - Set up common required CLIMATE accounts
|
||||
#
|
||||
# Tenant User Roles
|
||||
# ------------------------------------------------------------------
|
||||
# service CLIMATE admin # if enabled
|
||||
#
|
||||
function create_climate_accounts() {
|
||||
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
|
||||
CLIMATE_USER_ID=$(get_or_create_user $CLIMATE_USER_NAME \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "climate@example.com")
|
||||
get_or_add_user_role $ADMIN_ROLE $CLIMATE_USER_ID $SERVICE_TENANT
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
CLIMATE_SERVICE=$(get_or_create_service "climate" \
|
||||
"reservation" "Climate Reservations Service")
|
||||
get_or_create_endpoint $CLIMATE_SERVICE \
|
||||
"$REGION_NAME" \
|
||||
"$CLIMATE_SERVICE_PROTOCOL://$CLIMATE_SERVICE_HOST:$CLIMATE_SERVICE_PORT/v1" \
|
||||
"$CLIMATE_SERVICE_PROTOCOL://$CLIMATE_SERVICE_HOST:$CLIMATE_SERVICE_PORT/v1" \
|
||||
"$CLIMATE_SERVICE_PROTOCOL://$CLIMATE_SERVICE_HOST:$CLIMATE_SERVICE_PORT/v1"
|
||||
|
||||
KEYSTONEV3_SERVICE=$(get_or_create_service "keystonev3" \
|
||||
"identityv3" "Keystone Identity Service V3")
|
||||
get_or_create_endpoint $KEYSTONEV3_SERVICE \
|
||||
"$REGION_NAME" \
|
||||
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3" \
|
||||
"$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v3" \
|
||||
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# install_climate() - Collect sources and install
|
||||
function install_climate() {
|
||||
git_clone $CLIMATE_REPO $CLIMATE_DIR $CLIMATE_BRANCH
|
||||
git_clone $CLIMATECLIENT_REPO $CLIMATECLIENT_DIR $CLIMATECLIENT_BRANCH
|
||||
git_clone $CLIMATENOVA_REPO $CLIMATENOVA_DIR $CLIMATENOVA_BRANCH
|
||||
|
||||
setup_develop $CLIMATE_DIR
|
||||
setup_develop $CLIMATECLIENT_DIR
|
||||
setup_develop $CLIMATENOVA_DIR
|
||||
}
|
||||
|
||||
|
||||
# start_climate() - Start running processes, including screen
|
||||
function start_climate() {
|
||||
screen_it blazar-a "cd $CLIMATE_DIR && $CLIMATE_BIN_DIR/climate-api --debug --config-file $CLIMATE_CONF_FILE"
|
||||
screen_it blazar-m "cd $CLIMATE_DIR && $CLIMATE_BIN_DIR/climate-manager --debug --config-file $CLIMATE_CONF_FILE"
|
||||
}
|
||||
|
||||
|
||||
# stop_climate() - Stop running processes
|
||||
function stop_climate() {
|
||||
# Kill the climate screen windows
|
||||
for serv in climate-a climate-m; do
|
||||
screen_stop $serv
|
||||
done
|
||||
|
||||
# Hack to be sure that the manager is really stop
|
||||
CLIMATE_MANGER_PID=$(ps aux | grep climate-manager | grep -v grep \
|
||||
| awk '{print $2}')
|
||||
[ ! -z "$CLIMATE_MANGER_PID" ] && sudo kill -9 $CLIMATE_MANGER_PID
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
|
@ -11,38 +11,17 @@ This section includes instructions for Blazar installation using Devstack.
|
|||
|
||||
..
|
||||
|
||||
2. Download Blazar:
|
||||
2. Configure DevStack to install Blazar by adding the Blazar plugin to your
|
||||
local.conf file:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
git clone https://github.com/stackforge/blazar.git
|
||||
cd devstack
|
||||
echo "enable_plugin blazar https://git.openstack.org/openstack/blazar" >> local.conf
|
||||
|
||||
..
|
||||
|
||||
3. Add blazar files to Devstack:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
cd blazar/contrib/devstack
|
||||
DEVSTACK_DIR=../../../devstack
|
||||
cp lib/blazar ${DEVSTACK_DIR}/lib
|
||||
cp extras.d/70-blazar.sh ${DEVSTACK_DIR}/extras.d
|
||||
|
||||
..
|
||||
|
||||
4. Configure devstack to run blazar by adding blazar, blazar api and blazar
|
||||
manager to the localrc file:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
cd ${DEVSTACK_DIR}
|
||||
echo "enable_service blazar" >> localrc
|
||||
echo "enable_service blazar-a" >> localrc
|
||||
echo "enable_service blazar-m" >> localrc
|
||||
|
||||
..
|
||||
|
||||
5. Run Devstack:
|
||||
3. Run Devstack:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
|
@ -50,6 +29,14 @@ This section includes instructions for Blazar installation using Devstack.
|
|||
|
||||
..
|
||||
|
||||
4. Now you can add hosts to Blazar:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
climate host-create hostname
|
||||
|
||||
..
|
||||
|
||||
Installation without Devstack
|
||||
=============================
|
||||
|
||||
|
@ -126,19 +113,9 @@ these users, create them via Keystone:
|
|||
And the same procedure for special admin user to work with physical
|
||||
reservations.
|
||||
|
||||
Next you need to configure Nova. If you want to use virtual reservations,
|
||||
Next you need to configure Nova. If you want to use physical reservations,
|
||||
please add the following lines to nova.conf file:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
osapi_compute_extension = nova.api.openstack.compute.contrib.standard_extensions
|
||||
osapi_compute_extension = climatenova.api.extensions.default_reservation.Default_reservation
|
||||
osapi_compute_extension = climatenova.api.extensions.reservation.Reservation
|
||||
|
||||
..
|
||||
|
||||
If you want to use physical reservations add these ones:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
scheduler_available_filters = nova.scheduler.filters.all_filters
|
||||
|
|
Loading…
Reference in New Issue