Browse code

Merge "Setup tgtd configuration files"

Jenkins authored on 2012/08/02 08:58:34
Showing 2 changed files
... ...
@@ -142,6 +142,8 @@ function init_cinder() {
142 142
             if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
143 143
         fi
144 144
 
145
+        mkdir -p $CINDER_DIR/volumes
146
+
145 147
         if sudo vgs $VOLUME_GROUP; then
146 148
             if [[ "$os_PACKAGE" = "rpm" ]]; then
147 149
                 # RPM doesn't start the service
... ...
@@ -171,6 +173,9 @@ function install_cinder() {
171 171
 function start_cinder() {
172 172
     if is_service_enabled c-vol; then
173 173
         if [[ "$os_PACKAGE" = "deb" ]]; then
174
+            if [[ ! -f /etc/tgt/conf.d/cinder.conf ]]; then
175
+               echo "include $CINDER_DIR/volumes/*" | sudo tee /etc/tgt/conf.d/cinder.conf
176
+            fi
174 177
             # tgt in oneiric doesn't restart properly if tgtd isn't running
175 178
             # do it in two steps
176 179
             sudo stop tgt || true
... ...
@@ -1700,6 +1700,9 @@ elif is_service_enabled n-vol; then
1700 1700
             start_service tgtd
1701 1701
         fi
1702 1702
 
1703
+        # Setup tgtd configuration files
1704
+        mkdir -p $NOVA_DIR/volumes
1705
+
1703 1706
         # Remove nova iscsi targets
1704 1707
         sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
1705 1708
         # Clean out existing volumes
... ...
@@ -1712,6 +1715,12 @@ elif is_service_enabled n-vol; then
1712 1712
     fi
1713 1713
 
1714 1714
     if [[ "$os_PACKAGE" = "deb" ]]; then
1715
+
1716
+        # Setup the tgt configuration file
1717
+        if [[ ! -f /etc/tgt/conf.d/nova.conf ]]; then
1718
+           echo "include $NOVA_DIR/volumes/*" | sudo tee /etc/tgt/conf.d/nova.conf
1719
+        fi
1720
+
1715 1721
         # tgt in oneiric doesn't restart properly if tgtd isn't running
1716 1722
         # do it in two steps
1717 1723
         sudo stop tgt || true