Ensure that only the peer/cluster leader tries to create the cinder pool

This commit is contained in:
James Page 2013-02-26 15:06:59 +00:00
parent e8021d60aa
commit 630ebaeb3c
1 changed files with 6 additions and 3 deletions

View File

@ -176,9 +176,12 @@ EOF
# in preparation for move to start-stop-daemon.
echo "env CEPH_ARGS=\"--id $SERVICE_NAME\"" > /etc/init/cinder-volume.override
# Create the cinder pool if it does not already exist
if ! rados --id $SERVICE_NAME lspools | grep -q cinder; then
rados --id $SERVICE_NAME mkpool cinder
# Only the leader should try to create pools
if eligible_leader 'res_cinder_vip'; then
# Create the cinder pool if it does not already exist
if ! rados --id $SERVICE_NAME lspools | grep -q cinder; then
rados --id $SERVICE_NAME mkpool cinder
fi
fi
# Reconfigure cinder-volume