A lot of changes were made

This commit is contained in:
Dmitry Teselkin 2013-04-04 17:27:03 +04:00
parent eaddba5640
commit a149d47b6a
17 changed files with 552 additions and 157 deletions

View File

@ -0,0 +1,51 @@
# Devstack's config file for COMPUTE intallation
lab_id=102
lab_password=swordfish
lab_controller=172.18.124.100
SERVICE_HOST=$lab_controller
HOST_IP=172.18.124.${lab_id}
MULTI_HOST=1
FLAT_INTERFACE=eth1
#PUBLIC_INTERFACE=eth0.261
FIXED_RANGE=192.168.102.0/24
FIXED_NETWORK_SIZE=254
FLOATING_RANGE=172.18.124.228/27
MYSQL_HOST=$lab_controller
RABBIT_HOST=$lab_controller
GLANCE_HOSTPORT=$lab_controller:9292
KEYSTONE_AUTH_HOST=$lab_controller
KEYSTONE_SERVICE_HOST=$lab_controller
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
ADMIN_PASSWORD=$lab_password
MYSQL_PASSWORD=$lab_password
RABBIT_PASSWORD=$lab_password
SERVICE_PASSWORD=$lab_password
SERVICE_TOKEN=tokentoken
ENABLED_SERVICES=n-cpu,n-net,n-api,n-vol,n-novnc
SCREEN_LOGDIR=/opt/stack/log/
LOGFILE=$SCREEN_LOGDIR/stack.sh.log
API_RATE_LIMIT=False
EXTRA_OPTS=(force_config_drive=true libvirt_images_type=qcow2 force_raw_images=false sql_connection=mysql://root:${MYSQL_PASSWORD}@${MYSQL_HOST}/nova?charset=utf8)

View File

@ -0,0 +1,45 @@
# Devstack's localrc for CONTROLLER installation
lab_id=100
lab_password=swordfish
HOST_IP=172.18.124.${lab_id}
FLAT_INTERFACE=eth1
#PUBLIC_INTERFACE=eth0.261
FIXED_RANGE=192.168.102.0/24
FIXED_NETWORK_SIZE=254
PUBLIC_RANGE=172.18.124.228/27
ADMIN_PASSWORD=$lab_password
MYSQL_PASSWORD=$lab_password
RABBIT_PASSWORD=$lab_password
SERVICE_PASSWORD=$lab_password
SERVICE_TOKEN=tokentoken
disable_service n-cpu
disable_service n-vol
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
ENABLED_SERVICES+=,conductor,portas
SCREEN_LOGDIR=/opt/stack/log/
LOGFILE=$SCREEN_LOGDIR/stack.sh.log
API_RATE_LIMIT=False
MULTI_HOST=1
EXTRA_OPTS=(force_config_drive=true libvirt_images_type=qcow2 force_raw_images=false)

View File

@ -1,34 +1,6 @@
#!/bin/bash
# Test if the named environment variable is set and not zero length
# is_set env-var
#function is_set() {
# local var=\$"$1"
# eval "[ -n \"$var\" ]" # For ex.: sh -c "[ -n \"$var\" ]" would be better, but several exercises depends on this
#}
# Prints "message" and exits
# die "message"
#function die() {
# local exitcode=$?
# if [ $exitcode == 0 ]; then
# exitcode=1
# fi
# set +o xtrace
# local msg="[ERROR] $0:$1 $2"
# echo $msg 1>&2;
# if [[ -n ${SCREEN_LOGDIR} ]]; then
# echo $msg >> "${SCREEN_LOGDIR}/error.log"
# fi
# exit $exitcode
#}
# Checks an environment variable is not set or has length 0 OR if the
# exit code is non-zero and prints "message" and exits
# NOTE: env-var is the variable name without a '$'
@ -50,7 +22,7 @@ function die_if_not_set() {
function restart_service {
while [[ -n "$1" ]] ; do
echo "Restarting service '$1' ..."
_echo "Restarting service '$1' ..."
sudo service $1 restart
shift 1
done
@ -58,18 +30,119 @@ function restart_service {
# Normalize config values to True or False
# Accepts as False: 0 no false False FALSE
# Accepts as True: 1 yes true True TRUE
# VAR=$(trueorfalse default-value test-value)
#function trueorfalse() {
# local default=$1
# local testval=$2
#
# [[ -z "$testval" ]] && { echo "$default"; return; }
# [[ "0 no false False FALSE" =~ "$testval" ]] && { echo "False"; return; }
# [[ "1 yes true True TRUE" =~ "$testval" ]] && { echo "True"; return; }
# echo "$default"
#}
function move_mysql_data_to_ramdrive {
# Moving MySQL database to tmpfs
#-------------------------------
if [[ $(trueorfalse True $MYSQL_DB_TMPFS) = "True" ]] ; then
die_if_not_set MYSQL_DB_TMPFS_SIZE
mount_dir=/var/lib/mysql
sudo -s << EOF
echo "Stopping MySQL Server"
service mysql stop
umount $mount_dir
mount -t tmpfs -o size=$MYSQL_DB_TMPFS_SIZE tmpfs $mount_dir
chmod 700 $mount_dir
chown mysql:mysql $mount_dir
mysql_install_db
/usr/bin/mysqld_safe --skip-grant-tables &
sleep 5
EOF
sudo mysql << EOF
FLUSH PRIVILEGES;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('swordfish');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('swordfish');
EOF
sudo -s << EOF
killall mysqld
sleep 5
echo "Starting MySQL Server"
service mysql start
EOF
else
_echo "MYSQL_DB_TMPFS = '$MYSQL_DB_TMPFS'"
fi
#-------------------------------
}
function move_nova_cache_to_ramdrive {
# Moving nova images cache to tmpfs
#----------------------------------
if [[ $(trueorfalse True $NOVA_CACHE_TMPFS) = "True" ]] ; then
die_if_not_set NOVA_CACHE_TMPFS_SIZE
mount_dir=/opt/stack/data/nova/instances
sudo -s << EOF
umount $mount_dir
mount -t tmpfs -o size=$NOVA_CACHE_TMPFS_SIZE tmpfs $mount_dir
chmod 775 $mount_dir
chown stack:stack $mount_dir
EOF
else
_echo "NOVA_CACHE_TMPFS = '$NOVA_CACHE_TMPFS'"
fi
#----------------------------------
}
function check_if_folder_exists {
if [[ ! -d "$1" ]] ; then
_echo "Folder '$1' not exists!"
return 1
fi
return 0
}
function validate_install_mode {
case $INSTALL_MODE in
'standalone')
check_if_folder_exists "$SCRIPTS_DIR/standalone" || exit
;;
'multihost')
check_if_folder_exists "$SCRIPTS_DIR/controller" || exit
check_if_folder_exists "$SCRIPTS_DIR/compute" || exit
;;
'controller')
check_if_folder_exists "$SCRIPTS_DIR/controller" || exit
;;
'compute')
check_if_folder_exists "$SCRIPTS_DIR/compute" || exit
;;
*)
_echo "Wrong install mode '$INSTALL_MODE'"
exit
;;
esac
}
function update_devstack_localrc {
local $__install_mode=$1
[[ -z "$__install_mode" ]] \
&& die "Install mode for update_devstack_localrc not provided!"
# Replacing devstack's localrc config
#------------------------------------
devstack_localrc="$SCRIPTS_DIR/$__install_mode/devstack.localrc"
if [[ -f $devstack_localrc ]] ; then
rm -f "$DEVSTACK_DIR/localrc"
cp $devstack_localrc "$DEVSTACK_DIR/localrc"
else
_echo "File '$devstack_localrc' not found!"
fi
#------------------------------------
}
function _echo {
echo "[$(hostname)] $@"
}

