Files
546656fc0543ec2bc5b422fd9eee17f1b8122758
devstack /unstack.sh

194 lines
4.1 KiB
Bash
Raw Normal View History

# **unstack.sh**
# mysql and rabbit are left running as OpenStack code refreshes
# do not require them to be restarted.
#
while getopts ":a" opt; do
case $opt in
a)
esac
done
# Import common functions
source $TOP_DIR/functions
source $TOP_DIR/lib/database
DATA_DIR=${DATA_DIR:-${DEST}/data}
echo "You are running this script as root."
echo "It might work but you will have a better day running it as $STACK_USER"
exit 1
fi
# Configure Projects
# ==================
# Plugin Phase 0: override_defaults - allow plugins to override
run_phase override_defaults
source $TOP_DIR/lib/apache
source $TOP_DIR/lib/tls
# Source project function libraries
source $TOP_DIR/lib/infra
source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/glance
source $TOP_DIR/lib/nova
Begin new lib/neutron Background for this work can be read on the mailing list: http://lists.openstack.org/pipermail/openstack-dev/2016-May/094063.html Usage of the new Neutron is by setting the following in ENABLED_SERVICES: * neutron-api * neutron-l3 * neutron-agent * neutron-dhcp * neutron-metadata-agent For now, the new neutron library supports just the ML2 plugin, with the Open vSwitch and Linux Bridge agents supported. All other Neutron plugins should be creating their own DevStack plugin if they wish for DevStack to support them. Many of them already do. Other notable changes compared to neutron-legacy: * Rely on the Neutron defaults, and force Neutron to make sane defaults instead of all kinds of knobs in DevStack. * Default to rootwrap daemon support * Use the security group driver by default * interface_driver can now use NEUTRON_AGENT (linuxbridge, openvswitch), since they are entrypoints in neutron's setup.cfg * Use NEUTRON_AGENT variable to determine which agent to run Works with NEUTRON_AGENT set to either "linuxbridge" or "openvswitch" Default is openvswitch for the time being. * Set ML2 configuration for VXLAN support * Remove Xen hypervisor stuff - it should be a plugin * Move L3 crud into separate service file: There's a lot of L3 configuration that was in the main neutron file, but a lot of it is self contained and can be moved into its own file. The new l3 service file will contain all the previous L3 plumbing and configuration that the OpenStack Gate expects, while also eventually moving the whole l3 network creation step into a single hook that can be overridden by plugins. * Introduce a check for a function "neutron_plugin_create_initial_networks" which will become the mechanism through which different topologies, and networking plugins can create and wire the initial networks that are created during a stack.sh run. The new lib/neutron is considered experimental, and followup patches will build upon this one. Existing users of lib/neutron-legacy should remain unharmed. Co-Authored-By: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp> Co-Authored-By: Dean Troyer <dtroyer@gmail.com> Change-Id: I31b6362c6d9992f425f2dedbbeff2568390a93da
2016年05月03日 09:03:09 -04:00
source $TOP_DIR/lib/neutron
# --------------
# Phase: source
if [[ -d $TOP_DIR/extras.d ]]; then
for i in $TOP_DIR/extras.d/*.sh; do
[[ -r $i ]] && source $i source
done
fi
Only use lsb_release for distro tags The existing GetOSVersion has a lot of unused code which is wrong in several ways - the only path tested in upstream CI is with lsb_release, because it's pre-installed on all nodes - the /etc/redhat-release checking probably still works, but is unnecessary - If using lsb_release, os_UPDATE has never actually been set. - the /etc/SuSE-release branch checking is broken if the lsb package is actually installed. lsb checking does not set os_UPDATE but yet the SuSE DISTRO setting relies on this to set a patch level (and so does some of the rpm tags). SuSE 11 is up to update 3, but the rpm matching is stuck hard-coded to update 2. I'm guessing installation is actually broken there. - the debian checking branch is broken. The VERSION tags have been removed and were not supposed to be relied on anyway (see notes in [1]) This simplifies things: - remove OSX checking (moved here after discussions in I31d0fdd30928ecc8d959a95838b1d3affd28ac6f) - only use the output of lsb_release. - A small best-effort check to pre-install lsb packages if not detected (that avoids chicken-egg-problem of package-install wrappers relying on os_* flags). - The unset os_UPDATE is removed. It's only previous use was for setting separate suse versions in the DISTRO element for matching during package installs (since removed) - DISTRO setting is modified to use the parts of os_RELEASE it wants. Per-above, this is the correct place to parse out specifics. - Call out the is_* functions, which are a better way to detect platforms - Export the variables as read-only, since they shouldn't be reset [1] http://sources.debian.net/src/base-files/7.5/debian/changelog/ Change-Id: I46a2c36d95327087085df07cb797eb91249a893c
2014年08月27日 16:15:32 +10:00
# ``os_RELEASE``, ``os_PACKAGE``, ``os_CODENAME``
# ==========
if is_service_enabled nova; then
stop_nova
fi
stop_placement
fi
fi
# Apache has the WSGI processes
if is_service_enabled horizon; then
cleanup_CA
# perfect, we should clean up cinder stop paths.
cleanup_cinder || /bin/true
if [[ -n "$UNSTACK_ALL" ]]; then
# Stop MySQL server
if is_service_enabled mysql; then
stop_service mysql
fi
stop_service postgresql
fi
if is_service_enabled rabbit; then
stop_service rabbitmq-server
fi
stop_neutron
cleanup_neutron
stop_etcd3
cleanup_etcd3
fi
stop_dstat
fi
SCREEN=$(which screen)
if [[ -n "$SCREEN" ]]; then
SESSION=$(screen -ls | awk "/[0-9]+.${SCREEN_NAME}/"'{ print 1ドル }')
screen -X -S $SESSION quit
fi
fi
# sure lvm2 (lvremove, /etc/lvm/lvm.conf, etc.) is here.
if is_service_enabled cinder && is_package_installed lvm2; then
# Using /bin/true here indicates a BUG - maybe the
# DEFAULT_VOLUME_GROUP_NAME doesn't exist? We should
# isolate this further down in lib/cinder cleanup.
clean_lvm_filter
fi