From b79574b4954406d6d9e65ce5b1fb8d07678e7128 Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Sat, 1 Dec 2012 10:42:46 +0100 Subject: [PATCH] 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 --- lib/cinder | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/cinder b/lib/cinder index ce160bf0c1..039c5cba73 100644 --- a/lib/cinder +++ b/lib/cinder @@ -9,12 +9,12 @@ # stack.sh # --------- -# install_XXX -# configure_XXX -# init_XXX -# start_XXX -# stop_XXX -# cleanup_XXX +# install_cinder +# configure_cinder +# init_cinder +# start_cinder +# stop_cinder +# cleanup_cinder # Save trace setting XTRACE=$(set +o | grep xtrace) @@ -229,7 +229,7 @@ function install_cinder() { # apply config.d approach (e.g. Oneiric does not have this) function _configure_tgt_for_config_d() { 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 fi } @@ -237,11 +237,11 @@ function _configure_tgt_for_config_d() { # start_cinder() - Start running processes, including screen function start_cinder() { 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 - _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 # do it in two steps sudo stop tgt || true