View File

@ -0,0 +1,21 @@
#!/bin/bash
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
groupadd stack
useradd -g stack -s /bin/bash -m stack
echo 'stack ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/stack
chmod 0440 /etc/sudoers.d/stack
mkdir -p $DEVSTACK_INSTALL_DIR
chmod stack:stack $DEVSTACK_INSTALL_DIR
sudo -u stack << EOF
cd
rm -rf devstack
git clone git://github.com/openstack-dev/devstack.git
EOF

View File

@ -1,7 +1,7 @@
#!/bin/bash
DEVSTACK_DIR=/home/stack/devstack
INSTALL_DIR=/opt/stack
DEVSTACK_INSTALL_DIR=/opt/stack
MYSQL_DB_TMPFS=true
MYSQL_DB_TMPFS_SIZE=128M
@ -9,7 +9,12 @@ MYSQL_DB_TMPFS_SIZE=128M
NOVA_CACHE_TMPFS=true
NOVA_CACHE_TMPFS_SIZE=24G
#======================================
source $DEVSTACK_DIR/openrc admin admin
source ./functions.sh
GLANCE_IMAGE_LIST=""
COMPUTE_NODE_LIST="172.18.124.102"
#======================================
if [[ -d "$DEVSTACK_DIR" ]] ; then
source $DEVSTACK_DIR/openrc admin admin
fi
source $SCRIPTS_DIR/functions.sh

