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
This diff is collapsed.
#!/bin/sh
#
# Our default configuration
#
CONTROLLER="controller"
NETWORKMANAGER="networkmanager"
STORAGEHOST="controller"
OBJECTHOST="controller"
SETUP_FLAT_DATA_NETWORK=1
USE_EXISTING_DATA_IPS=1
EXTERNAL_NETWORK_INTERFACE="eth0"
EXTERNAL_NETWORK_BRIDGE="br-ex"
DATA_NETWORK_INTERFACE="eth1"
DATA_NETWORK_BRIDGE="br-int"
EXT_FLOAT_IP_START=128.110.154.240
EXT_FLOAT_IP_END=128.110.154.254
BOOTDIR=/var/emulab/boot
TMCC=/usr/local/etc/emulab/tmcc
......@@ -28,8 +44,6 @@ fi
TTF=`mktemp topomap.XXXXXX`
$TMCC topomap | gunzip > $TTF
CONTROLLER="controller"
NETWORKMANAGER="networkmanager"
NODES=`cat $TTF | grep -v '^#' | sed -n -e 's/^\([a-zA-Z0-9\-]*\),.*:.*$/\1/p' | xargs`
COMPUTENODES=""
for node in $NODES
......@@ -52,12 +66,7 @@ SETTINGS=$OURDIR/settings
mkdir -p $OURDIR
cd $OURDIR
SETUP_FLAT_DATA_NETWORK=1
USE_EXISTING_DATA_IPS=1
EXTERNAL_NETWORK_INTERFACE="eth0"
EXTERNAL_NETWORK_BRIDGE="br-ex"
DATA_NETWORK_INTERFACE="eth1"
DATA_NETWORK_BRIDGE="br-int"
EXT_FLOAT_IP_START=128.110.154.240
EXT_FLOAT_IP_END=128.110.154.254
if [ ! -f $OURDIR/apt-updated ]; then
apt-get update
touch $OURDIR/apt-updated
fi
#!/bin/sh
##
## Setup a OpenStack object storage node.
##
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" != "$OBJECTHOST" ]; then
exit 0;
fi
if [ -f $OURDIR/setup-object-host-done ]; then
exit 0
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
myip=`cat $OURDIR/mgmt-hosts | grep $HOSTNAME | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
apt-get install -y xfsprogs rsync
mkdir -p /storage
dd if=/dev/zero of=/storage/pv.objectstore.loop.1 bs=32768 count=524288
LDEV=`losetup -f`
losetup $LDEV /storage/pv.objectstore.loop.1
mkfs.xfs $LDEV
mkdir -p /storage/mnt/swift
cat <<EOF >> /etc/fstab
$LDEV /storage/mnt/swift/pv.objectstore.loop.1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
EOF
mkdir -p /storage/mnt/swift/pv.objectstore.loop.1
mount /storage/mnt/swift/pv.objectstore.loop.1
cat <<EOF >> /etc/rsyncd.conf
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = $myip
[account]
max connections = 8
path = /storage/mnt/swift
read only = false
lock file = /var/lock/account.lock
[container]
max connections = 8
path = /storage/mnt/swift
read only = false
lock file = /var/lock/container.lock
[object]
max connections = 8
path = /storage/mnt/swift
read only = false
lock file = /var/lock/object.lock
EOF
cat <<EOF >> /etc/default/rsync
RSYNC_ENABLE=true
EOF
service rsync start
apt-get install -y swift swift-account swift-container swift-object
curl -o /etc/swift/account-server.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/account-server.conf-sample
curl -o /etc/swift/container-server.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/container-server.conf-sample
curl -o /etc/swift/object-server.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/object-server.conf-sample
cat <<EOF >> /etc/swift/account-server.conf
[DEFAULT]
bind_ip = $myip
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /storage/mnt/swift
[pipeline:main]
pipeline = healthcheck recon account-server
[filter:recon]
recon_cache_path = /var/cache/swift
EOF
cat <<EOF >> /etc/swift/container-server.conf
[DEFAULT]
bind_ip = $myip
bind_port = 6001
user = swift
swift_dir = /etc/swift
devices = /storage/mnt/swift
[pipeline:main]
pipeline = healthcheck recon container-server
[filter:recon]
recon_cache_path = /var/cache/swift
EOF
cat <<EOF >> /etc/swift/object-server.conf
[DEFAULT]
bind_ip = $myip
bind_port = 6000
user = swift
swift_dir = /etc/swift
devices = /storage/mnt/swift
[pipeline:main]
pipeline = healthcheck recon object-server
[filter:recon]
recon_cache_path = /var/cache/swift
EOF
chown -R swift:swift /storage/mnt/swift
mkdir -p /var/cache/swift
chown -R swift:swift /var/cache/swift
swift-init all start
touch $OURDIR/setup-object-host-done
exit 0
#!/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"
HOSTNAME=`hostname -s`
if [ "$HOSTNAME" != "$STORAGEHOST" ]; then
exit 0;
fi
if [ -f $OURDIR/setup-storage-telemetry-done ]; then
exit 0
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
cat <<EOF >> /etc/cinder/cinder.conf
[DEFAULT]
control_exchange = cinder
notification_driver = cinder.openstack.common.notifier.rpc_notifier
EOF
service cinder-volume restart
touch $OURDIR/setup-storage-telemetry-done
exit 0
#!/bin/sh
##
## Setup a OpenStack compute node for Nova.
##
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" != "$STORAGEHOST" ]; then
exit 0;
fi
if [ -f $OURDIR/setup-storage-host-done ]; then
exit 0
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
myip=`cat $OURDIR/mgmt-hosts | grep $HOSTNAME | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
apt-get install -y lvm2
# XXX: have to copy the .bak versions back into place on uBoot-nodes.
cp -p /boot/boot.scr.bak /boot/boot.scr
cp -p /boot/uImage.bak /boot/uImage
cp -p /boot/uInitrd.bak /boot/uInitrd
mkdir -p /storage
dd if=/dev/zero of=/storage/pvloop.1 bs=32768 count=524288
LDEV=`losetup -f`
losetup $LDEV /storage/pvloop.1
pvcreate /dev/loop0
vgcreate cinder-volumes /dev/loop0
apt-get install -y cinder-volume python-mysqldb
if [ "${STORAGEHOST}" != "${CONTROLLER}" ]; then
# 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 = $myip
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
fi
service tgt restart
service cinder-volume restart
rm -f /var/lib/cinder/cinder.sqlite
touch $OURDIR/setup-storage-host-done
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment