Ceilometer network cumulative meter reset on guest reboot

asked 2015-12-16 04:20:33 -0600

sxc731 gravatar image

updated 2015-12-16 04:50:20 -0600

It appears the cumulative meter network.outgoing.bytes (among others?) gets reset every time a guest OS is rebooted (at least with a sample of CentOS 6 & 7 hosts; running atop Juno). That's understandable in as much as Ceilometer likely tracks a host interface volume counter.

Thus, if I need to get a measure of the real throughput of an interface between two dates (say, for billing purposes), I cannot simply take network.outgoing.bytes@later_date - network.outgoing.bytes@earlier_date; the value of the meter needs to be read just before every intervening reboot...

Which begs the question: how do I find those reboots?

I thought I could simply run a Ceilometer query to find points where the cumulative meter shows a low number of bytes, as in:

ceilometer sample-list -m network.outgoing.bytes -l 10 -q 'resource_id=instance-xx-xx-xx-tapxxxx;volume<10000'

Alas, the API doesn't appear to support querying this field:

Client-side error: Unknown argument: "volume": unrecognized field in query: [<Query u'resource_id' eq u'instance-xxxx' None>, <Query u'volume' lt u'10000' None>], valid keys: ['end', 'end_timestamp_op', 'message_id', 'metaquery', 'meter', 'project', 'resource', 'source', 'start', 'start_timestamp_op', 'user']

Ceilometer 'events' samples don't appear to contain reboot events (understandably when they're guest initiated). I suppose I could check the instance's wtmp but that seems a little intrusive. Or I could check enough intervening samples to sniff out the reboots. Surely there is a better solution?

edit retag flag offensive close merge delete


The plot thickens: CentOS 6 appears to behave differently from CentOS 7; CentOS 6 guests also experience cumulative meters resets but they seem to occur independently from reboots; making them even more "interesting" to find...

sxc731 gravatar imagesxc731 ( 2015-12-17 07:32:53 -0600 )edit