Commit db8df274 authored by David Johnson's avatar David Johnson

Add Cinder, Swift, Heat, Ceilometer, Trove, Sahara.

parent 684ff0f0
#!/bin/sh
##
## Setup a OpenStack compute node for Ceilometer.
##
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"
HOSTNAME=`hostname -s`
if [ "$HOSTNAME" = "$CONTROLLER" -o "$HOSTNAME" = "$NETWORKMANAGER" ]; then
exit 0;
fi
if [ -f $OURDIR/setup-compute-telemetry-done ]; then
exit 0
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
apt-get install -y ceilometer-agent-compute
# Just slap these in.
cat <<EOF >> /etc/nova/nova.conf
[DEFAULT]
instance_usage_audit = True
instance_usage_audit_period = hour
notify_on_state_change = vm_and_task_state
notification_driver = nova.openstack.common.notifier.rpc_notifier
notification_driver = ceilometer.compute.nova_notifier
EOF
service nova-compute restart
cat <<EOF >> /etc/ceilometer/ceilometer.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
verbose = True
log_dir = /var/log/ceilometer
[keystone_authtoken]
auth_uri = http://${CONTROLLER}:5000/v2.0
identity_uri = http://${CONTROLLER}:35357
admin_tenant_name = service
admin_user = ceilometer
admin_password = ${CEILOMETER_PASS}
[publisher]
# Secret value for signing metering messages (string value)
metering_secret = ${CEILOMETER_SECRET}
[service_credentials]
os_auth_url = http://${CONTROLLER}:5000/v2.0
os_username = ceilometer
os_tenant_name = service
os_password = ${CEILOMETER_PASS}
os_endpoint_type = internalURL
EOF
#sed -i -e "s/^\\(.*connection.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
service ceilometer-agent-compute restart
touch $OURDIR/setup-compute-telemetry-done
exit 0
......@@ -520,9 +520,693 @@ if [ -z "${DASHBOARD_DONE}" ]; then
echo "DASHBOARD_DONE=\"${DASHBOARD_DONE}\"" >> $SETTINGS
fi
#
# Install some block storage.
#
#if [ 0 -eq 1 -a -z "${CINDER_DBPASS}" ]; then
if [ -z "${CINDER_DBPASS}" ]; then
CINDER_DBPASS=`$PSWDGEN`
CINDER_PASS=`$PSWDGEN`
echo "create database cinder" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on cinder.* to 'cinder'@'localhost' identified by '$CINDER_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on cinder.* to 'cinder'@'%' identified by '$CINDER_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
keystone user-create --name cinder --pass $CINDER_PASS
keystone user-role-add --user cinder --tenant service --role admin
keystone service-create --name cinder --type volume \
--description "OpenStack Block Storage Service"
keystone service-create --name cinderv2 --type volumev2 \
--description "OpenStack Block Storage Service"
keystone endpoint-create \
--service-id `keystone service-list | awk '/ volume / {print $2}'` \
--publicurl http://controller:8776/v1/%\(tenant_id\)s \
--internalurl http://controller:8776/v1/%\(tenant_id\)s \
--adminurl http://controller:8776/v1/%\(tenant_id\)s \
--region regionOne
keystone endpoint-create \
--service-id `keystone service-list | awk '/ volumev2 / {print $2}'` \
--publicurl http://controller:8776/v2/%\(tenant_id\)s \
--internalurl http://controller:8776/v2/%\(tenant_id\)s \
--adminurl http://controller:8776/v2/%\(tenant_id\)s \
--region regionOne
apt-get install -y cinder-api cinder-scheduler python-cinderclient
# Just slap these in.
cat <<EOF >> /etc/cinder/cinder.conf
[database]
connection = mysql://cinder:${CINDER_DBPASS}@$CONTROLLER/cinder
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
my_ip = 192.168.0.3
verbose = True
glance_host = ${CONTROLLER}
[keystone_authtoken]
auth_uri = http://$CONTROLLER:5000/v2.0
identity_uri = http://$CONTROLLER:35357
admin_tenant_name = service
admin_user = cinder
admin_password = ${CINDER_PASS}
EOF
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/cinder/cinder.conf
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/cinder/cinder.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/cinder/cinder.conf
su -s /bin/sh -c "/usr/bin/cinder-manage db sync" cinder
service cinder-scheduler restart
service cinder-api restart
rm -f /var/lib/cinder/cinder.sqlite
echo "CINDER_DBPASS=\"${CINDER_DBPASS}\"" >> $SETTINGS
echo "CINDER_PASS=\"${CINDER_PASS}\"" >> $SETTINGS
fi
if [ -z "${STORAGE_HOST_DONE}" ]; then
fqdn="$STORAGEHOST.$EEID.$EPID.$OURDOMAIN"
if [ "${STORAGEHOST}" = "${CONTROLLER}" ]; then
$DIRNAME/setup-storage.sh
else
# Copy the latest settings (passwords, endpoints, whatever) over
scp -o StrictHostKeyChecking=no $SETTINGS $fqdn:$SETTINGS
ssh -o StrictHostKeyChecking=no $fqdn $DIRNAME/setup-storage.sh
fi
echo "STORAGE_HOST_DONE=\"1\"" >> $SETTINGS
fi
#
# Install some object storage.
#
#if [ 0 -eq 1 -a -z "${SWIFT_DBPASS}" ]; then
if [ -z "${SWIFT_PASS}" ]; then
SWIFT_PASS=`$PSWDGEN`
SWIFT_HASH_PATH_PREFIX=`$PSWDGEN`
SWIFT_HASH_PATH_SUFFIX=`$PSWDGEN`
keystone user-create --name swift --pass $SWIFT_PASS
keystone user-role-add --user swift --tenant service --role admin
keystone service-create --name swift --type object-store \
--description "OpenStack Object Storage Service"
keystone endpoint-create \
--service-id `keystone service-list | awk '/ object-store / {print $2}'` \
--publicurl http://controller:8080/v1/AUTH_%\(tenant_id\)s \
--internalurl http://controller:8080/v1/AUTH_%\(tenant_id\)s \
--adminurl http://controller:8080 \
--region regionOne
apt-get install -y swift swift-proxy python-swiftclient \
python-keystoneclient python-keystonemiddleware memcached
mkdir -p /etc/swift
curl -o /etc/swift/proxy-server.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/proxy-server.conf-sample
# Just slap these in.
cat <<EOF >> /etc/swift/proxy-server.conf
[DEFAULT]
bind_port = 8080
user = swift
swift_dir = /etc/swift
[pipeline:main]
pipeline = authtoken cache healthcheck keystoneauth proxy-logging proxy-server
[app:proxy-server]
allow_account_management = true
account_autocreate = true
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,_member_
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://${CONTROLLER}:5000/v2.0
identity_uri = http://${CONTROLLER}:35357
admin_tenant_name = service
admin_user = swift
admin_password = ${SWIFT_PASS}
delay_auth_decision = true
[filter:cache]
memcache_servers = 127.0.0.1:11211
EOF
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/swift/proxy-server.conf
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/swift/proxy-server.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/swift/proxy-server.conf
curl -o /etc/swift/swift.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/swift.conf-sample
# Just slap these in.
cat <<EOF >> /etc/swift/swift.conf
[swift-hash]
swift_hash_path_suffix = ${SWIFT_HASH_PATH_PREFIX}
swift_hash_path_prefix = ${SWIFT_HASH_PATH_SUFFIX}
[storage-policy:0]
name = Policy-0
default = yes
EOF
chown -R swift:swift /etc/swift
service memcached restart
swift-init proxy-server restart
echo "SWIFT_PASS=\"${SWIFT_PASS}\"" >> $SETTINGS
echo "SWIFT_HASH_PATH_PREFIX=\"${SWIFT_HASH_PATH_PREFIX}\"" >> $SETTINGS
echo "SWIFT_HASH_PATH_SUFFIX=\"${SWIFT_HASH_PATH_SUFFIX}\"" >> $SETTINGS
fi
if [ -z "${OBJECT_HOST_DONE}" ]; then
fqdn="$OBJECTHOST.$EEID.$EPID.$OURDOMAIN"
if [ "${OBJECTHOST}" = "${CONTROLLER}" ]; then
$DIRNAME/setup-object-storage.sh
else
# Copy the latest settings (passwords, endpoints, whatever) over
scp -o StrictHostKeyChecking=no $SETTINGS $fqdn:$SETTINGS
ssh -o StrictHostKeyChecking=no $fqdn $DIRNAME/setup-object-storage.sh
fi
echo "OBJECT_HOST_DONE=\"1\"" >> $SETTINGS
fi
if [ -z "${OBJECT_RING_DONE}" ]; then
cdir=`pwd`
cd /etc/swift
objip=`cat $OURDIR/mgmt-hosts | grep $OBJECTHOST | cut -d ' ' -f 1`
swift-ring-builder account.builder create 10 3 1
swift-ring-builder account.builder \
add r1z1-${objip}:6002/pv.objectstore.loop.1 100
swift-ring-builder account.builder rebalance
swift-ring-builder container.builder create 10 3 1
swift-ring-builder container.builder \
add r1z1-${objip}:6001/pv.objectstore.loop.1 100
swift-ring-builder container.builder rebalance
swift-ring-builder object.builder create 10 3 1
swift-ring-builder object.builder \
add r1z1-${objip}:6000/pv.objectstore.loop.1 100
swift-ring-builder object.builder rebalance
if [ "${OBJECTHOST}" != "${CONTROLLER}" ]; then
# Copy the latest settings
scp -o StrictHostKeyChecking=no account.ring.gz container.ring.gz object.ring.gz $OBJECTHOST:/etc/swift
fi
cd $cdir
echo "OBJECT_RING_DONE=\"1\"" >> $SETTINGS
fi
#
# Get Orchestrated
#
if [ -z "${HEAT_DBPASS}" ]; then
HEAT_DBPASS=`$PSWDGEN`
HEAT_PASS=`$PSWDGEN`
echo "create database heat" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on heat.* to 'heat'@'localhost' identified by '$HEAT_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on heat.* to 'heat'@'%' identified by '$HEAT_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
keystone user-create --name heat --pass $HEAT_PASS
keystone user-role-add --user heat --tenant service --role admin
keystone role-create --name heat_stack_owner
#keystone user-role-add --user demo --tenant demo --role heat_stack_owner
keystone role-create --name heat_stack_user
keystone service-create --name heat --type orchestration \
--description "OpenStack Orchestration Service"
keystone service-create --name heat-cfn --type cloudformation \
--description "OpenStack Orchestration Service"
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ orchestration / {print $2}') \
--publicurl http://${CONTROLLER}:8004/v1/%\(tenant_id\)s \
--internalurl http://${CONTROLLER}:8004/v1/%\(tenant_id\)s \
--adminurl http://${CONTROLLER}:8004/v1/%\(tenant_id\)s \
--region regionOne
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ cloudformation / {print $2}') \
--publicurl http://${CONTROLLER}:8000/v1 \
--internalurl http://${CONTROLLER}:8000/v1 \
--adminurl http://${CONTROLLER}:8000/v1 \
--region regionOne
apt-get install -y heat-api heat-api-cfn heat-engine python-heatclient
sed -i -e "s/^.*connection.*=.*$/connection = mysql:\\/\\/heat:${HEAT_DBPASS}@$CONTROLLER\\/heat/" /etc/heat/heat.conf
# Just slap these in.
cat <<EOF >> /etc/heat/heat.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
heat_metadata_server_url = http://${CONTROLLER}:8000
heat_waitcondition_server_url = http://${CONTROLLER}:8000/v1/waitcondition
verbose = True
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://$CONTROLLER:5000/v2.0
identity_uri = http://$CONTROLLER:35357
admin_tenant_name = service
admin_user = heat
admin_password = ${HEAT_PASS}
[ec2authtoken]
auth_uri = http://${CONTROLLER}:5000/v2.0
EOF
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/heat/heat.conf
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/heat/heat.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/heat/heat.conf
su -s /bin/sh -c "/usr/bin/heat-manage db_sync" heat
service heat-api restart
service heat-api-cfn restart
service heat-engine restart
rm -f /var/lib/heat/heat.sqlite
echo "HEAT_DBPASS=\"${HEAT_DBPASS}\"" >> $SETTINGS
echo "HEAT_PASS=\"${HEAT_PASS}\"" >> $SETTINGS
fi
#
# Get Telemeterized
#
if [ -z "${CEILOMETER_DBPASS}" ]; then
CEILOMETER_DBPASS=`$PSWDGEN`
CEILOMETER_PASS=`$PSWDGEN`
CEILOMETER_SECRET=`$PSWDGEN`
if [ "${CEILOMETER_USE_MONGODB}" = "1" ]; then
apt-get install -y mongodb-server
sed -i -e "s/^.*bind_ip.*=.*$/bind_ip = 192.168.0.3/" /etc/mongodb.conf
echo "smallfiles = true" >> /etc/mongodb.conf
service mongodb stop
rm /var/lib/mongodb/journal/prealloc.*
service mongodb start
mongo --host controller --eval "
db = db.getSiblingDB(\"ceilometer\");
db.addUser({user: \"ceilometer\",
pwd: \"${CEILOMETER_DBPASS}\",
roles: [ \"readWrite\", \"dbAdmin\" ]})"
else
apt-get install -y mariadb-server python-mysqldb
echo "create database ceilometer" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on ceilometer.* to 'ceilometer'@'localhost' identified by '$CEILOMETER_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on ceilometer.* to 'ceilometer'@'%' identified by '$CEILOMETER_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
fi
keystone user-create --name ceilometer --pass $CEILOMETER_PASS
keystone user-role-add --user ceilometer --tenant service --role admin
keystone service-create --name ceilometer --type metering \
--description "OpenStack Telemetry Service"
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ metering / {print $2}') \
--publicurl http://${CONTROLLER}:8777 \
--internalurl http://${CONTROLLER}:8777 \
--adminurl http://${CONTROLLER}:8777 \
--region regionOne
apt-get install -y ceilometer-api ceilometer-collector \
ceilometer-agent-central ceilometer-agent-notification \
ceilometer-alarm-evaluator ceilometer-alarm-notifier \
python-ceilometerclient python-pymongo python-bson
if [ "${CEILOMETER_USE_MONGODB}" = "1" ]; then
sed -i -e "s/^.*connection.*=.*$/connection = mongodb:\\/\\/ceilometer:${CEILOMETER_DBPASS}@$CONTROLLER:27017\\/ceilometer/" /etc/ceilometer/ceilometer.conf
else
sed -i -e "s/^.*connection.*=.*$/connection = mysql:\\/\\/ceilometer:${CEILOMETER_DBPASS}@$CONTROLLER\\/ceilometer\\?charset=utf8/" /etc/ceilometer/ceilometer.conf
fi
# Just slap these in.
cat <<EOF >> /etc/ceilometer/ceilometer.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
verbose = True
log_dir = /var/log/ceilometer
[keystone_authtoken]
auth_uri = http://$CONTROLLER:5000/v2.0
identity_uri = http://$CONTROLLER:35357
admin_tenant_name = service
admin_user = ceilometer
admin_password = ${CEILOMETER_PASS}
[service_credentials]
os_auth_url = http://${CONTROLLER}:5000/v2.0
os_username = ceilometer
os_tenant_name = service
os_password = ${CEILOMETER_PASS}
[publisher]
metering_secret = ${CEILOMETER_SECRET}
EOF
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/ceilometer/ceilometer.conf
su -s /bin/sh -c "ceilometer-dbsync" ceilometer
service ceilometer-agent-central restart
service ceilometer-agent-notification restart
service ceilometer-api restart
service ceilometer-collector restart
service ceilometer-alarm-evaluator restart
service ceilometer-alarm-notifier restart
echo "CEILOMETER_DBPASS=\"${CEILOMETER_DBPASS}\"" >> $SETTINGS
echo "CEILOMETER_PASS=\"${CEILOMETER_PASS}\"" >> $SETTINGS
echo "CEILOMETER_SECRET=\"${CEILOMETER_SECRET}\"" >> $SETTINGS
fi
#
# Install the Telemetry service on the compute nodes
#
if [ -z "${TELEMETRY_COMPUTENODES_DONE}" ]; then
TELEMETRY_COMPUTENODES_DONE=1
for node in $COMPUTENODES
do
fqdn="$node.$EEID.$EPID.$OURDOMAIN"
# Copy the latest settings (passwords, endpoints, whatever) over
scp -o StrictHostKeyChecking=no $SETTINGS $fqdn:$SETTINGS
ssh -o StrictHostKeyChecking=no $fqdn $DIRNAME/setup-compute-telemetry.sh
done
echo "TELEMETRY_COMPUTENODES_DONE=\"${TELEMETRY_COMPUTENODES_DONE}\"" >> $SETTINGS
fi
#
# Install the Telemetry service for Glance
#
if [ -z "${TELEMETRY_GLANCE_DONE}" ]; then
TELEMETRY_GLANCE_DONE=1
cat <<EOF >> /etc/glance/glance-api.conf
[DEFAULT]
notification_driver = messaging
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
EOF
service glance-registry restart
service glance-api restart
echo "TELEMETRY_GLANCE_DONE=\"${TELEMETRY_GLANCE_DONE}\"" >> $SETTINGS
fi
#
# Install the Telemetry service for Cinder
#
if [ -z "${TELEMETRY_CINDER_DONE}" ]; then
TELEMETRY_CINDER_DONE=1
cat <<EOF >> /etc/cinder/cinder.conf
[DEFAULT]
control_exchange = cinder
notification_driver = cinder.openstack.common.notifier.rpc_notifier
EOF
service cinder-api restart
service cinder-scheduler restart
fqdn="$STORAGEHOST.$EEID.$EPID.$OURDOMAIN"
if [ "${STORAGEHOST}" = "${CONTROLLER}" ]; then
$DIRNAME/setup-storage-telemetry.sh
else
# Copy the latest settings (passwords, endpoints, whatever) over
scp -o StrictHostKeyChecking=no $SETTINGS $fqdn:$SETTINGS
ssh -o StrictHostKeyChecking=no $fqdn $DIRNAME/setup-storage-telemetry.sh
fi
echo "TELEMETRY_CINDER_DONE=\"${TELEMETRY_CINDER_DONE}\"" >> $SETTINGS
fi
#
# Install the Telemetry service for Swift
#
if [ -z "${TELEMETRY_SWIFT_DONE}" ]; then
TELEMETRY_SWIFT_DONE=1
chmod g+w /var/log/ceilometer
apt-get install -y python-ceilometerclient
keystone role-create --name ResellerAdmin
keystone user-role-add --tenant service --user ceilometer \
--role $(keystone role-list | awk '/ ResellerAdmin / {print $2}')
cat <<EOF >> /etc/swift/proxy-server.conf
[filter:ceilometer]
use = egg:ceilometer#swift
EOF
usermod -a -G ceilometer swift
sed -i -e 's/^\(pipeline.*=\)\(.*\)$/\1 ceilometer \2/' /etc/swift/proxy-server.conf
sed -i -e 's/^\(operator_roles.*=.*\)$/\1,ResellerAdmin/' /etc/swift/proxy-server.conf
swift-init proxy-server restart
echo "TELEMETRY_SWIFT_DONE=\"${TELEMETRY_SWIFT_DONE}\"" >> $SETTINGS
fi
#
# Get Us Some Databases!
#
if [ -z "${TROVE_DBPASS}" ]; then
TROVE_DBPASS=`$PSWDGEN`
TROVE_PASS=`$PSWDGEN`
apt-get install -y python-trove python-troveclient python-glanceclient \
trove-common trove-api trove-taskmanager
echo "create database trove" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on trove.* to 'trove'@'localhost' identified by '$TROVE_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on trove.* to 'trove'@'%' identified by '$TROVE_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
keystone user-create --name trove --pass $TROVE_PASS
keystone user-role-add --user trove --tenant service --role admin
keystone service-create --name trove --type database \
--description "OpenStack Database Service"
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ trove / {print $2}') \
--publicurl http://${CONTROLLER}:8779/v1.0/%\(tenant_id\)s \
--internalurl http://${CONTROLLER}:8779/v1.0/%\(tenant_id\)s \
--adminurl http://${CONTROLLER}:8779/v1.0/%\(tenant_id\)s \
--region regionOne
# Just slap these in.
cat <<EOF >> /etc/trove/trove.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
verbose = True
log_dir = /var/log/trove
trove_auth_url = http://${CONTROLLER}:5000/v2.0
nova_compute_url = http://${CONTROLLER}:8774/v2
cinder_url = http://${CONTROLLER}:8776/v1
swift_url = http://${CONTROLLER}:8080/v1/AUTH_
sql_connection = mysql://trove:${TROVE_DBPASS}@${CONTROLLER}/trove
notifier_queue_hostname = ${CONTROLLER}
default_datastore = mysql
# Config option for showing the IP address that nova doles out
add_addresses = True
network_label_regex = ^NETWORK_LABEL$
api_paste_config = /etc/trove/api-paste.ini
EOF
cat <<EOF >> /etc/trove/trove-taskmanager.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
verbose = True
log_dir = /var/log/trove
trove_auth_url = http://${CONTROLLER}:5000/v2.0
nova_compute_url = http://${CONTROLLER}:8774/v2
cinder_url = http://${CONTROLLER}:8776/v1
swift_url = http://${CONTROLLER}:8080/v1/AUTH_
sql_connection = mysql://trove:${TROVE_DBPASS}@${CONTROLLER}/trove
notifier_queue_hostname = ${CONTROLLER}
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
# It proxy's the token received from the user to send to nova via this admin users creds,
# basically acting like the client via that proxy token.
nova_proxy_admin_user = admin
nova_proxy_admin_pass = ${ADMIN_PASS}
nova_proxy_admin_tenant_name = service
taskmanager_manager = trove.taskmanager.manager.Manager
EOF
cat <<EOF >> /etc/trove/trove-conductor.conf
[DEFAULT]
rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
verbose = True
log_dir = /var/log/trove
trove_auth_url = http://${CONTROLLER}:5000/v2.0
nova_compute_url = http://${CONTROLLER}:8774/v2
cinder_url = http://${CONTROLLER}:8776/v1
swift_url = http://${CONTROLLER}:8080/v1/AUTH_
sql_connection = mysql://trove:${TROVE_DBPASS}@${CONTROLLER}/trove
notifier_queue_hostname = ${CONTROLLER}
EOF
cat <<EOF >> /etc/trove/api-paste.ini
[filter:authtoken]
auth_uri = http://${CONTROLLER}:5000/v2.0
identity_uri = http://${CONTROLLER}:35357
admin_user = trove
admin_password = ${TROVE_PASS}
admin_tenant_name = service
signing_dir = /var/cache/trove
EOF
sed -i -e "s/^\\(.*auth_host.*=.*\\)$/#\1/" /etc/trove/api-paste.ini
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/trove/api-paste.ini
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/trove/api-paste.ini
mkdir -p /var/cache/trove
chown -R trove:trove /var/cache/trove
su -s /bin/sh -c "/usr/bin/trove-manage db_sync" trove
su -s /bin/sh -c "trove-manage datastore_update mysql ''" trove
# XXX: Create a trove image!
# trove-manage --config-file /etc/trove/trove.conf datastore_version_update \
# mysql mysql-5.5 mysql $glance_image_ID mysql-server-5.5 1
service trove-api restart
service trove-taskmanager restart
service trove-conductor restart
echo "TROVE_DBPASS=\"${TROVE_DBPASS}\"" >> $SETTINGS
echo "TROVE_PASS=\"${TROVE_PASS}\"" >> $SETTINGS
fi
#
# Get some Data Processors!
#
if [ -z "${SAHARA_DBPASS}" ]; then
SAHARA_DBPASS=`$PSWDGEN`
SAHARA_PASS=`$PSWDGEN`
echo "create database sahara" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on sahara.* to 'sahara'@'localhost' identified by '$SAHARA_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on sahara.* to 'sahara'@'%' identified by '$SAHARA_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
keystone user-create --name sahara --pass $SAHARA_PASS
keystone user-role-add --user sahara --tenant service --role admin
keystone service-create --name sahara --type data_processing \
--description "OpenStack Data Processing Service"
keystone endpoint-create \
--service-id $(keystone service-list | awk '/ sahara / {print $2}') \
--publicurl http://${CONTROLLER}:8386/v1.1/%\(tenant_id\)s \
--internalurl http://${CONTROLLER}:8386/v1.1/%\(tenant_id\)s \
--adminurl http://${CONTROLLER}:8386/v1.1/%\(tenant_id\)s \
--region regionOne
# XXX: http://askubuntu.com/questions/555093/openstack-juno-sahara-data-processing-on-14-04
apt-get install -y python-pip
# sahara deps
apt-get install -y python-eventlet python-flask python-oslo.serialization
pip install sahara
mkdir -p /etc/sahara
sed -i -e "s/^.*connection.*=.*$/connection = mysql:\\/\\/sahara:${SAHARA_DBPASS}@$CONTROLLER\\/sahara/" /etc/sahara/sahara.conf
# Just slap these in.
cat <<EOF >> /etc/sahara/sahara.conf
[DEFAULT]
verbose = True
auth_strategy = keystone
use_neutron=true
[keystone_authtoken]
auth_uri = http://$CONTROLLER:5000/v2.0
identity_uri = http://$CONTROLLER:35357
admin_tenant_name = service
admin_user = sahara
admin_password = ${SAHARA_PASS}
[ec2authtoken]
auth_uri = http://${CONTROLLER}:5000/v2.0
EOF