Merge "Fix DevStack Ceph on the Giant release"

This commit is contained in:
Jenkins 2014-11-11 11:02:08 +00:00 committed by Gerrit Code Review
commit ce9581ac95

View File

@ -71,6 +71,11 @@ CEPH_REPLICAS_SEQ=$(seq ${CEPH_REPLICAS})
# Functions
# ------------
function get_ceph_version {
local ceph_version_str=$(sudo ceph daemon mon.$(hostname) version | cut -d '"' -f 4)
echo $ceph_version_str
}
# import_libvirt_secret_ceph() - Imports Cinder user key into libvirt
# so it can connect to the Ceph cluster while attaching a Cinder block device
function import_libvirt_secret_ceph {
@ -154,10 +159,16 @@ EOF
sleep 5
done
# pools data and metadata were removed in the Giant release so depending on the version we apply different commands
local ceph_version=$(get_ceph_version)
# change pool replica size according to the CEPH_REPLICAS set by the user
sudo ceph -c ${CEPH_CONF_FILE} osd pool set data size ${CEPH_REPLICAS}
sudo ceph -c ${CEPH_CONF_FILE} osd pool set rbd size ${CEPH_REPLICAS}
sudo ceph -c ${CEPH_CONF_FILE} osd pool set metadata size ${CEPH_REPLICAS}
if [[ ${ceph_version%.*} -eq 0 ]] && [[ ${ceph_version##*.} -lt 87 ]]; then
sudo ceph -c ${CEPH_CONF_FILE} osd pool set rbd size ${CEPH_REPLICAS}
sudo ceph -c ${CEPH_CONF_FILE} osd pool set data size ${CEPH_REPLICAS}
sudo ceph -c ${CEPH_CONF_FILE} osd pool set metadata size ${CEPH_REPLICAS}
else
sudo ceph -c ${CEPH_CONF_FILE} osd pool set rbd size ${CEPH_REPLICAS}
fi
# create a simple rule to take OSDs instead of host with CRUSH
# then apply this rules to the default pool