Skip to content

Commit fa16ae9

Browse files
author
Sébastien Han
committed
Add the ability to activate Nova ceph without Cinder
Prior to this patch, if we wanted to boot a VM in Ceph using libvirt_image_type we must had Cinder enabled. This patch allows you to use libvirt_image_type without having Cinder enabled. Change-Id: Ia61e6effc5a4ccba69f4fa48f6e9984f15bb8979 Signed-off-by: Sébastien Han <[email protected]>
1 parent 552459c commit fa16ae9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

extras.d/60-ceph.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ if is_service_enabled ceph; then
2626
if is_service_enabled cinder; then
2727
echo_summary "Configuring Cinder for Ceph"
2828
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
3132
echo_summary "Configuring libvirt secret"
3233
import_libvirt_secret_ceph
3334
fi

lib/ceph

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ function configure_ceph_nova {
221221
iniset $NOVA_CONF libvirt images_type rbd
222222
iniset $NOVA_CONF libvirt images_rbd_pool ${NOVA_CEPH_POOL}
223223
iniset $NOVA_CONF libvirt images_rbd_ceph_conf ${CEPH_CONF_FILE}
224+
225+
if ! is_service_enabled cinder; then
226+
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
227+
sudo chown ${STACK_USER}:$(id -g -n $whoami) ${CEPH_CONF_DIR}/ceph.client.${CINDER_CEPH_USER}.keyring
228+
fi
224229
}
225230

226231
# configure_ceph_cinder() - Cinder config needs to come after Cinder is set up

0 commit comments

Comments
 (0)