Move Glance data and Nova state dirs out of source dir
* allow NOVA_STATE_PATH to be overridden, default is now /opt/stack/data/nova * add NOVA_INSTANCES_PATH to move the instances dir separately from the state dir * allow GLANCE_CACHE_DIR to be overridden, default is now /opt/stack/data/glance/cache * allow GLANCE_IMAGE_DIR to be overridden, default is inow /opt/stack/data/glance/images * set GLANCE_BIN_DIR to support entry points (future) * allow CINDER_STATE_PATH to be overridden, default is now /opt/stack/data/cinder Change-Id: If95dc19b957ef5b9b14397835cd0543f82717f50
This commit is contained in:
parent
eff0c6cf19
commit
50ac792157
15
lib/cinder
15
lib/cinder
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# - functions
|
# - functions
|
||||||
|
# - DEST, DATA_DIR must be defined
|
||||||
# - KEYSTONE_AUTH_* must be defined
|
# - KEYSTONE_AUTH_* must be defined
|
||||||
# SERVICE_{TENANT_NAME|PASSWORD} must be defined
|
# SERVICE_{TENANT_NAME|PASSWORD} must be defined
|
||||||
|
|
||||||
@ -25,14 +26,17 @@ set -o xtrace
|
|||||||
|
|
||||||
# set up default directories
|
# set up default directories
|
||||||
CINDER_DIR=$DEST/cinder
|
CINDER_DIR=$DEST/cinder
|
||||||
if [ -d $CINDER_DIR/bin ] ; then
|
CINDERCLIENT_DIR=$DEST/python-cinderclient
|
||||||
|
CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder}
|
||||||
|
CINDER_CONF_DIR=/etc/cinder
|
||||||
|
CINDER_CONF=$CINDER_CONF_DIR/cinder.conf
|
||||||
|
|
||||||
|
# Support entry points installation of console scripts
|
||||||
|
if [[ -d $CINDER_DIR/bin ]]; then
|
||||||
CINDER_BIN_DIR=$CINDER_DIR/bin
|
CINDER_BIN_DIR=$CINDER_DIR/bin
|
||||||
else
|
else
|
||||||
CINDER_BIN_DIR=/usr/local/bin
|
CINDER_BIN_DIR=/usr/local/bin
|
||||||
fi
|
fi
|
||||||
CINDERCLIENT_DIR=$DEST/python-cinderclient
|
|
||||||
CINDER_CONF_DIR=/etc/cinder
|
|
||||||
CINDER_CONF=$CINDER_CONF_DIR/cinder.conf
|
|
||||||
|
|
||||||
# Name of the lvm volume group to use/create for iscsi volumes
|
# Name of the lvm volume group to use/create for iscsi volumes
|
||||||
VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
|
VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
|
||||||
@ -112,6 +116,7 @@ function configure_cinder() {
|
|||||||
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
||||||
iniset $CINDER_CONF DEFAULT root_helper "sudo ${CINDER_ROOTWRAP}"
|
iniset $CINDER_CONF DEFAULT root_helper "sudo ${CINDER_ROOTWRAP}"
|
||||||
iniset $CINDER_CONF DEFAULT osapi_volume_extension cinder.api.openstack.volume.contrib.standard_extensions
|
iniset $CINDER_CONF DEFAULT osapi_volume_extension cinder.api.openstack.volume.contrib.standard_extensions
|
||||||
|
iniset $CINDER_CONF DEFAULT state_path $CINDER_STATE_PATH
|
||||||
|
|
||||||
if is_service_enabled qpid ; then
|
if is_service_enabled qpid ; then
|
||||||
iniset $CINDER_CONF DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid
|
iniset $CINDER_CONF DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid
|
||||||
@ -162,7 +167,7 @@ function init_cinder() {
|
|||||||
if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
|
if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $CINDER_DIR/volumes
|
mkdir -p $CINDER_STATE_PATH/volumes
|
||||||
|
|
||||||
if sudo vgs $VOLUME_GROUP; then
|
if sudo vgs $VOLUME_GROUP; then
|
||||||
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# - functions
|
# - functions
|
||||||
|
# - DATA_DIR must be defined
|
||||||
# - KEYSTONE_AUTH_* must be defined
|
# - KEYSTONE_AUTH_* must be defined
|
||||||
|
# - NOVA_DIR, NOVA_BIN_DIR, NOVA_STATE_PATH must be defined
|
||||||
# SERVICE_{TENANT_NAME|PASSWORD} must be defined
|
# SERVICE_{TENANT_NAME|PASSWORD} must be defined
|
||||||
# _configure_tgt_for_config_d() from lib/cinder
|
# _configure_tgt_for_config_d() from lib/cinder
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ function init_nvol() {
|
|||||||
if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
|
if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $NOVA_DIR/volumes
|
mkdir -p $NOVA_STATE_PATH/volumes
|
||||||
|
|
||||||
if sudo vgs $VOLUME_GROUP; then
|
if sudo vgs $VOLUME_GROUP; then
|
||||||
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
||||||
@ -97,7 +99,7 @@ function start_nvol() {
|
|||||||
if [[ ! -f /etc/tgt/conf.d/nova.conf ]]; then
|
if [[ ! -f /etc/tgt/conf.d/nova.conf ]]; then
|
||||||
_configure_tgt_for_config_d
|
_configure_tgt_for_config_d
|
||||||
sudo mkdir -p /etc/tgt/conf.d
|
sudo mkdir -p /etc/tgt/conf.d
|
||||||
echo "include $NOVA_DIR/volumes/*" | sudo tee /etc/tgt/conf.d/nova.conf
|
echo "include $NOVA_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/nova.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$os_PACKAGE" = "deb" ]]; then
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
@ -109,7 +111,7 @@ function start_nvol() {
|
|||||||
restart_service tgtd
|
restart_service tgtd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
screen_it n-vol "cd $NOVA_DIR && $NOVA_DIR/bin/nova-volume"
|
screen_it n-vol "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-volume"
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop_nvol() - Stop running processes (non-screen)
|
# stop_nvol() - Stop running processes (non-screen)
|
||||||
|
69
stack.sh
69
stack.sh
@ -317,11 +317,7 @@ source $TOP_DIR/lib/heat
|
|||||||
source $TOP_DIR/lib/quantum
|
source $TOP_DIR/lib/quantum
|
||||||
|
|
||||||
# Set the destination directories for OpenStack projects
|
# Set the destination directories for OpenStack projects
|
||||||
NOVA_DIR=$DEST/nova
|
|
||||||
HORIZON_DIR=$DEST/horizon
|
HORIZON_DIR=$DEST/horizon
|
||||||
GLANCE_DIR=$DEST/glance
|
|
||||||
GLANCECLIENT_DIR=$DEST/python-glanceclient
|
|
||||||
NOVACLIENT_DIR=$DEST/python-novaclient
|
|
||||||
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
|
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
|
||||||
NOVNC_DIR=$DEST/noVNC
|
NOVNC_DIR=$DEST/noVNC
|
||||||
SWIFT_DIR=$DEST/swift
|
SWIFT_DIR=$DEST/swift
|
||||||
@ -330,6 +326,33 @@ SWIFTCLIENT_DIR=$DEST/python-swiftclient
|
|||||||
QUANTUM_DIR=$DEST/quantum
|
QUANTUM_DIR=$DEST/quantum
|
||||||
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
|
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
|
||||||
|
|
||||||
|
# Nova defaults
|
||||||
|
NOVA_DIR=$DEST/nova
|
||||||
|
NOVACLIENT_DIR=$DEST/python-novaclient
|
||||||
|
NOVA_STATE_PATH=${NOVA_STATE_PATH:=$DATA_DIR/nova}
|
||||||
|
# INSTANCES_PATH is the previous name for this
|
||||||
|
NOVA_INSTANCES_PATH=${NOVA_INSTANCES_PATH:=${INSTANCES_PATH:=$NOVA_STATE_PATH/instances}}
|
||||||
|
|
||||||
|
# Support entry points installation of console scripts
|
||||||
|
if [[ -d $NOVA_DIR/bin ]]; then
|
||||||
|
NOVA_BIN_DIR=$NOVA_DIR/bin
|
||||||
|
else
|
||||||
|
NOVA_BIN_DIR=/usr/local/bin
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Glance defaults
|
||||||
|
GLANCE_DIR=$DEST/glance
|
||||||
|
GLANCECLIENT_DIR=$DEST/python-glanceclient
|
||||||
|
GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
|
||||||
|
GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
|
||||||
|
|
||||||
|
# Support entry points installation of console scripts
|
||||||
|
if [[ -d $GLANCE_DIR/bin ]]; then
|
||||||
|
GLANCE_BIN_DIR=$GLANCE_DIR/bin
|
||||||
|
else
|
||||||
|
GLANCE_BIN_DIR=/usr/local/bin
|
||||||
|
fi
|
||||||
|
|
||||||
# Default Quantum Plugin
|
# Default Quantum Plugin
|
||||||
Q_PLUGIN=${Q_PLUGIN:-openvswitch}
|
Q_PLUGIN=${Q_PLUGIN:-openvswitch}
|
||||||
# Default Quantum Port
|
# Default Quantum Port
|
||||||
@ -1062,13 +1085,11 @@ if is_service_enabled g-reg; then
|
|||||||
fi
|
fi
|
||||||
sudo chown `whoami` $GLANCE_CONF_DIR
|
sudo chown `whoami` $GLANCE_CONF_DIR
|
||||||
|
|
||||||
GLANCE_IMAGE_DIR=$DEST/glance/images
|
|
||||||
# Delete existing images
|
# Delete existing images
|
||||||
rm -rf $GLANCE_IMAGE_DIR
|
rm -rf $GLANCE_IMAGE_DIR
|
||||||
mkdir -p $GLANCE_IMAGE_DIR
|
mkdir -p $GLANCE_IMAGE_DIR
|
||||||
|
|
||||||
GLANCE_CACHE_DIR=$DEST/glance/cache
|
# Delete existing cache
|
||||||
# Delete existing images
|
|
||||||
rm -rf $GLANCE_CACHE_DIR
|
rm -rf $GLANCE_CACHE_DIR
|
||||||
mkdir -p $GLANCE_CACHE_DIR
|
mkdir -p $GLANCE_CACHE_DIR
|
||||||
|
|
||||||
@ -1144,7 +1165,7 @@ if is_service_enabled g-reg; then
|
|||||||
GLANCE_POLICY_JSON=$GLANCE_CONF_DIR/policy.json
|
GLANCE_POLICY_JSON=$GLANCE_CONF_DIR/policy.json
|
||||||
cp $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
|
cp $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
|
||||||
|
|
||||||
$GLANCE_DIR/bin/glance-manage db_sync
|
$GLANCE_BIN_DIR/glance-manage db_sync
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1613,15 +1634,15 @@ EOF'
|
|||||||
# ~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
# Nova stores each instance in its own directory.
|
# Nova stores each instance in its own directory.
|
||||||
mkdir -p $NOVA_DIR/instances
|
mkdir -p $NOVA_INSTANCES_PATH
|
||||||
|
|
||||||
# You can specify a different disk to be mounted and used for backing the
|
# You can specify a different disk to be mounted and used for backing the
|
||||||
# virtual machines. If there is a partition labeled nova-instances we
|
# virtual machines. If there is a partition labeled nova-instances we
|
||||||
# mount it (ext filesystems can be labeled via e2label).
|
# mount it (ext filesystems can be labeled via e2label).
|
||||||
if [ -L /dev/disk/by-label/nova-instances ]; then
|
if [ -L /dev/disk/by-label/nova-instances ]; then
|
||||||
if ! mount -n | grep -q $NOVA_DIR/instances; then
|
if ! mount -n | grep -q $NOVA_INSTANCES_PATH; then
|
||||||
sudo mount -L nova-instances $NOVA_DIR/instances
|
sudo mount -L nova-instances $NOVA_INSTANCES_PATH
|
||||||
sudo chown -R `whoami` $NOVA_DIR/instances
|
sudo chown -R `whoami` $NOVA_INSTANCES_PATH
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1640,15 +1661,15 @@ EOF'
|
|||||||
sudo iscsiadm --mode node | grep $VOLUME_NAME_PREFIX | cut -d " " -f2 | sudo iscsiadm --mode node --op delete || true
|
sudo iscsiadm --mode node | grep $VOLUME_NAME_PREFIX | cut -d " " -f2 | sudo iscsiadm --mode node --op delete || true
|
||||||
|
|
||||||
# Clean out the instances directory.
|
# Clean out the instances directory.
|
||||||
sudo rm -rf $NOVA_DIR/instances/*
|
sudo rm -rf $NOVA_INSTANCES_PATH/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_service_enabled n-net q-dhcp; then
|
if is_service_enabled n-net q-dhcp; then
|
||||||
# Delete traces of nova networks from prior runs
|
# Delete traces of nova networks from prior runs
|
||||||
sudo killall dnsmasq || true
|
sudo killall dnsmasq || true
|
||||||
clean_iptables
|
clean_iptables
|
||||||
rm -rf $NOVA_DIR/networks
|
rm -rf $NOVA_STATE_PATH/networks
|
||||||
mkdir -p $NOVA_DIR/networks
|
mkdir -p $NOVA_STATE_PATH/networks
|
||||||
|
|
||||||
# Force IP forwarding on, just on case
|
# Force IP forwarding on, just on case
|
||||||
sudo sysctl -w net.ipv4.ip_forward=1
|
sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
@ -1918,13 +1939,6 @@ elif is_service_enabled n-vol; then
|
|||||||
init_nvol
|
init_nvol
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Support entry points installation of console scripts
|
|
||||||
if [ -d $NOVA_DIR/bin ] ; then
|
|
||||||
NOVA_BIN_DIR=$NOVA_DIR/bin
|
|
||||||
else
|
|
||||||
NOVA_BIN_DIR=/usr/local/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
NOVA_CONF=nova.conf
|
NOVA_CONF=nova.conf
|
||||||
function add_nova_opt {
|
function add_nova_opt {
|
||||||
echo "$1" >> $NOVA_CONF_DIR/$NOVA_CONF
|
echo "$1" >> $NOVA_CONF_DIR/$NOVA_CONF
|
||||||
@ -2016,8 +2030,11 @@ elif [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; then
|
|||||||
fi
|
fi
|
||||||
add_nova_opt "glance_api_servers=$GLANCE_HOSTPORT"
|
add_nova_opt "glance_api_servers=$GLANCE_HOSTPORT"
|
||||||
add_nova_opt "force_dhcp_release=True"
|
add_nova_opt "force_dhcp_release=True"
|
||||||
if [ -n "$INSTANCES_PATH" ]; then
|
if [ -n "$NOVA_STATE_PATH" ]; then
|
||||||
add_nova_opt "instances_path=$INSTANCES_PATH"
|
add_nova_opt "state_path=$NOVA_STATE_PATH"
|
||||||
|
fi
|
||||||
|
if [ -n "$NOVA_INSTANCES_PATH" ]; then
|
||||||
|
add_nova_opt "instances_path=$NOVA_INSTANCES_PATH"
|
||||||
fi
|
fi
|
||||||
if [ "$MULTI_HOST" != "False" ]; then
|
if [ "$MULTI_HOST" != "False" ]; then
|
||||||
add_nova_opt "multi_host=True"
|
add_nova_opt "multi_host=True"
|
||||||
@ -2124,12 +2141,12 @@ fi
|
|||||||
|
|
||||||
# Launch the glance registry service
|
# Launch the glance registry service
|
||||||
if is_service_enabled g-reg; then
|
if is_service_enabled g-reg; then
|
||||||
screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
|
screen_it g-reg "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Launch the glance api and wait for it to answer before continuing
|
# Launch the glance api and wait for it to answer before continuing
|
||||||
if is_service_enabled g-api; then
|
if is_service_enabled g-api; then
|
||||||
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
|
screen_it g-api "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
|
||||||
echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
|
echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
|
||||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
|
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
|
||||||
echo "g-api did not start"
|
echo "g-api did not start"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user