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
| ... | ... |
@@ -9,12 +9,12 @@ |
| 9 | 9 |
|
| 10 | 10 |
# stack.sh |
| 11 | 11 |
# --------- |
| 12 |
-# install_XXX |
|
| 13 |
-# configure_XXX |
|
| 14 |
-# init_XXX |
|
| 15 |
-# start_XXX |
|
| 16 |
-# stop_XXX |
|
| 17 |
-# cleanup_XXX |
|
| 12 |
+# install_cinder |
|
| 13 |
+# configure_cinder |
|
| 14 |
+# init_cinder |
|
| 15 |
+# start_cinder |
|
| 16 |
+# stop_cinder |
|
| 17 |
+# cleanup_cinder |
|
| 18 | 18 |
|
| 19 | 19 |
# Save trace setting |
| 20 | 20 |
XTRACE=$(set +o | grep xtrace) |
| ... | ... |
@@ -229,7 +229,7 @@ function install_cinder() {
|
| 229 | 229 |
# apply config.d approach (e.g. Oneiric does not have this) |
| 230 | 230 |
function _configure_tgt_for_config_d() {
|
| 231 | 231 |
if [[ ! -d /etc/tgt/conf.d/ ]]; then |
| 232 |
- sudo mkdir /etc/tgt/conf.d |
|
| 232 |
+ sudo mkdir -p /etc/tgt/conf.d |
|
| 233 | 233 |
echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf |
| 234 | 234 |
fi |
| 235 | 235 |
} |
| ... | ... |
@@ -237,11 +237,11 @@ function _configure_tgt_for_config_d() {
|
| 237 | 237 |
# start_cinder() - Start running processes, including screen |
| 238 | 238 |
function start_cinder() {
|
| 239 | 239 |
if is_service_enabled c-vol; then |
| 240 |
+ _configure_tgt_for_config_d |
|
| 241 |
+ if [[ ! -f /etc/tgt/conf.d/stack.conf ]]; then |
|
| 242 |
+ echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/stack.conf |
|
| 243 |
+ fi |
|
| 240 | 244 |
if is_ubuntu; then |
| 241 |
- _configure_tgt_for_config_d |
|
| 242 |
- if [[ ! -f /etc/tgt/conf.d/cinder.conf ]]; then |
|
| 243 |
- echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/cinder.conf |
|
| 244 |
- fi |
|
| 245 | 245 |
# tgt in oneiric doesn't restart properly if tgtd isn't running |
| 246 | 246 |
# do it in two steps |
| 247 | 247 |
sudo stop tgt || true |