View File

@ -1,33 +1,62 @@
#!/bin/bash
if [ -z "$1" ] ; then
source ./localrc
if [[ -z "$1" ]] ; then
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi
function glance_image_create {
local __image_name=$1
local __image_path=$1
if [[ -z "$__image_name" ]] ; then
echo "No image name provided!"
if [[ -z "$__image_path" ]] ; then
echo "Image path is missed!"
return
fi
echo "Importing image '$__image_name' into Glance..."
local __image_name=${__image_path##*/}
__image_name=${__image_name%.*}
echo "Importing image '$__image_name' into Glance ..."
glance image-delete "$__image_name"
glance image-create \
--name "$__image_name" \
--disk-format qcow2 \
--container-format bare \
--is-public true \
--copy-from "http://172.18.124.100:8888/$__image_name.qcow2"
if [[ ^http =~ $__image_path]] ; then
glance image-create \
--name "$__image_name" \
--disk-format qcow2 \
--container-format bare \
--is-public true \
--copy-from "$__image_path"
else
glance image-create \
--name "$__image_name" \
--disk-format qcow2 \
--container-format bare \
--is-public true \
--file "$__image_path"
fi
}
# Executing post-stack actions
#===============================================================================
if [ -z "$(sudo rabbitmqctl list_users | grep keero)" ] ; then
if [[ ,$INSTALL_MODE, =~ ',standalone,compute,' ]] ; then
echo "Adding iptables rule to allow Internet access from instances..."
__iptables_rule="POSTROUTING -t nat -s '$FIXED_RANGE' ! -d '$FIXED_RANGE' -j MASQUERADE"
sudo iptables -C $__iptables_rule
if [[ $? == 0 ]] ; then
echo "Iptables rule already exists."
else
sudo iptables -A $__iptables_rule
fi
fi
if [[ $INSTALL_MODE == 'compute' ]] ; then
return
fi
if [[ -z "$(sudo rabbitmqctl list_users | grep keero)" ]] ; then
echo "Adding RabbitMQ 'keero' user"
sudo rabbitmqctl add_user keero keero
else
@ -35,18 +64,17 @@ else
fi
if [ -z "$(sudo rabbitmq-plugins list -e | grep rabbitmq_management)" ] ; then
if [[ -z "$(sudo rabbitmq-plugins list -e | grep rabbitmq_management)" ]] ; then
echo "Enabling RabbitMQ management plugin"
sudo rabbitmq-plugins enable rabbitmq_management
echo "Restarting RabbitMQ ..."
restart_service rabbitmq-server
else
echo "RabbitMQ management plugin already enabled."
fi
echo "Restarting RabbitMQ ..."
restart_service rabbitmq-server
echo "* Removing nova flavors ..."
for id in $(nova flavor-list | awk '$2 ~ /[[:digit:]]/ {print $2}') ; do
echo "** Removing flavor '$id'"
@ -55,12 +83,18 @@ done
echo "* Creating new flavors ..."
nova flavor-create m1.small auto 1024 40 1
nova flavor-create m1.medium auto 2048 40 2
nova flavor-create m1.large auto 4096 40 4
nova flavor-create m1.small auto 768 40 1
nova flavor-create m1.medium auto 1024 40 1
nova flavor-create m1.large auto 1280 40 2
if [ -z "$(nova keypair-list | grep keero_key)" ] ; then
echo "* Creating security group rules ..."
nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0
nova secgroup-add-rule default udp 1 65535 0.0.0.0/0
nova secgroup-add-rule default icmp 0 8 0.0.0.0/0
if [[ -z "$(nova keypair-list | grep keero_key)" ]] ; then
echo "Creating keypair 'keero_key' ..."
nova keypair-add keero_key
else
@ -69,4 +103,7 @@ fi
#===============================================================================
glance_image_create "ws-2012-full"
for $image in $GLANCE_IMAGE_LIST ; do
glance_image_create "$image"
done

View File

@ -1,7 +1,8 @@
#!/bin/bash
if [[ -z "$1" ]] ; then
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi
@ -12,14 +13,24 @@ for file in $(sudo find $DEVSTACK_DIR/accrc/ -type f -regex ".+.pem.*") ; do
sudo rm -f "$file"
done
# Remove logs
echo Removing 'devstack' logs
sudo rm -f /var/log/devstack/*
#sudo rm -f /opt/stack/devstack/stack.sh.log
echo "* Removing 'apache2' logs"
# Remove logs
echo "* Removing 'devstack' logs ..."
sudo rm -f /opt/stack/log/*
echo "* Removing 'apache2' logs ..."
for file in $(sudo find /var/log/apache2 -type f) ; do
echo "Removing file '$file'"
sudo rm -f "$file"
done
echo "* Stopping all VMs ..."
sudo killall kvm
sleep 2
echo "* Unmounting ramdrive ..."
umount /opt/stack/data/nova/instances

View File

@ -1,7 +1,8 @@
#!/bin/bash
if [ -z "$1" ] ; then
source ./localrc
if [[ -z "$1" ]] ; then
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi
@ -16,84 +17,39 @@ die_if_not_set NOVA_CACHE_TMPFS_SIZE
#-----------------
restart_service dbus rabbitmq-server
# Moving MySQL database to tmpfs
#-------------------------------
if [[ $(trueorfalse True $MYSQL_DB_TMPFS) = "True" ]] ; then
die_if_not_set MYSQL_DB_TMPFS_SIZE
mount_dir=/var/lib/mysql
sudo -s << EOF
echo "Stopping MySQL Server"
service mysql stop
umount $mount_dir
mount -t tmpfs -o size=$MYSQL_DB_TMPFS_SIZE tmpfs $mount_dir
chmod 700 $mount_dir
chown mysql:mysql $mount_dir
mysql_install_db
/usr/bin/mysqld_safe --skip-grant-tables &
sleep 5
EOF
sudo mysql << EOF
FLUSH PRIVILEGES;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('swordfish');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('swordfish');
EOF
sudo -s << EOF
killall mysqld
sleep 5
echo "Starting MySQL Server"
service mysql start
EOF
else
echo "MYSQL_DB_TMPFS = '$MYSQL_DB_TMPFS'"
if [[ ,$INSTALL_MODE, =~ ',standalone,multihost,controller,' ]] ; then
restart_service dbus rabbitmq-server
fi
if [[ ,$INSTALL_MODE, =~ ',standalone,multihost,controller,' ]] ; then
move_mysql_data_to_ramdrive
fi
#-------------------------------
# Devstack log folder
#--------------------
sudo -s << EOF
mkdir -p $SCREEN_LOGDIR
chown stack:stack $SCREEN_LOGDIR
mkdir -p $SCREEN_LOGDIR
chown stack:stack $SCREEN_LOGDIR
EOF
#--------------------
# Moving nova images cache to tmpfs
#----------------------------------
if [[ $(trueorfalse True $NOVA_CACHE_TMPFS) = "True" ]] ; then
die_if_not_set NOVA_CACHE_TMPFS_SIZE
mount_dir=/opt/stack/data/nova/instances
sudo -s << EOF
umount $mount_dir
mount -t tmpfs -o size=$NOVA_CACHE_TMPFS_SIZE tmpfs $mount_dir
chmod 775 $mount_dir
chown stack:stack $mount_dir
EOF
else
echo "NOVA_CACHE_TMPFS = '$NOVA_CACHE_TMPFS'"
fi
#----------------------------------
# Replacing devstack's localrc config
#------------------------------------
if [[ -f "devstack.localrc" ]] ; then
rm -f "$DEVSTACK_DIR/localrc"
cp devstack.localrc "$DEVSTACK_DIR/localrc"
else
echo "File 'devstack.localrc' not found!"
fi
#------------------------------------
case $INSTALL_MODE in
'standalone')
update_devstack_localrc 'standalone'
;;
'multihost')
update_devstack_localrc 'controller'
;;
'controller')
update_devstack_localrc 'controller'
;;
'compute')
update_devstack_localrc 'compute'
;;
esac
#===============================================================================

View File

@ -1,6 +1,7 @@
#!/bin/bash
if [[ -z "$1" ]] ; then
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi

View File

@ -0,0 +1,53 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 67.207.197.34
netmask 255.255.255.240
gateway 67.207.197.33
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 208.166.50.13 67.207.201.6
dns-search svwh.net
auto eth0.260
iface eth0.260 inet manual
vlan-raw-device eth0
post-up ifconfig $IFACE 172.18.124.102/29
# post-up route add -net 172.18.0.0/16 gw 172.18.124.97
# pre-down route del -net 172.18.0.0/16 gw 172.18.124.97
post-up ip route add default via 172.18.124.97 dev $IFACE table 260
post-up ip rule add from 172.18.124.96/29 to 172.18.0.0/16 table 260
pre-down ip rule del from 172.18.124.96/29 to 172.18.0.0/16
pre-down ip route del table 260
pre-down ifconfig $IFACE 0.0.0.0
auto eth0.261
iface eth0.261 inet manual
vlan-raw-device eth0
post-up ifconfig $IFACE 172.18.124.202/26
post-up route add -net 172.18.0.0/16 gw 172.18.124.193 dev $IFACE
pre-down route del -net 172.18.0.0/16 gw 172.18.124.193 dev $IFACE
pre-down ifconfig $IFACE 0.0.0.0
auto eth1
iface eth1 inet manual
up ifconfig $IFACE up
down ifconfig $IFACE down
# up ifconfig $IFACE 0.0.0.0
#auto eth1.221
#iface eth1.221 inet manual
# vlan-raw-device eth1
# pre-up ifconfig $IFACE up
# post-down ifconfig $IFACE down
# up ifconfig $IFACE 0.0.0.0

View File

@ -0,0 +1,54 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 67.207.197.36
netmask 255.255.255.240
network 67.207.197.32
broadcast 67.207.197.47
gateway 67.207.197.33
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 208.166.50.13 67.207.206.1
dns-search svwh.net
auto eth0.260
iface eth0.260 inet manual
vlan-raw-device eth0
post-up ifconfig $IFACE 172.18.124.100/29
post-up ip route add default via 172.18.124.97 dev $IFACE table 260
post-up ip rule add from 172.18.124.96/29 to 172.18.0.0/16 table 260
pre-down ip rule del from 172.18.124.96/29 to 172.18.0.0/16 table 260
pre-down ip route del table 260
pre-down ifconfig $IFACE 0.0.0.0
# post-up route add -net 172.18.0.0/16 gw 172.18.124.97
# post-down route del -net 172.18.0.0/16 gw 172.18.124.97
auto eth1
iface eth1 inet manual
up ifconfig $IFACE up
down ifconfig $IFACE down
# up ifconfig $IFACE 0.0.0.0
auto eth0.261
iface eth0.261 inet manual
vlan-raw-device eth0
post-up ifconfig $IFACE 172.18.124.200/26
post-up route add -net 172.18.0.0/16 gw 172.18.124.193 dev $IFACE
pre-down route del -net 172.18.0.0/16 gw 172.18.124.192 dev $IFACE
pre-down ifconfig $IFACE 0.0.0.0
#auto eth1.221
#iface eth1.221 inet manual
# vlan-raw-device eth1
# pre-up ifconfig $IFACE up
# post-down ifcofnig $IFACE down

View File

@ -0,0 +1,27 @@
# Devstack's config file for STANDALONE installation
lab_id=101
lab_password=swordfish
HOST_IP=172.18.124.${lab_id}
FIXED_RANGE=10.0.${lab_id}.0/24
FLAT_INTERFACE=eth1
ADMIN_PASSWORD=$lab_password
MYSQL_PASSWORD=$lab_password
RABBIT_PASSWORD=$lab_password
SERVICE_PASSWORD=$lab_password
SERVICE_TOKEN=tokentoken
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
ENABLED_SERVICES+=,conductor,portas
SCREEN_LOGDIR=/opt/stack/log/
LOGFILE=$SCREEN_LOGDIR/stack.sh.log
API_RATE_LIMIT=False
EXTRA_OPTS=(force_config_drive=true libvirt_images_type=qcow2 force_raw_images=false)

View File

@ -1,17 +1,41 @@
#!/bin/bash
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
INSTALL_MODE="$1"
validate_install_mode
# Update devstack-scripts if multihost
#===============================================================================
if [[ "$INSTALL_MODE" == 'multihost' ]] ; then
_echo "* Copying devstack-scripts to compute nodes ..."
for __compute_node in $COMPUTE_NODE_LIST ; do
_echo "** Removing devstack-scripts on '$__compute_node' ..."
ssh stack@$__compute_node rm -rf ~/devstack-scripts
_echo "** Copying devstack-scripts to '$__compute_node' ..."
scp -r $SCRIPTS_DIR stack@$__compute_node:~/
done
fi
#===============================================================================
# Executing pre-stack actions
#===============================================================================
source ./pre-stack.sh no-localrc
_echo "* Executing pre-stack actions ..."
source $SCRIPTS_DIR/pre-stack.sh no-localrc
#===============================================================================
# Creating stack
#===============================================================================
_echo "* Starting devstack ..."
$DEVSTACK_DIR/stack.sh
#===============================================================================
@ -19,8 +43,21 @@ $DEVSTACK_DIR/stack.sh
# Executing post-stack actions
#===============================================================================
source ./post-stack.sh no-localrc
source ./start-keero.sh no-localrc
_echo "* Executing post-stack actions ..."
source $SCRIPTS_DIR/post-stack.sh no-localrc
#source $SCRIPTS_DIR/start-keero.sh no-localrc
#===============================================================================
# Start installation on compute nodes
#===============================================================================
if [[ "$INSTALL_MODE" == 'multihost' ]] ; then
_echo "* Starting devstack on compute nodes ..."
for __compute_node in $COMPUTE_NODE_LIST ; do
_echo "** Starting devstack on '$__compute_node' ..."
ssh stack@$__compute_node $SCRIPTS_DIR/start-devstack.sh compute
done
fi
#===============================================================================

View File

@ -1,7 +1,8 @@
#!/bin/bash
if [[ -z "$1" ]] ; then
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi
die_if_not_set INSTALL_DIR

View File

@ -1,23 +1,45 @@
#!/bin/bash
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
INSTALL_MODE="$1"
validate_install_mode
# Executing pre-unstack actions
#===============================================================================
source ./pre-unstack.sh no-localrc
_echo "* Executing pre-unstack actions ..."
source $SCRIPTS_DIR/pre-unstack.sh no-localrc
#===============================================================================
# Executing unstack.sh
#===============================================================================
_echo "* Executing stop devstack ..."
$DEVSTACK_DIR/unstack.sh
#===============================================================================
# Executing post-unstack actions
#===============================================================================
source ./post-unstack.sh no-localrc
source ./stop-keero.sh no-localrc
_echo "* Executing post-unstack actions ..."
source $SCRIPTS_DIR/post-unstack.sh no-localrc
#source $SCRIPTS_DIR/stop-keero.sh no-localrc
#===============================================================================
# Stop installation on compute nodes
#===============================================================================
if [[ "$INSTALL_MODE" == 'multihost' ]] ; then
_echo "* Stopping devstack on compute nodes ..."
for $__compute_node in $COMPUTE_NODE_LIST ; do
_echo "** Stopping devstack on '$__compute_node' ..."
ssh stack@$__compute_node $SCRIPTS_DIR/stop-devstack.sh
done
fi
#===============================================================================

View File

@ -1,7 +1,8 @@
#!/bin/bash
if [[ -z "$1" ]] ; then
source ./localrc
SCRIPTS_DIR=$( cd $( dirname "$0" ) && pwd )
source $SCRIPTS_DIR/localrc
fi
# Stopping Keero components