setup-storage-telemetry.sh 1.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/bin/sh

##
## Setup a OpenStack Storage Node for Telemetry
##

set -x

# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
    echo "This script must be run as root" 1>&2
    exit 1
fi

# Grab our libs
. "`dirname $0`/setup-lib.sh"

if [ "$HOSTNAME" != "$STORAGEHOST" ]; then
    exit 0;
fi

if [ -f $OURDIR/setup-storage-telemetry-done ]; then
    exit 0
fi

26 27
logtstart "storage-telemetry"

28 29 30 31
if [ -f $SETTINGS ]; then
    . $SETTINGS
fi

32 33

crudini --set /etc/cinder/cinder.conf DEFAULT control_exchange cinder
34 35 36 37 38
if [ $OSVERSION -lt $OSMITAKA ]; then
    crudini --set /etc/cinder/cinder.conf DEFAULT notification_driver messagingv2
else
    crudini --set /etc/cinder/cinder.conf oslo_messaging_notifications driver messagingv2
fi
39
#notification_driver = cinder.openstack.common.notifier.rpc_notifier
40

41 42 43 44
if [ -x /usr/bin/cinder-volume-usage-audit ]; then
    echo "*/5 * * * * /usr/bin/cinder-volume-usage-audit --send_actions" >> /etc/crontab
fi

45 46
service_restart cinder-volume
service_enable cinder-volume
47 48 49

touch $OURDIR/setup-storage-telemetry-done

50 51
logtend "storage-telemetry"

52
exit 0