Index: git/ocf/cinder-volume =================================================================== --- git.orig/ocf/cinder-volume +++ git/ocf/cinder-volume @@ -55,6 +55,20 @@ OCF_RESKEY_multibackend_default="false" ####################################################################### +####################################################################### + +# +# The following file is used to determine if Cinder-Volume should be +# failed if the AMQP check does not pass. Cinder-Volume initializes +# it's backend before connecting to Rabbit. In Ceph configurations, +# Cinder-Volume will not connect to Rabbit until the storage blades +# are provisioned (this can take a long time, no need to restart the +# process over and over again). +VOLUME_FAIL_ON_AMQP_CHECK_FILE="$HA_RSCTMP/$OCF_RESOURCE_INSTANCE.fail_on_amqp_check" + +####################################################################### + + usage() { cat <> /dev/null 2>&1 + ocf_log debug "OpenStack Cinder Volume (cinder-volume) monitor succeeded" return $OCF_SUCCESS } @@ -260,6 +286,10 @@ cinder_volume_monitor() { cinder_volume_start() { local rc + if [ -e "$VOLUME_FAIL_ON_AMQP_CHECK_FILE" ] ; then + rm $VOLUME_FAIL_ON_AMQP_CHECK_FILE >> /dev/null 2>&1 + fi + cinder_volume_status rc=$? if [ $rc -eq $OCF_SUCCESS ]; then @@ -293,6 +323,10 @@ cinder_volume_confirm_stop() { local my_bin local my_processes + if [ -e "$VOLUME_FAIL_ON_AMQP_CHECK_FILE" ] ; then + rm $VOLUME_FAIL_ON_AMQP_CHECK_FILE >> /dev/null 2>&1 + fi + my_binary=`which ${OCF_RESKEY_binary}` my_processes=`pgrep -l -f "^(python|/usr/bin/python|/usr/bin/python2) ${my_binary}([^\w-]|$)"` @@ -307,6 +341,10 @@ cinder_volume_stop() { local rc local pid + if [ -e "$VOLUME_FAIL_ON_AMQP_CHECK_FILE" ] ; then + rm $VOLUME_FAIL_ON_AMQP_CHECK_FILE >> /dev/null 2>&1 + fi + cinder_volume_status rc=$? if [ $rc -eq $OCF_NOT_RUNNING ]; then