Name the tgt/conf.d enties based on the vg name

On one system multiple volume and volume manger could be installed and
needs dedicated tgt config entries.
cinder-volumes, stack-volumes, nova-volumes are the default volume group
names.
/etc/tgt/conf.d/ files should be named based on the volume-group name.
The vg name is uniq on one system.
In devstack case the stack.conf is usable.

Changes:
* Rename conf.d/cinder.conf to conf.d/stack.conf
* Handle conf.d similary on all distribution

Change-Id: I856cdf4a21a414d2940d8f9d8b0b0368b1fad887
This commit is contained in:
Attila Fazekas 2012-12-01 10:42:46 +01:00
parent fb501d01ac
commit b79574b495

View File

@ -9,12 +9,12 @@
# stack.sh # stack.sh
# --------- # ---------
# install_XXX # install_cinder
# configure_XXX # configure_cinder
# init_XXX # init_cinder
# start_XXX # start_cinder
# stop_XXX # stop_cinder
# cleanup_XXX # cleanup_cinder
# Save trace setting # Save trace setting
XTRACE=$(set +o | grep xtrace) XTRACE=$(set +o | grep xtrace)
@ -229,7 +229,7 @@ function install_cinder() {
# apply config.d approach (e.g. Oneiric does not have this) # apply config.d approach (e.g. Oneiric does not have this)
function _configure_tgt_for_config_d() { function _configure_tgt_for_config_d() {
if [[ ! -d /etc/tgt/conf.d/ ]]; then if [[ ! -d /etc/tgt/conf.d/ ]]; then
sudo mkdir /etc/tgt/conf.d sudo mkdir -p /etc/tgt/conf.d
echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf
fi fi
} }
@ -237,11 +237,11 @@ function _configure_tgt_for_config_d() {
# start_cinder() - Start running processes, including screen # start_cinder() - Start running processes, including screen
function start_cinder() { function start_cinder() {
if is_service_enabled c-vol; then if is_service_enabled c-vol; then
_configure_tgt_for_config_d
if [[ ! -f /etc/tgt/conf.d/stack.conf ]]; then
echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/stack.conf
fi
if is_ubuntu; then if is_ubuntu; then
_configure_tgt_for_config_d
if [[ ! -f /etc/tgt/conf.d/cinder.conf ]]; then
echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/cinder.conf
fi
# tgt in oneiric doesn't restart properly if tgtd isn't running # tgt in oneiric doesn't restart properly if tgtd isn't running
# do it in two steps # do it in two steps
sudo stop tgt || true sudo stop tgt || true