Browse code

Merge "Add the ability to activate Nova ceph without Cinder"

Jenkins authored on 2014/10/28 12:16:17
Showing 2 changed files
... ...
@@ -26,8 +26,9 @@ if is_service_enabled ceph; then
26 26
         if is_service_enabled cinder; then
27 27
             echo_summary "Configuring Cinder for Ceph"
28 28
             configure_ceph_cinder
29
-            # NOTE (leseb): the part below is a requirement from Cinder in order to attach volumes
30
-            # so we should run the following within the if statement.
29
+        fi
30
+        if is_service_enabled cinder || is_service_enabled nova; then
31
+            # NOTE (leseb): the part below is a requirement to attach Ceph block devices
31 32
             echo_summary "Configuring libvirt secret"
32 33
             import_libvirt_secret_ceph
33 34
         fi
... ...
@@ -225,6 +225,11 @@ function configure_ceph_nova {
225 225
     iniset $NOVA_CONF libvirt images_type rbd
226 226
     iniset $NOVA_CONF libvirt images_rbd_pool ${NOVA_CEPH_POOL}
227 227
     iniset $NOVA_CONF libvirt images_rbd_ceph_conf ${CEPH_CONF_FILE}
228
+
229
+    if ! is_service_enabled cinder; then
230
+        sudo ceph -c ${CEPH_CONF_FILE} auth get-or-create client.${CINDER_CEPH_USER} mon "allow r" osd "allow class-read object_prefix rbd_children, allow rwx pool=${CINDER_CEPH_POOL}, allow rwx pool=${NOVA_CEPH_POOL},allow rx pool=${GLANCE_CEPH_POOL}" | sudo tee ${CEPH_CONF_DIR}/ceph.client.${CINDER_CEPH_USER}.keyring > /dev/null
231
+        sudo chown ${STACK_USER}:$(id -g -n $whoami) ${CEPH_CONF_DIR}/ceph.client.${CINDER_CEPH_USER}.keyring
232
+    fi
228 233
 }
229 234
 
230 235
 # configure_ceph_cinder() - Cinder config needs to come after Cinder is set up