Commit bcee4ed9 authored by David Johnson's avatar David Johnson

Enable openstack-slothd for Juno too; get rid of some cruft.

parent 00b7d787
......@@ -271,8 +271,6 @@ def fetchall(client):
# Ok, collect all the statistics, grouped by VM, for the period. We
# have to specify this duration
#
#qm = QueryManager()
q = client.query_samples.query(limit=1)
for period in PERIODS:
periods[period] = {}
vm_dict = dict() #count=vm_0,list=[])
......@@ -292,7 +290,7 @@ def fetchall(client):
for meter in DMETERS:
mdict = {}
statistics = client.statistics.list(meter,#period=period,
groupby='resource_id',
groupby=['resource_id'],
q=q)
LOG.debug("Statistics for %s during period %d (len %d): %s"
% (meter,period,len(statistics),pp.pformat(statistics)))
......@@ -357,7 +355,7 @@ def fetchall(client):
pass
mdict = {}
statistics = client.statistics.list(meter,#period=period,
groupby='resource_id',
groupby=['resource_id'],
q=q)
LOG.debug("Statistics for %s during period %d (len %d): %s"
% (meter,period,len(statistics),pp.pformat(statistics)))
......
......@@ -2721,12 +2721,11 @@ fi
#
# Install and startup the slothd-for-openstack idleness detector
#
cp -p $DIRNAME/openstack-slothd.py $OURDIR/
if [ $OSVERSION -ge $OSKILO ]; then
cp -p $DIRNAME/openstack-slothd.py $OURDIR/
cat <<EOF >/etc/systemd/system/openstack-slothd.service
[Unit]
Description=OpenStack Slothd
Description=Cloudlab OpenStack Resource Usage Collector
After=network.target network-online.target local-fs.target
Wants=network.target
Before=rabbitmq-server.service
......@@ -2745,6 +2744,33 @@ EOF
systemctl enable openstack-slothd.service
systemctl restart openstack-slothd.service
else
cat <<EOF >/etc/init/openstack-slothd.conf
# openstack-slothd - Cloudlab OpenStack Resource Usage Collector
#
# openstack-slothd collects OpenStack resource usage statistics
description "Cloudlab OpenStack slothd"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
expect stop
console none
pre-start script
test -x /root/setup/openstack-slothd.py || { stop; exit 0; }
end script
exec /root/setup/openstack-slothd.py &
EOF
service openstack-slothd enable
service openstack-slothd start
fi
RANDPASSSTRING=""
......
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